Use Windows.pkg Use cApplication.pkg Use cCJCommandBars.pkg Class cTHCJDialogBar is a cCJDialogBar Procedure Construct_Object Forward Send Construct_Object // Property Handle phoChildObject 0 End_Procedure Procedure Translate String sCaption Set ComCaption to sCaption //If (phoChildObject(Self)) ; // Send Translate to (phoChildObject(Self)) End_Procedure End_Class { DesignerClass=cDTToolPanel } { OverrideProcedureSet=Border_Style InitialValue='Border_None' } { OverrideProperty=Visible_State DesignTime=False } Class cCJToolPanel is a Container3d Procedure Construct_Object Forward Send Construct_Object { MethodType=Property } Property String psLabel '' { MethodType=Property InitialValue=True Category='Behavior' } Property Boolean pbScopeToView True { MethodType=Property InitialValue=xtpBarFloating } { EnumList='xtpBarTop,xtpBarBottom,xtpBarLeft,xtpBarRight,xtpBarFloating' } Property Integer peBarPosition xtpBarFloating { DesignTime=False } Property Handle phoDialogBar // Parent Property Boolean pbResizable True Set Border_Style to Border_None End_Procedure // backward compatiblity Procedure Set ComVisible Boolean bState Set Visible_State to bState Send Show_Panel bState End_Procedure // The ToolPanel is a 3DContainer with a cTHDialogBar presented on top of it. // Via the toolbar button we disable the 3DContainer and set it's visible state to false // Via the x-button the visible state of the cTHDialogBar is set to false Function ComVisible Returns Boolean Boolean bState bBarState bIsCreated Handle hoDialogBar Move True to bBarState Get Visible_State to bState Get phoDialogBar to hoDialogBar If (Object_Id(hoDialogBar)<>0) Begin Get IsComObjectCreated of hoDialogBar to bIsCreated If (bIsCreated) Begin Get ComVisible of hoDialogBar to bBarState End End Function_Return (bState and bBarState) End_Function Procedure Show_Panel Boolean bState Handle hoToolPane Get phoDialogBar to hoToolPane If (hoToolPane) Set ComVisible of hoToolPane to bState End_Procedure Procedure Close_Panel Send Show_Panel False End_Procedure Procedure Activate Returns Integer Integer iErr Handle hoToolPane Handle hoScopeObj Handle hoMain hoClient Boolean IsScoped Get pbScopeToView to IsScoped Get Current_Scope to hoScopeObj If (not(Active_State(Self)) and not(IsScoped) and (hoScopeObj > Desktop)) Begin If (ghoApplication) Get phoMainPanel of ghoApplication to hoMain If (hoMain) Get Client_Id of hoMain to hoClient If (hoClient) Move hoClient to hoMain If (hoMain) Send Activate of hoMain End Forward Get msg_Activate to iErr If (not(iErr)) Send Show_Panel True Procedure_Return iErr End_Procedure // Activate {MethodType=Event} Procedure OnCreateToolPanel End_Procedure Procedure Create_ToolPanel Variant vToolPane String sLabel sObjName sTitle Boolean bResizable Integer eBarPosition eDocking Integer iSize iWidth iHeight Integer iMaxSize Handle hoToolPane hoMainPanel Handle hWnd hoClientId If (ghoCommandBars) Begin Get psLabel to sLabel Get Object_Label to sObjName Get Container_Handle to hWnd Get pbResizable to bResizable Move (sObjName + "Pane") to sObjName Get piMinSize to iSize If (iSize=0) Get Size to iSize Get DialogToGui (Hi(iSize)) (Low(iSize)) to iSize Move (Hi(iSize)) to iHeight Move (Low(iSize)) to iWidth Get peBarPosition to eBarPosition Get ComAddDialogBar of ghoCommandBars sLabel eBarPosition to vToolPane Get CreateNamed of ghoCommandBars (RefClass(cTHCJDialogBar)) sObjName to hoToolPane If (hoToolPane) Begin Set pvComObject of hoToolPane to vToolPane Set ComTitle of hoToolPane to sLabel Set ComChildHandle of hoToolPane to hWnd Set ComVisible of hoToolPane to False Set ComShowGripper of hoToolPane to True Set ComResizable of hoToolPane to bResizable // Send ComSetSize of hoToolPane iWidth iHeight End Set phoDialogBar to hoToolPane Send OnCreateToolPanel End End_Procedure Procedure Add_Focus Handle hoParent Returns Integer Integer iErr Handle hoToolPane Forward Get msg_Add_Focus hoParent to iErr If (not(iErr)) Begin // Just Once If (ghoCommandBars) Send AddActiveAction of ghoCommandBars Self Else Send Update Send OnResize End Procedure_Return iErr End_Procedure Procedure OnUpdate End_Procedure Procedure Update Handle hoToolPane // Turn OFF after Just Once If (ghoCommandBars) Send RemoveActiveAction of ghoCommandBars Self Send Create_ToolPanel Send Show_Panel (Visible_State(Self)) Send OnUpdate End_Procedure Function DEO_Object Returns Boolean Function_Return False End_Function Function ToolPanel_Handle Returns Handle Function_Return (Self) End_Function Procedure End_Construct_Object String sLabel Integer iBorder Boolean bResizable Forward Send End_Construct_Object Set Locate_Mode to SMART_LOCATE Get Label to sLabel Get Border_Style to iBorder Set Border_Style to Border_None Set Visible_State to False // same as default ComVisible Set Label to '' If (psLabel(Self)='') Set psLabel to sLabel // Get pbResizable to bResizable // If (not(bResizable)) Set pbResizable to (iBorder=Border_Thick) End_Procedure End_Class