//***************************************************************************************** // Copyright (c) 2001 Michael Kurz // All rights reserved. // If you want to use this source in your applications conatct: // // $FileName : D:\Entwicklung\SharedMethods\mVDFTools.pkg // $ProjectName : // $Author : Mk on SERVER // $Created : 28.04.2001 18:50 // // Contents: // Procedures and functions to add classes to the VDF6, VDF7 ClassList: // // -IDEGlobalPath // -IDEFilePathEXT // -IDEDoesClassExist // -IDERegisterClass // // $Rev History // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd // Calls to the Class List whether VDF6 of VDF7, VDF5 doesnt support it. External_Function AddClassInList6 "AddClassInList" VdfTools.dll String sWorkspace String sClass String sImage String sPage String sFile Returns Integer External_Function AddClassInList7 "AddClassInList" VdfTools7.dll String sWorkspace String sClass String sImage String sPage String sFile Returns Integer Function AddClassInList Global String sVersion String sWorkspace String sClass String sImage String sPage String sFile Returns Integer If (sVersion='6') Function_Return (AddClassInList6(sWorkspace,sClass,sImage,sPage,sFile)) If (sVersion='7') Function_Return (AddClassInList7(sWorkspace,sClass,sImage,sPage,sFile)) End_Function External_Function ClassExistsInList6 "ClassExistsInList" VdfTools.dll String sWorkspace String sClass Returns Integer External_Function ClassExistsInList7 "ClassExistsInList" VdfTools7.dll String sWorkspace String sClass Returns Integer Function ClassExistsInList Global String sVersion String sWorkspace String sClass Returns Integer If (sVersion='6') Function_Return (ClassExistsInList6(sWorkspace,sClass)) If (sVersion='7') Function_Return (ClassExistsInList7(sWorkspace,sClass)) End_Function External_Function ClassListExists6 "ClassListExists" VdfTools.dll String sWorkspace Returns Integer External_Function ClassListExists7 "ClassListExists" VdfTools7.dll String sWorkspace Returns Integer Function ClassListExists GLOBAL String sVersion String sWorkspace Returns Integer If (sVersion='6') Function_Return (ClassListExists6(sWorkspace)) If (sVersion='7') Function_Return (ClassListExists7(sWorkspace)) End_Function External_Function CreateClassList6 "CreateClassList" VdfTools.dll String sWorkspace Returns Integer External_Function CreateClassList7 "CreateClassList" VdfTools7.dll String sWorkspace Returns Integer Function CreateClassList GLOBAL String sVersion String sWorkspace Returns Integer If (sVersion='6') Function_Return (CreateClassList6(sWorkspace)) If (sVersion='7') Function_Return (CreateClassList7(sWorkspace)) End_Function External_Function DeleteClassInList6 "DeleteClassInList" VdfTools.dll String sWorkspace Integer iIndex Returns Integer External_Function DeleteClassInList7 "DeleteClassInList" VdfTools7.dll String sWorkspace Integer iIndex Returns Integer Function DeleteClassInList GLOBAL String sVersion String sWorkspace Integer iIndex Returns Integer If (sVersion='6') Function_Return (DeleteClassInList6(sWorkspace,iIndex)) If (sVersion='7') Function_Return (DeleteClassInList7(sWorkspace,iIndex)) Function_Return End_Function External_Function DeleteClassList6 "DeleteClassList" VdfTools.dll String sWorkspace Returns Integer External_Function DeleteClassList7 "DeleteClassList" VdfTools7.dll String sWorkspace Returns Integer Function DeleteClassList GLOBAL String sVersion String sWorkspace Returns Integer If (sVersion='6') Function_Return (DeleteClassList6(sWorkspace)) If (sVersion='7') Function_Return (DeleteClassList7(sWorkspace)) End_Function External_Function GetClassInList6 "GetClassInList" VdfTools.dll String sWorkspace Pointer lpsName Pointer lpsImage Pointer lpsPage Pointer lpsFile Integer iIndex Returns Integer External_Function GetClassInList7 "GetClassInList" VdfTools7.dll String sWorkspace Pointer lpsName Pointer lpsImage Pointer lpsPage Pointer lpsFile Integer iIndex Returns Integer Function GetClassInList Global String sVersion String sWorkspace Pointer lpsName Pointer lpsImage Pointer lpsPage Pointer lpsFile Integer iIndex Returns Integer If (sVersion='6') Function_Return (GetClassInList6(sWorkspace,lpsName,lpsImage,lpsPage,lpsFile,iIndex)) If (sVersion='7') Function_Return (GetClassInList7(sWorkspace,lpsName,lpsImage,lpsPage,lpsFile,iIndex)) End_Function External_Function GetClassCountInList6 "GetClassCountInList" VdfTools.dll String sWorkspace Returns Integer External_Function GetClassCountInList7 "GetClassCountInList" VdfTools7.dll String sWorkspace Returns Integer Function GetClassCountInList global String sVersion String sWorkspace Returns Integer If (sVersion='6') Function_Return (GetClassCountInList6(sWorkspace)) If (sVersion='7') Function_Return (GetClassCountInList7(sWorkspace)) End_Function External_Function InsertClassInList6 "InsertClassInList" VdfTools.dll String sWorkspace String sClass String sImage String sPage String sFile Integer iIndex Returns Integer External_Function InsertClassInList7 "InsertClassInList" VdfTools7.dll String sWorkspace String sClass String sImage String sPage String sFile Integer iIndex Returns Integer Function InsertClassInList GLOBAL String sVersion String sWorkspace String sClass String sImage String sPage String sFile Integer iIndex Returns Integer If (sVersion='6') Function_Return (InsertClassInList6(sWorkspace,sClass,sImage,sPage,sFile,iIndex)) If (sVersion='7') Function_Return (InsertClassInList7(sWorkspace,sClass,sImage,sPage,sFile,iIndex)) End_Function External_Function SetClassInList6 "SetClassInList" VdfTools.dll String sWorkspace String sClass String sImage String sPage String sFile Integer iIndex Returns Integer External_Function SetClassInList7 "SetClassInList" VdfTools7.dll String sWorkspace String sClass String sImage String sPage String sFile Integer iIndex Returns Integer Function SetClassInList GLOBAL String sVersion String sWorkspace String sClass String sImage String sPage String sFile Integer iIndex Returns Integer If (sVersion='6') Function_Return (SetClassInList6(sWorkspace,sClass,sImage,sPage,sFile,iIndex)) If (sVersion='7') Function_Return (SetClassInList7(sWorkspace,sClass,sImage,sPage,sFile,iIndex)) End_Function // Delivers the Path where the //Function IDEGlobalPath Global String sVersion Returns String // Local String sRoot // Move (Profile_StringVersion(sVersion,"Defaults","VDFRootDir")) To sRoot // If (Right(sRoot,1)) Ne "\" Append sRoot "\" // Append sRoot "Usr\Global\IdeSrc" // Function_Return sRoot //End_Function // *MB* // Return IdeSrcPath for selected version and workspace. If sWorkspc is empty use global path Function IDESrcPath Global String sVersion String sWorkspc Returns String String sPath If (sWorkspc='') Begin Move (Profile_StringVersion(sVersion,"Defaults","VDFRootDir")) To sPath If (Right(sPath,1) <> '\') Move (sPath+'\') To sPath Move (sPath+'Usr\Global\IdeSrc') To sPath End Else Begin Move (Profile_StringVersion(sVersion,("WorkSpaces\"+sWorkSpc),"IdeSrcPath")) To sPath End Function_Return sPath End_Function // // Tries to find a full path of the DFC File. //Function IDEFilePathEXT Global String sVersion String sWorkSpc String sName String sExt Returns String // Local String sFile // Local Integer iExist // If (Uppercase(Right(sName,4))) Ne ("."+sEXT) Append sName "." sEXT // If sWorkSpc Ne "" Begin // 1st look into the local // If sExt Eq "BMP" Move (Profile_StringVersion(sVersion,("WorkSpaces\"+sWorkSpc),"BitmapPath")) To sFile // Else Move (Profile_StringVersion(sVersion,("WorkSpaces\"+sWorkSpc),"AppSrcPath")) To sFile // If (Right(sFile,1)) Ne "\" Append sFile "\" // Append sFile sName // File_Exist sFile iExist // If Not iExist Move "" To sFile // Else Function_Return sFile // End // Append sFile (IDEGlobalPath(sVersion)) "\" sName // File_Exist sFile iExist // If Not iExist Move "" To sFile // Function_Return sFile //End_Function // Checks If a Class exists either in the local WorkSpace or in the Global one. // If Retval = 0 Class doenst exist. // If Retval > 0 in a local workspace. // If Retval < 0 in the global workspace Function IDEDoesClassExist Global String sVersion String sWrkSpc String sClass Returns Integer Integer iItem Move (trim(sClass)) To sClass Move (trim(sWrkSpc)) To sWrkspc If sWrkSpc Ne "" Begin Move (ClassExistsInList(sVersion,sWrkSpc,sClass)) To iItem If iItem Function_Return iItem // means Local End Move (ClassExistsInList(sVersion,"",sClass)) To iItem If iItem Function_Return (-iItem) // means Local End_Function // Registers a class for the IDE. //Procedure IDERegisterClass String sVersion String sWrkSpc String sClass String sBaseClass String sBmpNewE String sPageNewE // Local String sDFC sBmpNew sPageNew sSrc sDest sLine // Local Integer iBaseClassExist iRet hoID hoID2 iC // Local String sName sImage sPage sFile // Local Pointer pName pImage pPage pFile // If NUM_Arguments Gt 4 Move sBmpNewE To sBmpNew // If NUM_Arguments Gt 5 Move sPageNewE To sPageNew // Move (IDEDoesClassExist(sVersion,sWrkSpc,sBaseClass)) To iBaseClassExist // If iBaseClassExist Ne 0 Begin // If (IDEDoesClassExist(sVersion,sWrkSpc,sClass)) Ne 0 Begin // Procedure_Return -1 // Class already registered // End // Else Begin // Move (Repeat(Character(0),255)) To sName // Move (Repeat(Character(0),255)) To sImage // Move (Repeat(Character(0),255)) To sPage // Move (Repeat(Character(0),255)) To sFile // GetAddress Of sName To pName // GetAddress Of sImage To pImage // GetAddress Of sPage To pPage // GetAddress Of sFile To pFile // If iBaseClassExist Gt 0 Move (GetClassInList(sVersion,sWrkSpc,pName,pImage,pPage,pFile,iBaseClassExist)) To iRet // Local // Else Move (GetClassInList(sVersion,"" ,pName,pImage,pPage,pFile,(-iBaseClassExist))) To iRet // Global // If sBmpNew Eq "" Move sImage To sBmpNew // If sPageNew Eq "" Move sPage To sPageNew // Move (CString(sFile)) To sFile // Move (CString(sImage)) To sImage // Move (CString(sName)) To sName // // Get the full path of the *.DFC file. // If sFile Eq "" Move sName To sFile // Move (IDEFilePathEXT(sVersion,sWrkSpc,sFile,"DFC")) To sSrc // If sSrc Ne "" Begin // If sWrkSpc Eq "" Move (IDEGlobalPath(sVersion)) To sDest // Else Move (Profile_StringVersion(sVersion,("WorkSpaces\"+sWrkSpc),"AppSrcPath")) To sDest // If sDest Ne "" Begin // If (Right(sDest,1)) Ne "\" Append sDest "\" // Append sDest sClass ".DFC" // CopyFile sSrc To sDest // Object oTmpArray Is an Array // Move Self To hoID // End_Object // Object oTmpParser Is a cLineParser // Set psSepCharacter To " " // Move Self To hoID2 // End_Object // Direct_Input sDest // Repeat // Readln sLine // [Not Seqeof] Begin // If (Uppercase(Left(Trim(sLine),6))) Eq "CLASS " Begin // Send ParseLine To hoID2 sLine // Set value Of hoID2 Item 1 To sClass // Move "" To sLine // For iC From 0 To (Item_Count(hoID2)-1) // If sLine Ne "" Append sLine " " // Append sLine (Value(hoID2,iC)) // End // End // Set value Of hoID Item (Item_Count(hoID)) To sLine // End // Until [Seqeof] // Close_Input // Direct_Output sDest // For iC From 0 To (Item_Count(hoID)-1) // Writeln (Value(hoID,iC)) // End // Close_Output // Send Destroy_Object To hoID // Send Destroy_Object To hoID2 // End // End // Move (AddClassInList(sVersion,sWrkSpc,sClass,sBmpNew,sPage,sClass)) To iRet // End // End // Else Send Stop_Box (Append("IDERegisterClass: BaseClass doesnt exist: ",sBaseClass)) //End_Procedure