//TH-Header //***************************************************************************************** // Copyright (c) 2014 KURANT Project // All rights reserved. // // $FileName : CustMenu.dg // $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: Maintain User Menu // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd // Project Object Structure // oCustMenuView is a dbModalPanel // Custmenu_DD is a DataDictionary // Custmenu_Description is a dbForm // Custmenu_Instruction is a dbForm // oMenuList is a dbList // oBottomLine is a LineControl // oSave_bn is a Button // oCancel_bn is a Button // oAdd_bn is a Button // oRemove_bn is a Button // oUp_bn is a ctButton // oDown_bn is a ctButton // oInfoTip is a Container3d // oInfoTextVDFRUN is a Textbox // oInfoTextVDFROOT is a Textbox // oInfoTextCURDIR is a Textbox // oInfoTextOnDfRun is a Textbox // oInfoTextOnVdfRoot is a Textbox // oInfoTextOnCurDir is a Textbox // oInfoTextCURDIR is a Textbox // oInfoTextOnCurDir is a Textbox // Register all objects Register_Object Custmenu_DD Register_Object Custmenu_Description Register_Object Custmenu_Instruction Register_Object oAdd_bn Register_Object oBottomLine Register_Object oCancel_bn Register_Object oCustMenuView Register_Object oDown_bn Register_Object oInfoTextCURDIR Register_Object oInfoTextOnCurDir Register_Object oInfoTextOnDfRun Register_Object oInfoTextOnVdfRoot Register_Object oInfoTextVDFROOT Register_Object oInfoTextVDFRUN Register_Object oInfoTip Register_Object oMenuList Register_Object oRemove_bn Register_Object oSave_bn Register_Object oUp_bn Procedure Activate_oCustmenuView Send Popup To oCustmenuView "Tools" End_Procedure // Activate_oCustmenuView Procedure Activate_oSourceMenuView Send Popup To oCustmenuView "Source" End_Procedure // Activate_oCustmenuView Procedure Activate_oDatabaseMenuView Send Popup To oCustmenuView "Database" End_Procedure // Activate_oCustmenuView Use ctButton.Pkg Use CUSTMENU.DD Object oCustMenuView Is a dbModalPanel #IF (!@ >= 140) Set pbSizeToClientArea to False #ENDIF Set Popup_State To True Set Locate_Mode To CENTER_ON_SCREEN Set Border_Style To Border_Dialog Set Label To "Custom Menu" Set Size To 198 395 Set Location To 3 3 Object Custmenu_DD Is a Custmenu_DataDictionary End_Object // Custmenu_DD Set Main_DD To (Custmenu_DD(Self)) Set Server To (Custmenu_DD(Self)) Object Custmenu_Description Is a dbForm Entry_Item Custmenu.Description Set Label To "Menu Label:" Set Size To 13 126 Set Location To 22 165 Set Label_Col_Offset To 0 Set Label_Justification_Mode To jMode_Top Procedure DoSetEnabledState Integer bEnabled Set Enabled_State To bEnabled End_Procedure // DoSetEnabledState End_Object // Custmenu_Description Object Custmenu_Instruction Is a dbForm Entry_Item Custmenu.Instruction Set Label To "Command line instruction:" Set Size To 13 215 Set Location To 52 165 Set Label_Col_Offset To 0 Set Label_Justification_Mode To jMode_Top Procedure DoSetEnabledState Integer bEnabled Set Enabled_State To bEnabled End_Procedure // DoSetEnabledState End_Object // Custmenu_Instruction Object oMenuList Is a dbList Set Move_Value_Out_State To False // Use as a Display_List Set Auto_Shadow_State To False Set Popup_Search_State To False Set Seed_List_State To False Set Highlight_row_state To True Set CurrentCellColor To (rgb(230,230,255)) Set CurrentRowColor To (rgb(230,230,255)) Set Main_File To Custmenu.File_Number Set Ordering To 1 Set Size To 122 117 Set Location To 10 10 Set Resize_Column_state To FALSE Set Auto_Column_State To FALSE Set Move_Value_Out_State To FALSE Begin_Row Entry_Item Custmenu.Description End_Row Set Form_Width Item 0 To 109 Set Header_Label Item 0 To "Menu" End_Object // oMenuList Object oBottomLine Is a LineControl Set Size To 2 371 Set Location To 156 8 #IF FMAC_VERSION Le 7 // **WvA: 01-24-2000 // There is a bug in the transparency logic that only reveals itself in topmost // containers (Panel, ModalPanel etc). // The text/colour from the windows desktop can be seen if we do not use this workaround. // **SVN: 01-23-2003 // BUG fixed -- did not work under VDF7 Procedure Page Integer bState Integer iGUISize bHorizontal_State Get Horizontal_State To bHorizontal_State Get Guisize To iGuiSize If bHorizontal_State ; Set Guisize To 2 (Low(iGuiSize)) Else ; Set GuiSize To (Hi(iGuiSize)) 2 Forward Send Page bState End_Procedure // Page #ENDIF End_Object // oBottomLine Object oSave_bn Is a Button Set Label To "&Save" Set Location To 162 271 Procedure OnClick Send doSaveMenuItem End_Procedure // OnClick Procedure DoSetEnabledState Integer bEnabled Set Enabled_State To bEnabled End_Procedure // DoSetEnabledState End_Object // oSave_bn Object oCancel_bn Is a Button Set Label To "&Close" Set Location To 162 329 Procedure OnClick Delegate Send Request_Cancel End_Procedure // OnClick End_Object // oCancel_bn Object oAdd_bn Is a Button Set Label To "&New" Set Location To 137 15 Procedure OnClick Delegate Send Request_Clear End_Procedure // OnClick End_Object // oAdd_bn Object oRemove_bn Is a Button Set Label To "&Delete" Set Location To 137 70 Procedure OnClick Delegate Send Request_Delete Send Beginning_Of_Data To oMenuList End_Procedure // OnClick End_Object // oRemove_bn Object oUp_bn Is a ctButton Set Bitmap To "Abup.bmp" Set Size To 20 20 Set Location To 51 132 Procedure OnClick Send MoveUp To CustMenu_DD End_Procedure // OnClick End_Object // oUp_bn Object oDown_bn Is a ctButton Set Bitmap To "Abdown.bmp" Set Size To 20 20 Set Location To 80 132 Procedure OnClick Send MoveDown To CustMenu_DD End_Procedure // OnClick End_Object // oDown_bn Object oInfoTip Is a Container3d Set Size To 51 215 Set Location To 69 165 Set Color To clInfoBk Set Border_Style To Border_Normal Object oInfoTextVDFRUN Is a Textbox Set Label To "@DFRUN@" Set Color To clInfoBk Set TextColor To clInfoText Set Location To 4 4 Set Size To 10 40 Set FontWeight To 800 Set TypeFace To "MS Sans Serif" End_Object // oInfoTextVDFRUN Object oInfoTextVDFROOT Is a Textbox Set Label To "@VDFROOT@" Set Color To clInfoBk Set TextColor To clInfoText Set Location To 15 4 Set Size To 10 49 Set FontWeight To 800 Set TypeFace To "MS Sans Serif" End_Object // oInfoTextVDFROOT Object oInfoTextCURDIR Is a Textbox Set Label To "@CURDIR@" Set Color To clInfoBk Set TextColor To clInfoText Set Location To 26 4 Set Size To 10 43 Set FontWeight To 800 Set TypeFace To "MS Sans Serif" End_Object // oInfoTextCURDIR Object oInfoTextOnDfRun Is a Textbox Set Label To "Expanded into the dfrun.exe full qualified path" Set Color To clInfoBk Set TextColor To clMenuText Set Location To 4 63 Set Size To 10 145 Set TypeFace To "MS Sans Serif" End_Object // oInfoTextOnDfRun Object oInfoTextOnVdfRoot Is a Textbox Set Label To "Expanded into the VDF root directory (C:\VDF)" Set Color To clInfoBk Set TextColor To clInfoText Set Location To 15 63 Set Size To 10 147 Set TypeFace To "MS Sans Serif" End_Object // oInfoTextOnVdfRoot Object oInfoTextOnCurDir Is a Textbox Set Label To "Expanded into the start up directory" Set Color To clInfoBk Set TextColor To clInfoText Set Location To 26 63 Set Size To 10 113 Set TypeFace To "MS Sans Serif" End_Object // oInfoTextOnCurDir Object oInfoTextCURDIR Is a Textbox Set Label To "%1" Set Color To clInfoBk Set TextColor To clInfoText Set Location To 37 4 Set Size To 10 11 Set FontWeight To 800 Set TypeFace To "MS Sans Serif" End_Object // oInfoTextCURDIR Object oInfoTextOnCurDir Is a Textbox Set Label To "Current opened file in editor (Path included)" Set Color To clInfoBk Set TextColor To clInfoText Set Location To 37 63 Set Size To 10 137 Set TypeFace To "MS Sans Serif" End_Object // oInfoTextOnCurDir End_Object // oInfoTip // windows new key On_Key Key_Ctrl+Key_N Send OnClick To (oAdd_bn(Current_Object)) // windows save key On_Key Key_Ctrl+Key_S Send OnClick To (oSave_bn(Current_Object)) // Normal windows behaviour for an underscored character On_Key Key_Alt+Key_N Send OnClick To (oAdd_bn(Current_Object)) On_Key Key_Alt+Key_D Send OnClick To (oRemove_bn(Current_Object)) On_Key Key_Alt+Key_S Send OnClick To (oSave_bn(Current_Object)) Procedure DoSetAllEnabledState Integer bEnabled Broadcast Recursive Send DoSetEnabledState bEnabled End_Procedure // DoSetAllEnabledState Procedure doSaveMenuItem Set Verify_save_Msg To None Send Request_Save_No_Clear Set Verify_save_Msg To get_save_Confirmation Send Beginning_Of_Data To (oMenuList(Self)) End_Procedure // doSaveMenuItem Procedure Activating Returns Integer Integer iRetVal Forward Get msg_activating To iRetVal Send Beginning_Of_Data To (oMenuList(Self)) Procedure_Return iRetVal End_Procedure // Activating Procedure Popup String sMenu If (sMenu="") Procedure_Return Set psMenu Of CustMenu_DD To (Uppercase(sMenu)) Set Label To (sMenu+" Custom Menu") Forward Send Popup End_Procedure End_Object // oCustMenuView