// TH3WindowMenu.mn Use cCJCommandBarSystem.pkg Use cCJMDIWindowsMenuItem.pkg Object oWindowMenu is a cCJMDIWindowsMenuItem Set peControlType to xtpControlPopup Set psCaption to "&Window" Set psToolTip to "Window Management" Set psDescription to "The Hammer application window management functions." Object oDisplayOptionsMenu is a cCJMenuItem Set peControlType to xtpControlPopup Set psCaption to "Display Options" Set psToolTip to "Display Options" Set psDescription to "Display Options" Object oDisplayCodeExplorerMenuItem is a cCJMenuItem Set pbAddToDesignerMenu to True Set psCaption to "Code Explorer" Set psToolTip to "Show/Hide Code Explorer" Set psDescription to "Show/Hide Code Explorer" Set psShortcut to "" Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Set pbCodeViewVisible of ghoEditorProperties to (not(pbCodeViewVisible(ghoEditorProperties))) Send CAWindowCodeExplorerONOFF to hoClient (pbCodeViewVisible(ghoEditorProperties)) End_Procedure Function IsChecked Returns Boolean Function_Return (pbCodeViewVisible(ghoEditorProperties)) End_Function End_Object Object oDisplayMessageListMenuItem is a cCJMenuItem Set pbAddToDesignerMenu to True Set psCaption to "Output Pane" Set psToolTip to "Show/Hide Output Pane" Set psDescription to "Show/Hide Output Pane" Set psShortcut to "" Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send CAOutputPaneToggle to hoClient End_Procedure Function IsChecked Returns Boolean Integer bVisible Get ComVisible of ghoOutputPane to bVisible Function_Return bVisible End_Function End_Object Object oDisplayToolsMenuItem is a cCJMenuItem Set pbAddToDesignerMenu to True Set psCaption to "Tools Pane" Set psToolTip to "Show/Hide Tools Pane" Set psDescription to "Show/Hide Tools Pane" Set psShortcut to "" Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send CAToolsPaneToggle to hoClient End_Procedure Function IsChecked Returns Boolean Integer bVisible Get ComVisible of ghoToolsPane to bVisible Function_Return bVisible End_Function End_Object Object oStatusbarMenu is a cCJMenuItem Set pbAddToDesignerMenu to True Set psCaption To "Status Bar" Set psToolTip to "Show/Hide Status Bar" Set psDescription to "Show/Hide Status Bar" Set psCategory to "Window" Procedure OnExecute Variant vCommandBarControl Handle hoCommandBars hoClientArea Get CommandBarSystemObject to hoCommandBars Get ClientAreaObject of hoCommandBars to hoClientArea If hoClientArea ; Send Toggle_StatusBar of (Parent(hoClientArea)) End_Procedure Function IsChecked Returns Boolean Boolean bOn Handle hoCommandBars hoClientArea Get CommandBarSystemObject to hoCommandBars Get ClientAreaObject of hoCommandBars to hoClientArea If hoClientArea ; Get StatusBar_State of (Parent(hoClientArea)) to bOn Function_Return bOn End_Function End_Object End_Object Object oWindowSynchronizeMenuItem is a cCJMenuItem Set pbAddToDesignerMenu to True Set psCaption to "S&ynchronize CodeView" Set psToolTip to "Synchronize CodeView" Set psDescription to "Synchronize CodeView" Set psImage to "Refresh16.ico" Procedure OnExecute Variant vCommandBarControl Send SyncCodeView to (Focus(Self)) End_Procedure Function IsEnabled Returns Boolean Handle hoCA hoID hoID2 Boolean bEnabled Integer iFlag iDel Get Client_Id to hoCA Move (Focus(Desktop)) to hoID If hoID Begin Move (Parent(hoID)) to hoID Get Delegation_Mode of hoID to iDel Set Delegation_Mode of hoID to no_delegate_or_error Get GetEditViewID of hoID to hoID2 Set Delegation_Mode of hoID to iDel End If hoID2 Move (isFileViewWindow(hoCA,hoID2)) to bEnabled Else Move 0 to bEnabled Function_Return bEnabled End_Function End_Object #IFDEF TH_TRANSLATION Procedure Translate Set psCaption of oDisplayOptionsMenu to gILanguage[312] Set psToolTip of oDisplayOptionsMenu to gILanguage[313] Set psDescription of oDisplayOptionsMenu to gILanguage[314] Set psCaption of oDisplayCodeExplorerMenuItem to gILanguage[315] Set psToolTip of oDisplayCodeExplorerMenuItem to gILanguage[316] Set psDescription of oDisplayCodeExplorerMenuItem to gILanguage[317] Set psCaption of oDisplayMessageListMenuItem to gILanguage[318] Set psToolTip of oDisplayMessageListMenuItem to gILanguage[319] Set psDescription of oDisplayMessageListMenuItem to gILanguage[320] Set psCaption of oDisplayToolsMenuItem to gILanguage[321] Set psToolTip of oDisplayToolsMenuItem to gILanguage[322] Set psDescription of oDisplayToolsMenuItem to gILanguage[323] Set psCaption of oStatusbarMenu to gILanguage[324] Set psToolTip of oStatusbarMenu to gILanguage[325] Set psDescription of oStatusbarMenu to gILanguage[326] Set psCaption of oWindowSynchronizeMenuItem to gILanguage[327] Set psToolTip of oWindowSynchronizeMenuItem to gILanguage[328] Set psDescription of oWindowSynchronizeMenuItem to gILanguage[329] End_Procedure #ENDIF Procedure OnPopupInit Variant vCommandBarControl Handle hCommandBarControls Handle hClientArea hView String sLabel sDesc Integer i iWindows Handle[] hArrayOfWindows Variant vItem Get phArrayOfWindows to hArrayOfWindows Move (SizeOfArray(hArrayOfWindows)) to iWindows For i from 0 to (iWindows-1) Send Destroy of hArrayOfWindows[i] // assume this removes all menu items of this action Loop Move (ResizeArray(hArrayOfWindows,0)) to hArrayOfWindows Move 0 to i Get Client_Id to hClientArea // object id of client area If (hClientArea > 0) Begin Get Next_Mdi_Dialog of hClientArea True to hView // find first view While (hView <> 0) If (Active_State(hView)) Begin // create the action Get Create U_cCJMDIWindowItem to hArrayOfWindows[i] Get Label of hView to sLabel // caption bar (name) of view Set psCaption of hArrayOfWindows[i] to sLabel #IFDEF TH_TRANSLATION Move (Replace("%1", gILanguage[330], sLabel)) to sDesc #ELSE Move ("Make this view (" - trim(sLabel) - ") the active window.") to sDesc #ENDIF Set psDescription of hArrayOfWindows[i] to sDesc If (current_scope(desktop)=hView and View_mode(hView)<>VIEWMODE_ICONIZE) Begin Set pbChecked of hArrayOfWindows[i] to True End Set phWindow of hArrayOfWindows[i] to hView // used by custom OnExecute If (i=0) Begin Set pbControlBeginGroup of hArrayOfWindows[i] to True End Get AddDynamicControl of hArrayOfWindows[i] hCommandBarControls to vItem Increment i End Get Next_Mdi_Dialog of hClientArea False to hView // find next Loop End Set phArrayOfWindows to hArrayOfWindows End_Procedure End_Object