//TH-Header //***************************************************************************************** // Copyright (c) 2014 KURANT Project // All rights reserved. // // $FileName : Source.Inc // $ProjectName : The Hammer 2.0 // $Authors : Wil van Antwerpen, Michael Kurz, Sergey V. Natarov, Bernhard Ponemayr // $Created : 01.25.2014 01:08 // $Type : LGPL // // Contents: Source menu // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd // WIP... // 1) Macros to be in global function // 2) Custom Source Menu support for custome Items... DFCreate_Menu "&Source" SourcePopupMenu Is A PopupMenu On_Item " Integrated Development Environment..." Send LaunchIDEUtility Set Status_Help To "Run IDE specified in the system options" On_Item " Code Merge Utility..." Send LaunchMergeUtility Set Status_Help To "Run Code Merge Utility specified in the system options" On_Item " Version Control System..." Send LaunchVCSUtility Set Status_Help To "Run VCS/CVS system specified in the system options" On_Item " Menu Editor Utility..." Send LaunchMenuUtility Set Status_Help To "Run Menu Editor Utility specified in the system options" On_Item " Code Art Utility..." Send LaunchCodeArt If (psCodeArtPath(ghoEditorProperties)<>"") Set Status_Help To "Run Code Art Utility specified in the system options" Else Send None // Set Status_Help To "Run Built-In Code Art tool on current file" On_Item " Code Spy Utility..." Send LaunchCodeSpy // Set Shadow_State Item 5 To True If (psCodeSpyPath(ghoEditorProperties)<>"") Set Status_Help To "Run Code Spy Utility specified in the system options" Else Send None // Set Status_Help To "Run Built-In Code Spy tool on current file" On_Item " Code Publishing Utility..." Send LaunchCodePub If (psCodePubPath(ghoEditorProperties)<>"") Set Status_Help To "Run Code Publishing Utility specified in the system options" Else Set Status_Help To "Run Built-In Code Publishing tool on current file" DFCreate_Menu " Dependency Scanner" DependPopupMenu Is a cBitmapPopupMenu On_Item "Start scan..." Send PADependencyScan On_Item "Configure" Send PADependencyConfig End_Menu Set Status_Help To "Run and configure dependency scanner" On_Item "" Send none // On_Item " Pre-Compile Windows.pkg..." Send PreCompileWindows Set Status_Help To "Pre-compile standard VDF Windows.pkg package" On_Item " Pre-Compile DFAllEnt.pkg..." Send PreCompileDFAllEnt Set Status_Help To "Pre-compile standard VDF DfAllEnt.pkg package" On_Item "" Send none // Property Integer piSelectedCustMenuItem Public -1 Property Integer piStartDynamicItems Public (Item_Count(Self)) Procedure DoCustmenuExecute Integer lici liint String sString Get piSelectedCustMenuItem To lici Open CustMenu Clear CustMenu Move "SOURCE" To Custmenu.Menu For liint From 0 To (lici-piStartDynamicItems(Self)) Find Gt Custmenu by Index.1 End Move (RTrim(custmenu.instruction)) To sString Send LaunchUtility To (Focus(Self)) sString "" End_Procedure Procedure onInitMenu Integer iC hoID iFlag Integer hoCA // oClientArea Integer nVdfVersion Integer iCount // **WvA 02-12-2004 Added version specific name changing of the // IDE/Studio component from DAW/DAC Get fnCurrentVdfVersion Of ghoWorkSpaceHandlerEx To nVdfVersion // 70=VDF7, 82=VDF8.2 If (nVdfVersion <91) Begin Set Value Item 0 To " Integrated Development Environment..." End Else Begin Set Value Item 0 To " Visual DataFlex Studio" End Set Shadow_State Item 0 To (psIdePath(ghoEditorProperties)="") // IDE Set Shadow_State Item 1 To (psMergePath(ghoEditorProperties)="") // Merge Set Shadow_State Item 2 To (psVcsPath(ghoEditorProperties)="") // VCS Set Shadow_State Item 3 To (psMenuPath(ghoEditorProperties)="") // Menu Set Shadow_State Item 4 To (psCodeArtPath(ghoEditorProperties)="") // Art Set Shadow_State Item 5 To (psCodeSpyPath(ghoEditorProperties)="") // Spy // Move (oClientArea(Self)) To hoCA Move (Focus(Desktop)) To hoID If hoID Move (isFileWindow(hoCA,hoID)) To iFlag Else Move 0 To iFlag Move 0 To iCount While (Item_Count(Self)) Gt (piStartDynamicItems(Self)) Send Delete_Item (piStartDynamicItems(Self)) End Open CustMenu Clear CustMenu Move "SOURCE" To Custmenu.Menu Repeat Find Gt Custmenu by Index.1 [found] Indicate found as Custmenu.Menu Eq "SOURCE" If (found) Begin If (Trim(custmenu.description) <> "") Begin Send Add_Item msg_DoCustMenuExecute (" "+RTrim(custmenu.description)) Set Aux_Value Item (Item_Count(Self)-1) To Self Increment iCount End Else On_Item "" Send msg_None // A separator End // found Until [Finderr] If (iCount>0) Send Add_Item msg_none "" Send Add_Item msg_Activate_oSourceMenuView " &Customize Items..." Clear CustMenu End_Procedure Procedure change_menu Integer Item# Integer obj Integer iFlags Delegate Send change_menu Item# obj iFlags Send OnChange Set piSelectedCustMenuItem To Item# End_Procedure End_Pull_down