//***************************************************************************************** // Copyright (c) 2000 Michael Kurz // All rights reserved. // If you want to use this source in your applications conatct: // // $FileName : cTabDialogEx.Pkg // $ProjectName : Shared Classes // $Author : Michael Kurz // $Created : 01-25-2001 @ 19:00 // // Contents: // Extends the tabdialog with additional features. // - // // $Rev History // //***************************************************************************************** Define TCS_SCROLLOPPOSITE for |CI$0001 // assumes multiline tab Define TCS_BOTTOM for |CI$0002 Define TCS_RIGHT for |CI$0002 Define TCS_MULTISELECT for |CI$0004 // allow multi-select in button mode Define TCS_FLATBUTTONS for |CI$0008 Define TCS_FORCEICONLEFT for |CI$0010 Define TCS_FORCELABELLEFT for |CI$0020 Define TCS_HOTTRACK for |CI$0040 Define TCS_VERTICAL for |CI$0080 Define TCS_TABS for |CI$0000 Define TCS_BUTTONS for |CI$0100 Define TCS_SINGLELINE for |CI$0000 Define TCS_MULTILINE for |CI$0200 Define TCS_RIGHTJUSTIFY for |CI$0000 Define TCS_FIXEDWIDTH for |CI$0400 Define TCS_RAGGEDRIGHT for |CI$0800 Define TCS_FOCUSONBUTTONDOWN for |CI$1000 Define TCS_OWNERDRAWFIXED for |CI$2000 Define TCS_TOOLTIPS for |CI$4000 Define TCS_FOCUSNEVER for |CI$8000 Define TCS_EX_FLATSEPARATORS for |CI$0001 Define TCS_EX_REGISTERDROP for |CI$0002 // Possible_States for piButtonState. Define Button_Top for 0 Define Button_Bottom for 1 Define Button_Left for 2 Define Button_Right for 3 Use cTabDialogShadow.pkg Class cTabDialogEx is a cTabDialogShadow Procedure Construct_Object Property Integer piButtonStateEx Button_Top Property Boolean pbAllowKeyNavigation True Forward Send Construct_Object End_Procedure // // It was possible in The Hammer to get it to crash by trying to use keyboard // navigation on the codeview tabs. Can't find out why, but can stop the crash // by simply disabling keyboard navigation on the tabpage button. // Procedure Next Boolean bAllow Get pbAllowKeyNavigation to bAllow If (bAllow) Begin Forward Send Next End End_Procedure Procedure Switch Boolean bAllow Get pbAllowKeyNavigation to bAllow If (bAllow) Begin Forward Send Switch End End_Procedure Procedure set piButtonState Integer iState set piButtonStateEx to iState set peTabPosition to iState // VDF7 and Higher, there this is already defined and need to be set. End_Procedure Function piButtonState returns Integer Function_Return (piButtonStateEx(Self)) End_Function Procedure Page Integer iFlag Integer iState move (piButtonState(Self)) to iState if (iState eq Button_Bottom) set Window_Style to TCS_BOTTOM true if (iState eq Button_Right) set Window_Style to TCS_RIGHT true if ((iState eq Button_Right) or (iState eq Button_Left)) ; set Window_Style to TCS_Vertical true Forward send Page iFlag End_Procedure Procedure DisableTabPage Integer tabpageobj Integer iFlag set piActiveState of tabpageobj to iFlag set Visible_State of tabpageobj to (Not(iFlag)) if iFlag set Focus_ModeEx of tabpageobj to nonfocusable Else set Focus_ModeEx of tabpageobj to focusable End_Procedure Function Deactivate_Tab Integer tab# Integer tabpageobj Returns Integer send DisableTabPage tabpageobj True Procedure_Return 0 End_Function Function Tab_Change Integer totab Integer PointerMode returns Integer Integer tabobj rval fromtab fromobj toobj focobj oldst iRet get In_Tab_Change_State to OldSt set In_Tab_Change_State to true get current_Item to fromtab // from tab item if (totab gt (item_count( Current_Object))) move fromtab to totab get tab_page_id item fromtab to fromobj // from tab page get tab_page_id item totab to toobj // to tab page send DisableTabPage fromobj true send DisableTabPage toobj False Forward get Tab_Change totab PointerMode to iRet Function_Return iRet End_Function End_Class // This TabPage doesn deactivate during tab change! // There need to be done some further changed. Class cTabPageEx is a cTabPageShadow Procedure Construct_Object Forward send Construct_Object Property Integer piActiveState True set Popup_State to False End_Procedure Function Active_State returns Integer Integer iRet Forward get Active_State to iRet if (piActiveState(Self)) Function_Return iRet Else Function_Return False End_Function Procedure set Focus_ModeEx Integer iMode Broadcast set Focus_Mode to iMode set Focus_Mode to iMode End_Procedure End_Class