// The code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // This is free software; you can redistribute it and/or modify it under the terms of the // GNU Lesser General Public License. // License: LGPLv3 - GNU LESSER GENERAL PUBLIC LICENSE Version 3 - http://www.gnu.org/licenses/lgpl.txt // Use Windows.pkg Use DFClient.pkg Use cSplitterContainer.pkg Use dfLine.pkg Use Dfspnfrm.pkg Use cScrollingContainer.pkg Use cDbModalPanel.pkg Use cIniFileForm.pkg Use cComboForm.pkg Use cIniFileCheckbox.pkg Use Symdef.pkg // NOTE: The cryptographer package was borrowed from VDF 17.1! Use cCryptographer.pkg Register_Object oDbMerger_vw Object oSetup_dg is a cDbModalPanel Set Location to 1 0 Set Label to "Configure the Program" Set Size to 154 395 Set Icon to "Configure032N32.ico" Set piMaxSize to (Hi(Size(Self))) (Low(Size(Self) + 300)) Property Boolean pbRestart False Object oSplitterContainer is a cSplitterContainer Set pbSplitVertical to False Set piSplitterLocation to 128 Set peFixedPanel to fpFixLastPanel Set piSplitterColor to clWhite Object oSplitterContainerChild1 is a cSplitterContainerChild Set Border_Style to Border_None Object oScrollingContainer is a cScrollingContainer Object oScrollingClientArea is a cScrollingClientArea Object oEditor_tb is a TextBox Set Size to 10 49 Set Location to 8 11 Set Label to "Editor Settings" End_Object Object oEditor_lc is a LineControl Set Size to 2 301 Set Location to 13 62 Set peAnchors to anLeftRight End_Object Object oEditor_fm is a cIniFileForm Set Size to 14 193 Set Location to 21 109 Set Label_Col_Offset to 2 Set Label_Justification_Mode to JMode_Right Set Label to "Editor" Set psToolTip to "Select the editor program to use when viewing Manifest Fragment Files. Click the 'Browse' button or press (F4)." Set peAnchors to anTopLeftRight Set psKey to CS_Editor Set psDefault to CS_Notepad Set pbFileValue to True Set psPromptFileHeaderText to "Select An Editor Program" Set psFileMask to "Select Editor Program (*.exe)|*.exe" End_Object Object oSelect_Btn is a Button Set Location to 21 310 Set Label to "Browse..." Set psToolTip to "Select the editor program to be used to edit and viewing Manifest Fragment Files" Set peAnchors to anTopRight Procedure OnClick Send Prompt of oEditor_fm End_Procedure End_Object Object oEditorParam_fm is a cIniFileForm Set Size to 14 193 Set Location to 37 109 Set Label_Col_Offset to 2 Set Label_Justification_Mode to JMode_Right Set Label to "Parameters" Set psToolTip to "Enter any editor parameters that needs to be passed on the command line to the editor." Set psKey to CS_EditorParams Set peAnchors to anTopLeftRight End_Object Object oStudioIntegration_tb is a TextBox Set Size to 10 50 Set Location to 61 11 Set Label to "Studio Integration" End_Object Object oStudioIntegration_lc is a LineControl Set Size to 2 290 Set Location to 66 78 Set peAnchors to anLeftRight End_Object Object oStudioMajorVersion_sf is a SpinForm Set Size to 14 27 Set Location to 74 189 Set Maximum_Position to 30 Set Minimum_Position to 14 Set Label_Col_Offset to 2 Set Label_Justification_Mode to JMode_Right Set Label to "Add to Studio's Tools Menu Major Version" Set psToolTip to "Visual DataFlex main version - e.g. '17'" Set Value to FMAC_VERSION Set peAnchors to anNone End_Object Object oStudioMinorVersion_sf is a SpinForm Set Size to 14 27 Set Location to 74 275 Set Label_Col_Offset to 2 Set Label to "Minor Version" Set psToolTip to "Visual DataFlex minor version - e.g. '0'" Set Maximum_Position to 9 Set Minimum_Position to 0 Set Value to FMAC_REVISION Set Label_Justification_Mode to JMode_Right Set peAnchors to anNone End_Object Object oInstallInStudio_btn is a Button Set Location to 74 310 Set Label to "Add Now" Set psToolTip to "Add to Visual DataFlex Studios 'Tools' menu. The Studio version can be selected with the two spinforms. The COMManifestBuilder program gets added to the Studios Tools menu. When selected from the Studio it will pass the current project name on the command line so that the current program's manifest file is automatically loaded by the COMManifestBuilder program." Set peAnchors to anTopRight Procedure OnClick Integer iRetval iMajorVersion iMinorVersion String sText sStudioVersion Get Value of oStudioMajorVersion_sf to iMajorVersion Get Value of oStudioMinorVersion_sf to iMinorVersion Move (String(iMajorVersion) + "." + String(iMinorVersion)) to sStudioVersion Get AddProgramToStudioToolsMenu sStudioVersion to iRetval Case Begin Case (iRetval = cx_RegKeyAlreadyExist) Move ("The program already exists in the" * sStudioVersion * "Visual DataFlex Studios Tools menu.") to sText Break Case (iRetval = cx_RegKeyCreated) Move ("Success. The tool was added to the" * sStudioVersion * "Visual DataFlex Studios Tools menu.") to sText Break Case (iRetval = cx_RegkeyFailed) Move "Failed. Could not create the registry key for adding the program to the Visual DataFlex Studios Tools menu." to sText Break Case (iRetval = cx_RegKeyVDFKeyDoesNotExist) Move ("Could not find the Studio registry key. Is Visual DataFlex Studio version" * sStudioVersion * "really installed on this machine?") to sText Break Case (iRetval = CX_InstalledOkVdfUnder16) Move ("The program was added to the" * sStudioVersion * "Studios Tools menu successfully, but because you installed for an earlier version of the Studio than 16.0 you need to compile this program under that same VDF version, else the Studio can't start the program properly. (Sorry, just a 'feature' of earlier versions of the Studio)") to sText Break Case End Send Info_Box sText End_Procedure // Adds the ManifestSideBySide program to the VDF Studio's Tools menu. // Pass the Studio version as a dot separated string. E.g. "17.0" // The Studio uses a registry string for the purpose. // Checks are made so that if the program already exists in the Studio's // tools menu - nothing will be changed. A check is also performed that // the Studio for the passed version actually is installed on the machine. // Returns: // cx_RegKeyAlreadyExist, cx_RegKeyCreated, cx_RegkeyFailed, cx_RegKeyVDFKeyDoesNotExist or CX_InstalledOkVdfUnder16 Function AddProgramToStudioToolsMenu String sStudioVersion Returns Integer Boolean bOk bExists bOpen String sKey sValue sProgramPath sProgram sProduct sStudioPath Handle hoReg hoArray Integer i iItems iCreated iRetval Move False to bOk Move (CS_StudioPath + (Trim(sStudioVersion))) to sStudioPath If (sStudioVersion > "17.1") Begin Move (Replace("Visual ", sStudioPath, "")) to sStudioPath End Get psProgramPath of (phoWorkspace(ghoApplication)) to sProgramPath Get PathAtIndex of (phoWorkspace(ghoApplication)) sProgramPath 1 to sProgramPath Get vFolderFormat sProgramPath to sProgramPath Get psProduct of (phoWorkspace(ghoApplication)) to sProduct Get Module_Name to sProgram Get Create U_cRegistry to hoReg Set phRootKey of hoReg to HKEY_CURRENT_USER // First check if the VDF version is installed Get KeyExists of hoReg sStudioPath to bExists If (bExists = False) Begin Send Destroy of hoReg Function_Return cx_RegKeyVDFKeyDoesNotExist End // Then check if any tools have been installed in the Tools Menu. // If no tools created yet, create the Tools registry key. Move (sStudioPath + CS_StudioTools) to sStudioPath Get KeyExists of hoReg sStudioPath to bExists If (bExists = False) Begin Set pfAccessRights of hoReg to KEY_ALL_ACCESS Get CreateKey of hoReg sStudioPath to iCreated If (iCreated <> 0) Begin Move cx_RegkeyFailed to iRetval End Else Begin Move True to bExists End End If (bExists = True) Begin Get OpenKey of hoReg sStudioPath to bOk If (bOk = True) Begin Get Create U_Array to hoArray Get GetSubkeys of hoReg hoArray to iItems Decrement iItems Move False to bExists Set pfAccessRights of hoReg to KEY_READ // Check if the key already exists: For i from 0 to iItems Get Value of hoArray i to sKey Move (sStudioPath + "\" + sKey) to sKey Get OpenKey of hoReg sKey to bOpen If (bOpen = True) Begin Get ReadString of hoReg CS_Name to sValue If (sValue = sProduct) ; Move True to bExists End Loop Send Destroy of hoArray If (bExists = False) Begin Set pfAccessRights of hoReg to KEY_ALL_ACCESS // We need to create the next key number: // The studio expect tools menu items to be numbered 1,2,3...n Increment iItems Increment iItems Get CreateKey of hoReg (sStudioPath + "\" + String(iItems)) to iCreated If (iCreated = 0) Begin Send WriteString of hoReg CS_Name sProduct // From VDF 16 and up the params for the Studio's Tools menu changed slightly: If (sStudioVersion >= "16.0") Begin Send WriteString of hoReg CS_Command (sProgramPath + sProgram) Send WriteString of hoReg CS_CommandLine CS_RegApplication End Else Begin Send WriteString of hoReg CS_CommandLine ('"' + sProgramPath + sProgram + ".exe" + '"' * CS_RegApplication) Move CX_InstalledOkVdfUnder16 to iRetval End Send WriteDword of hoReg CS_Separator 1 Move cx_RegKeyCreated to iRetval End Else Begin Move cx_RegkeyFailed to iRetval End End Else Begin Move cx_RegKeyAlreadyExist to iRetval End Send CloseKey of hoReg End End Send Destroy of hoReg Function_Return iRetval End_Function End_Object Object oGridSettings_tb is a TextBox Set Size to 10 51 Set Location to 96 11 Set Label to "Grid Settings" End_Object Object oGridSettings_lc is a LineControl Set Size to 2 305 Set Location to 101 59 Set peAnchors to anTopLeftRight End_Object // Object oUseHightligthRowState_cb is a cIniFileCheckbox // Set Size to 10 50 // Set Location to 108 109 // Set Label to "Highlight current grid row" // Set peAnchors to anNone // Set psKey to CS_UseHighlightstateText // End_Object Object oUseAlternateRowBackgroundColor_cb is a cIniFileCheckbox Set Size to 10 50 Set Location to 110 109 Set Label to "Use Alternate Grid Row Background Color" Set peAnchors to anNone Set psKey to CS_pbAlternateRowColor End_Object End_Object End_Object End_Object Object oSplitterContainerChild2 is a cSplitterContainerChild Set Border_Style to Border_Dialog Object oOK_Btn is a Button Set Size to 14 50 Set Label to "&OK" Set Location to 7 262 Set peAnchors to anBottomRight Set Default_State to True Procedure OnClick String sPath sProgram Boolean bState bCurrent_State bRestart Integer iRetval // This will make all values to be written to the ini-file: Broadcast Recursive Send WriteIniValue of (phoModalPanelHandle(Self)) Send Close_Panel End_Procedure End_Object Object oCancel_Btn is a Button Set Size to 14 50 Set Label to "&Cancel" Set Location to 7 318 Set peAnchors to anBottomRight Procedure OnClick Send Close_Panel End_Procedure End_Object End_Object Procedure Activating Forward Send Activating Set pbRestart to False End_Procedure Procedure Deactivating Forward Send Deactivating Set pbRestart to False End_Procedure End_Object On_Key Key_Alt+Key_O Send KeyAction of oOK_Btn On_Key Key_Ctrl+Key_O Send KeyAction of oOK_Btn On_Key Key_Alt+Key_C Send KeyAction of oCancel_Btn On_Key kCancel Send KeyAction of oCancel_Btn End_Object