Use Windows.pkg Use cCJToolPanel.pkg Use cCJCommandBarSystem.pkg Use Tools\cDatabaseTreeView.pkg Use Tools\cWorkspaceTreeView.pkg Use Tools\cOutputDialog.pkg Use Tools\cToolTabDialog.pkg Use Tools\TH3WorkspaceConfigure.dg Use cToolsPalette.pkg Object oToolPane is a cCJToolPanel Set Size to 310 181 Set piMinSize to 267 143 Set peBarPosition to xtpBarRight Set psLabel to "Tools" Set pbResizable to True Set pbScopeToView to False Set Border_Style to Border_None Move (Self) to ghoToolsPane Procedure OnCreateToolPanel Forward Send OnCreateToolPanel Set ComVisible to (pbToolsPaneVisible(ghoEditorProperties)) End_Procedure Object oToolsDialog is a cToolTabDialog Set Size to 309 181 Set Location to 1 1 Set Rotate_Mode to RM_Rotate Set peAnchors to anAll Set peTabStyle to tsFlatButtons Set peTabPosition to tpBottom Set TabWidth_Mode to twRaggedRight //twFixedWidth Set pbFlatSeparators to True // // Object oTP_Workspace is a TabPage Set piImageIndex to 3 Set Label to "Workspace" //"W" Set Tab_ToolTip_Value to 'Workspace' // Object oWsCommandBar is a cCJCommandBarSystem Object oWsToolBar is a cCJToolbar Set psTitle to "Manage Workspace" Set pbCloseable to False Set pbCustomizable to False Set pbEnableDocking to False Set pbGripper to False Object oAddFolderMenuItem is a cCJMenuItem Set psCaption to "Add Folder" Set psToolTip to "Add Folder" Set psImage to "THAddFolder16.ico" Procedure OnExecute Variant vCommandBarControl Send mAddFolder End_Procedure End_Object Object oRemoveFolderMenuItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Remove Folder" Set psToolTip to "Remove Folder" Set psImage to "THRemoveFolder16.ico" Set pbActiveUpdate to True Procedure OnExecute Variant vCommandBarControl Send mRemoveElement End_Procedure Function IsEnabled Returns Boolean Boolean bEnabled Get CanRemoveElement of (oFilesTree(Self)) to bEnabled Function_Return bEnabled End_Function End_Object Object oCollapseFolderMenuItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Collapse" Set psToolTip to "Collapse Workspace Tree" Set psImage to "Collapse16.ico" Procedure OnExecute Variant vCommandBarControl Send CollapseFilesTree End_Procedure End_Object Object oExpandFolderMenuItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Expand" Set psToolTip to "Expand Workspace Tree" Set psImage to "Expand16.ico" Procedure OnExecute Variant vCommandBarControl Send ExpandFilesTree End_Procedure End_Object Object oRefreshFoldersMenuItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Refresh" Set psToolTip to "Refresh Workspace Tree" Set psImage to "Refresh16.ico" Procedure OnExecute Variant vCommandBarControl Send LoadWorkspaceStructure to oFilesTree Send ClearFilter of (oFilter(oTP_Workspace)) End_Procedure End_Object Object oShowPathMenuItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Paths" Set psToolTip to "Show File Path" Set psImage to "Tooltip16.ico" Set pbChecked to True Procedure OnExecute Variant vCommandBarControl Send ToggleInfoTips End_Procedure Function IsChecked Returns Boolean Boolean bOn Get WorkspacePathTip to bOn Function_Return bOn End_Function End_Object Object oConfigMenuItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Configure" Set psToolTip to "Configure Project Workspace" Set psImage to "Configure16.ico" Procedure OnExecute Variant vCommandBarControl Send Popup to oTH3WorkspaceConfigure Send LoadWorkspaceStructure to oFilesTree End_Procedure End_Object #IFDEF TH_TRANSLATION Procedure Translate Set psTitle to gILanguage[433] Set psCaption of oAddFolderMenuItem to gILanguage[434] Set psToolTip of oAddFolderMenuItem to gILanguage[435] Set psCaption of oRemoveFolderMenuItem to gILanguage[436] Set psToolTip of oRemoveFolderMenuItem to gILanguage[437] Set psCaption of oCollapseFolderMenuItem to gILanguage[438] Set psToolTip of oCollapseFolderMenuItem to gILanguage[439] Set psCaption of oExpandFolderMenuItem to gILanguage[440] Set psToolTip of oExpandFolderMenuItem to gILanguage[441] Set psCaption of oShowPathMenuItem to gILanguage[442] Set psToolTip of oShowPathMenuItem to gILanguage[443] Set psCaption of oConfigMenuItem to gILanguage[444] Set psToolTip of oConfigMenuItem to gILanguage[445] End_Procedure #ENDIF End_Object // oWsToolBar End_Object //oWsCommandBar // Object oListFolders is an OpenDirDialog Set Dialog_Caption to "Select Source Directory" End_Object // Procedure mAddFolder Integer iOK String sFolder tTHWorkspace THWorkspace Get Show_Dialog of oListFolders to iOK If (iOK) Begin Get Dir_Name of oListFolders to sFolder Get pTHWorkspace of ghoApplication to THWorkspace Move sFolder to THWorkspace.saFolders[SizeOfArray(THWorkspace.saFolders)] Set pTHWorkspace of ghoApplication to THWorkspace Send THDoWriteWorkspace Send LoadWorkspaceStructure to oFilesTree End End_Procedure // Procedure mRemoveElement Integer iOK Handle hItem Integer iData iFolder iFolders iCount String[] saFileName saFolders String sFolder sDesc sTitle Get psFileName of oFilesTree to saFileName Get CurrentTreeItem of oFilesTree to hItem Get ItemData of oFilesTree hItem to iData //gILanguage[447] #IFDEF TH_TRANSLATION Move (Replace("%1", gILanguage[447], saFileName[iData])) to sDesc #ELSE Move ("Confirm you wish remove\n\n"*saFileName[iData]*"\n\nfrom The Hammer project?") to sDesc #ENDIF Move (_T("Confirmation", 448)) to sTitle Get YesNo_Box sDesc sTitle MBR_No to iOK If (iOK=MBR_Yes) Begin Send mRemoveFolder to oFilesTree saFileName[iData] Send THDoWriteWorkspace Send LoadWorkspaceStructure to oFilesTree End End_Procedure // Object oFilesTree is a cWorkspaceTreeView Set Size to 281 180 Set Location to 24 0 Procedure End_Construct_Object Forward Send End_Construct_Object Get Object_Id to ghoWorkspaceFilesTree End_Procedure End_Object // oFilesTree Object oFilter is a Form Set Size to 11 196 Set Location to 14 0 Set peAnchors to anTopLeftRight Set Color to gtColorer[EC_TEXT].iBackC Set Prompt_Button_Mode to PB_PromptOn Set Form_Button_Bitmap 0 to "ClearFilter.bmp" On_Key Key_Down_Arrow Send GotoTree Procedure GotoTree Send Activate to oFilesTree End_Procedure Procedure OnChange Send UpdateTree End_Procedure Procedure ClearFilter String sValue Get Value to sValue If (sValue<>"") Begin Set Value to "" End End_Procedure // not really a prompt, but a delete text in one click option Procedure Prompt Send ClearFilter End_Procedure End_Object Procedure UpdateTree String sFilter Get Value of oFilter to sFilter Send SearchFiles to oFilesTree sFilter Set Color of oFilter to gtColorer[EC_TEXT].iBackC If (sFilter<>"") Set Color of oFilter to (RGB(255,200,200)) End_Procedure Procedure ExpandFilesTree Handle hItem Get RootItem of oFilesTree to hItem Send DoExpandAll to oFilesTree Send DoMakeItemFirstVisible to oFilesTree hItem Set piCollapsed of oFilesTree to False End_Procedure Procedure CollapseFilesTree Handle hItem Get RootItem of oFilesTree to hItem Send DoCollapseAll to oFilesTree hItem Send DoExpandItem to oFilesTree hItem Set piCollapsed of oFilesTree to True End_Procedure Procedure ToggleInfoTips Set pbEnableInfoTips of oFilesTree to (not(pbEnableInfoTips(oFilesTree(Self)))) End_Procedure Function WorkspacePathTip Returns Integer Function_Return (pbEnableInfoTips(oFilesTree(Self))) End_Function End_Object // oTP_Workspace // Object oTP_Database is a TabPage Set piImageIndex to 1 Set Label to "Data" //"D" Set Tab_ToolTip_Value to 'Database' Object oTablesTree is a cDatabaseTreeView Set Size to 271 180 Set Location to 11 0 End_Object // oParserTree Object oSortBy is a CheckBox Set Size to 10 50 Set Location to 283 1 Set Label to "Sort by Name" Set peAnchors to anBottomLeft Procedure OnChange Send UpdateTree End_Procedure End_Object Object oFilter is a Form Set Size to 11 196 Set Location to 1 0 Set Color to gtColorer[EC_TEXT].iBackC Set peAnchors to anTopLeftRight Set Prompt_Button_Mode to PB_PromptOn Set Form_Button_Bitmap 0 to "ClearFilter.bmp" On_Key kPrompt send None On_Key kClear send ClearFilter Procedure OnChange Send UpdateTree End_Procedure Procedure ClearFilter String sValue Get Value to sValue If (sValue<>"") Begin Set Value to "" End End_Procedure // not really a prompt, but a delete text in one click option Procedure Prompt Send ClearFilter End_Procedure End_Object Procedure UpdateTree Boolean bChecked String sFilter Get Checked_State of oSortBy to bChecked Get Value of oFilter to sFilter Set Color of oFilter to gtColorer[EC_TEXT].iBackC If (sFilter<>"") Set Color of oFilter to (RGB(255,200,200)) Send LoadTablesList to oTablesTree bChecked sFilter End_Procedure End_Object // TP_Database Object oTP_Palette is a TabPage Set piImageIndex to 0 Set Label to "Palette" Set Tab_ToolTip_Value to 'Palette' Object oPalette is a cToolsPalette Set Size to 305 200 Set Location to -1 -1 Function ButtonTemplate Integer iData Returns String String sOpenPath sVdfConfig sTemplate sObject sClass sName sPkg String[] saClassList saPackageList Get psClassList to saClassList Get psPackageList to saPackageList // Get psVdfRootDir of ghoWorkSpaceHandlerEx to sVdfConfig Move (sVdfConfig + "\Pkg\Config\;") to sVdfConfig Get_Attribute DF_OPEN_PATH to sOpenPath Set_Attribute DF_OPEN_PATH to (sVdfConfig+sOpenPath) Direct_Input (saClassList[iData]+".dfo") If (not(SeqEof)) Begin Read_Block sTemplate 4096 End Close_Input Set_Attribute DF_OPEN_PATH to sOpenPath // Move (saClassList[iData]) to sClass Move sClass to sObject If (Left(sObject, 1)="c") Move (Right(sObject, Length(sClass)-1)) to sObject Move ("o"+sObject) to sName Move ("Object"*sName*"is a"*sClass) to sObject If (sTemplate<>"") Begin Move (Trim(sTemplate)) to sTemplate If (Left(Uppercase(sTemplate), 6)="OBJECT") Begin Move (Right(sTemplate, Length(sTemplate)-6)) to sTemplate Move (sObject+sTemplate * "//"*sName) to sObject End End Else Move (sObject + Character(13)+Character(10)+"End_Object //"*sName) to sObject // Move ("Use" * saPackageList[iData]+ Character(13)+Character(10)+sObject+ Character(13)+Character(10)) to sObject Function_Return sObject End_Function Procedure OnClassSelect Integer iData // In case you need something on Button click // For example, show Class builder etc (if required) End_Procedure Procedure DoCreatePalette Integer iPage iBtn iPgNo String sLabel Integer iGroup iGroups Integer iClass iClasses iItem tDFClassGroup[] ltDFClassGroups String[] saClassList String[] saPackageList Handle hoClient // Send Delete_Data // String sOpenPath sVdfConfig Get psVdfRootDir of ghoWorkSpaceHandlerEx to sVdfConfig Move (sVdfConfig + "\Pkg\Config\;") to sVdfConfig Get_Attribute DF_OPEN_PATH to sOpenPath Set_Attribute DF_OPEN_PATH to (sVdfConfig+sOpenPath) // Get Client_Id to hoClient Send LoadClassList of hoClient (<DFClassGroups) // Move (SizeOfArray(ltDFClassGroups)) to iGroups For iGroup from 0 to (iGroups-1) Move (SizeOfArray(ltDFClassGroups[iGroup].ltDFClassList)) to iClasses If iClasses Begin Get Create_Palette_Page ltDFClassGroups[iGroup].sName to iPage For iClass from 0 to (iClasses-1) Move (SizeOfArray(saClassList)) to iItem Move ltDFClassGroups[iGroup].ltDFClassList[iClass].sClassName to saClassList[iItem] Move ltDFClassGroups[iGroup].ltDFClassList[iClass].sPackage to saPackageList[iItem] Get Create_Palette_Button Msg_OnClassSelect ; ltDFClassGroups[iGroup].ltDFClassList[iClass].sClassName ; ltDFClassGroups[iGroup].ltDFClassList[iClass].sImage ; iItem to iBtn Set Page_Button of iPage iClass to iBtn Loop End Loop // Set psClassList to saClassList Set psPackageList to saPackageList Set_Attribute DF_OPEN_PATH to sOpenPath Send UpdatePalette End_Procedure Procedure OnCreatePalette End_Procedure Procedure UpdatePalette Integer iPage Set Visible_State to False Get Current_Page to iPage Send Show_Page 0 Send Show_Page (Total_Pages(Self)) Send Show_Page iPage Set Visible_State to True End_Procedure // Adjust cToolsPalette on Resize actions... Procedure Set GUISize Integer iY Integer iX Forward Set GUISize to iY iX Send UpdatePalette End_Procedure End_Object // oPalette End_Object // // // Object oTP_Code is a TabPage // Set piImageIndex to 2 // Set Tab_ToolTip_Value to 'Code' // Set Label to "C" // Object oTablesTree is a TreeView // Set Size to 166 180 // Set Location to 11 0 // End_Object // oParserTree // End_Object // End_Object // oToolsDialog Procedure RebuildPanes Boolean bChecked Get Checked_State of (oSortBy(oTP_Database(oToolsDialog(Self)))) to bChecked Send LoadWorkspaceStructure to (oFilesTree(oTP_Workspace(oToolsDialog(Self)))) Send LoadTablesList to (oTablesTree(oTP_Database(oToolsDialog(Self)))) bChecked "" Send DoCreatePalette to (oPalette(oTP_Palette(oToolsDialog(Self)))) End_Procedure Procedure ColorsLikeEdit Handle hTarget // Workspace Explorer Move (oFilter(oTP_Workspace(oToolsDialog(Self)))) to hTarget Set TextColor of hTarget to gtColorer[EC_TEXT].iForeC Set Color of hTarget to gtColorer[EC_TEXT].iBackC Set TextColor of ghoWorkspaceFilesTree to gtColorer[EC_TEXT].iForeC Set Color of ghoWorkspaceFilesTree to gtColorer[EC_TEXT].iBackC Set piTextColor of ghoWorkspaceFilesTree to gtColorer[EC_TEXT].iForeC Set piBackColor of ghoWorkspaceFilesTree to gtColorer[EC_TEXT].iBackC Set piLineColor of ghoWorkspaceFilesTree to gtColorer[EC_TEXT].iForeC // Database Explorer Move (oFilter(oTP_Database(oToolsDialog(Self)))) to hTarget Set TextColor of hTarget to gtColorer[EC_TEXT].iForeC Set Color of hTarget to gtColorer[EC_TEXT].iBackC Move (oTablesTree(oTP_Database(oToolsDialog(Self)))) to hTarget Set TextColor of hTarget to gtColorer[EC_TEXT].iForeC Set Color of hTarget to gtColorer[EC_TEXT].iBackC Set piTextColor of hTarget to gtColorer[EC_TEXT].iForeC Set piBackColor of hTarget to gtColorer[EC_TEXT].iBackC Set piLineColor of hTarget to gtColorer[EC_TEXT].iForeC End_Procedure #IFDEF TH_TRANSLATION Procedure Translate Handle hWorkspace hDatabase hPalette // Workspace Page Move (oTP_Workspace(oToolsDialog(Self))) to hWorkspace Set Label of hWorkspace to gILanguage[431] Set Tab_ToolTip_Value of hWorkspace to gILanguage[432] // Toolbar Send Translate to (oWsToolBar(oWsCommandBar(hWorkspace))) // Add Folder Dialog #IF (!@ < 200) Set Dialog_Caption Of (oListFolders(hWorkspace)) To (ToAnsi(gILanguage[446])) #ELSE Set Dialog_Caption Of (oListFolders(hWorkspace)) To (gILanguage[446]) #ENDIF // Database page Move (oTP_Database(oToolsDialog(Self))) to hDatabase Set Label of hDatabase to gILanguage[449] Set Tab_ToolTip_Value of hDatabase to gILanguage[450] Set Label of (oSortBy(hDatabase)) to gILanguage[451] // Palette Page Move (oTP_Palette(oToolsDialog(Self))) to hPalette Set Label of hPalette to gILanguage[459] Set Tab_ToolTip_Value of hPalette to gILanguage[460] End_Procedure #ENDIF End_Object // oToolPane