// TH3FileToolBar.pkg (File Toolbar Pane) // Created by Sergey V Natarov (senatc@postman.ru) on 09/03/2017 @ 11:40 // Use cCJCommandBarSystem.pkg Class cCJOpenFileByTypeMenuItem is a cCJMenuItem Procedure Construct_Object Forward Send Construct_Object Property Integer piTypeIndex 0 End_Procedure Procedure OnExecute Variant vCommandBarControl Integer iType Handle hoClient Get Client_Id to hoClient Get piTypeIndex to iType Send CAOpenMultipleFilesByType to hoClient iType End_Procedure End_Class Class cCreateNewPopupItem is a cCJMenuItem Procedure Construct_Object Forward Send Construct_Object Set pbControlBeginGroup to True Set psCaption to "Create New" Set psToolTip to "New source file" Set psDescription to "Create new source file" Set psShortcut to "" Set psImage to "ActionNew.ico" End_Procedure Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send CANewFile to hoClient End_Procedure End_Class Object oFileToolBar is a cCJToolbar Set psTitle to "File" Object oNewItem is a cCJMenuItem Set pbAddToDesignerMenu to True //Set peControlStyle to xtpButtonAutomatic Set psCaption to "&New" Set psToolTip to "Create New File" Set psDescription to "Create a new file within the current workspace" Set psShortcut to "Ctrl+N" Set psImage to "THNew32.ico" Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send CANewFile to hoClient End_Procedure Function CreateComControl Handle hoControls Returns Variant Variant vControl Forward Get CreateComControl hoControls to vControl Send ComSetIconSize 32 32 Function_Return vControl End_Function End_Object Object oOpenItem is a cCJMenuItem Property Handle[] phArrayOfWindows Set pbAddToDesignerMenu to True Set peControlType to xtpControlSplitButtonPopup //xtpControlPopup Set peControlStyle to xtpButtonIcon Set psCaption to "Open" Set psToolTip to "Open file" Set psDescription to "Open source file" Set psShortcut to "" Set psImage to "THOpen32.ico" Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send CAOpenMultipleFiles to hoClient End_Procedure Procedure OnPopupInit Variant vCommandBarControl Handle hCommandBarControls Forward Send OnPopupInit vCommandBarControl hCommandBarControls Integer iItem Integer iMaxItems iWindows String sType String sDescription sDesc String sTypes Handle[] hArrayOfWindows Variant vItem Move 15 to iMaxItems Get psFileTypes of ghoEditorProperties to sTypes // Delete Data Get phArrayOfWindows to hArrayOfWindows Move (SizeOfArray(hArrayOfWindows)) to iWindows For iItem from 0 to (iWindows-1) Send Destroy of hArrayOfWindows[iItem] // assume this removes all menu items of this action Loop Move (ResizeArray(hArrayOfWindows,0)) to hArrayOfWindows // Generate Menu Move 0 to iItem While (pos("|",sTypes)<>0 and iItem