//***************************************************************************************** // Copyright (c) 2000 Michael Kurz // All rights reserved. // If you want to use this source in your applications conatct: // // $FileName : cEditorEdit.Pkg // $ProjectName : CODEMAX EDITOR // $Author : Michael Kurz // $Created : 01-25-2001 @ 19:00 // // Contents: // Properties for Editor, stored in an INI file, based on cEditorProperties. // If you want to use a different config file then have your own version of this // file with a different filename. // $Rev History // //***************************************************************************************** Use cEditorProperties.pkg // The out of this class created object is stored in this global Var. #IFNDEF ghoEditorProperties Global_Variable Integer ghoEditorProperties #ENDIF Object oEditorProperties Is a cEditorProperties Move Self to ghoEditorProperties End_Object Send LoadIni To ghoEditorProperties // Loads the IniDate // Is a kind of WorkSpace Class which inserts things like, AppSrc directory etc. // into the open path. Use cWorkSpaceHandlerEx.Pkg Object oWorkSpaceHandlerEx is a cWorkSpaceHandlerEx Procedure StartWithLastWorkspace Boolean bHasDBDriver If (ghoWorkspaceHandlerEx=0) Begin Move Self to ghoWorkSpaceHandlerEx End Set psVDFVersion to (psVDFRegistryVersion(ghoEditorProperties)) If (piUseWorkSpace(ghoEditorProperties)) Begin Send InitWithCurrentWrkSpc Send LoadNonEmbeddedDriverAutoLoginPrompt End End_Procedure Send StartWithLastWorkspace End_Object // Delivers the CmdLine of the Compiler. // if WorkSpaces are enabled -> from the CurrentWorkSpace // if not th entered value. Function CompilerCmdLine For Desktop Returns String String sCmd String sVdfRootDir Move (psCompiler(ghoEditorProperties)) To sCmd Get psVdfRootDir Of ghoWorkSpaceHandlerEx To sVdfRootDir If sCmd Eq "" Begin Move (Trim(sVdfRootDir)) To sCmd // The rootdir always ends with a "\" //If (Right(sCmd,1)) Ne "\" Append sCmd "\" Append sCMD "Bin\DFComp.Exe" End Else Begin If (Pos("@VDFROOT@",sCmd)>0) Begin Move (Replace("@VDFROOT@\",sCmd,sVdfRootDir)) To sCmd // We don't mind one extra folderseperator Move (Replace("@VDFROOT@",sCmd,sVdfRootDir)) To sCmd End End Function_Return sCmd End_Function // Same for Debugger. Function DebuggerCmdLine For Desktop Returns String Boolean bExists String sCmd String sFileName String sPath Integer iVdfVersion Get fnCurrentVdfVersion Of ghoWorkspaceHandlerEx To iVdfVersion If (iVdfVersion<120) Begin Move (psDebugger(ghoEditorProperties)) To sCmd Get psVdfRootDir Of ghoWorkSpaceHandlerEx To sPath If sCmd Eq "" Begin Move (Trim(sPath)) To sCmd Append sCMD "Bin\" If (psVDFRegistryVersion(ghoEditorProperties)) Eq "5" Append sCmd "DFSpy.Exe" Else Append sCmd "VDFBug.Exe" End Else Begin If (Pos("@VDFROOT@",sCmd)>0) Begin Move (Replace("@VDFROOT@\",sCmd,sPath)) To sCmd // We don't mind one extra folderseperator Move (Replace("@VDFROOT@",sCmd,sPath)) To sCmd End End End Else Begin Get ModuleExecuteable to sFileName // returns path+filename to the hammer binary Get ParseFolderName sFileName to sPath Get vFolderFormat sPath To sPath Move (sPath+"dfSplat.exe") To sCmd Get vFilePathExists sCmd to bExists If (bExists=False) Begin Move "" To sCmd // if dfSplat is not available then don't try to use it as it will crash the hammer End End Function_Return sCmd End_Function // CmdLine for the DfRun. Function DFrunCmdLine For Desktop Returns String String sCmd String sVdfRootDir Move (psDfrun(ghoEditorProperties)) To sCmd Get psVdfRootDir Of ghoWorkSpaceHandlerEx To sVdfRootDir If sCmd Eq "" Begin Move (Trim(sVdfRootDir)) To sCmd Append sCMD "Bin\DFRun.Exe" End Else Begin If (Pos("@VDFROOT@",sCmd)>0) Begin Move (Replace("@VDFROOT@\",sCmd,sVdfRootDir)) To sCmd // We don't mind one extra folderseperator Move (Replace("@VDFROOT@",sCmd,sVdfRootDir)) To sCmd End End Function_Return sCmd End_Function Function ConvertPRGFile For Desktop String sFile Returns String String sCmd If (piUseWorkSpace(ghoEditorProperties)) Begin Get FileFromPath sFile To sFile Get CurrentProgramPath Of ghoWorkSpaceHandlerEx To sCmd Append sCmd "\" sFile Function_Return sCmd End Else Function_Return sFile End_Function // Sets the VDF Version. Procedure Set VDFVersion For Desktop String sVer Set psVDFVersion Of ghoWorkSpaceHandlerEx To sVer Set psVDFRegistryVersion Of ghoEditorProperties To sVer Send InitWithCurrentWrkSpc To ghoWorkSpaceHandlerEx End_Procedure // Selects the Working directory. Procedure SelectWorkingDirectory For Desktop String sDirE String sDir If NUM_Arguments Gt 0 Move sDirE To sDir Else Begin // Changed this call to preselect the current working directory // in the BrowseForFolder Window // 28.02.2003 BP Get_Directory sDir Get SelectFolderWithInit (_T("Select Working Directory", 769)) sDir to sDir End If sDir Ne "" Begin If (Pos(";",sDir)) Ne 0 Move (Left(sDir,((Pos(";",sDir))-1) )) To sDir // Changed to support multi-directory. 15.5.01 BP Set psStartUpPath Of ghoEditorProperties To sDir Send DoChangeCurrentFolder sDir End End_Procedure // Tries to init the WorkingDirectory to the AppSrc directory of the current WorkSpace in the Selected VDF version. Send SelectWorkingDirectory To Desktop (CurrentAppSrcPath(ghoWorkSpaceHandlerEx))