Use Windows.pkg Use cCJStandardMenuItemClasses.pkg Use cCJDeoMenuItemClasses.pkg Use Tools\TableProperties.dg Register_Object oTH3WorkspaceConfigure Object oDatabaseContextMenu is a cCJContextMenu Property String psCurrentLanguage "" Property String psFileName "" Property Handle phTableNumber 0 Property Handle phInvokingObject 0 Function ProcessRunMacros String sEditor Returns String Handle hTable hoClient String sVdfRoot sTable sParam sWorkspace Get Client_Id to hoClient Get phTableNumber to hTable Get psVdfRootDir of ghoWorkSpaceHandlerEx to sVdfRoot Move (Uppercase(sEditor)) to sEditor // Try add parameters automatically (or do it in manual mode) // -t@TABLENO@ -x@WORKSPACE@ Get InsertCurrentWorkspace of hoClient "" to sParam // ["-xWORKSPACETAG"] If (sParam<>"") Begin If ((sEditor contains "@WORKSPACE@")or(sEditor contains "-X@WORKSPACE@")) Begin Move (Replace("-X@WORKSPACE@", sEditor, "")) to sEditor Move (Replace("@WORKSPACE@", sEditor, "")) to sEditor End If ((sEditor contains " -T@TABLENO@")or(sEditor contains " -T@TABLENAME@")) Begin Move (Replace("-T@TABLENO@", sEditor, "")) to sEditor Move (Replace("-T@TABLENAME@", sEditor, "")) to sEditor End If (not(sEditor contains "NEWTABLE")) Begin Move (sParam * "-t"+String(hTable)) to sParam End Move (sEditor * sParam) to sEditor End Else Begin If (sEditor contains "@TABLENO@") ; Move (Replace("@TABLENO@", sEditor, String(hTable))) to sEditor If (sEditor contains "@TABLENAME@") Begin Get_Attribute DF_FILE_LOGICAL_NAME of hTable to sTable Move (Replace("@TABLENAME@", sEditor, sTable)) to sEditor End If (sEditor contains "@WORKSPACE@") Begin Get InsertCurrentWorkspace of hoClient "" to sParam Move (Replace(" -X", sEditor, " ")) to sEditor Move (Replace("@WORKSPACE@", sEditor, sParam)) to sEditor End End If (sEditor contains "@VDFROOT@") Begin Move (Replace("@VDFROOT@", sEditor, sVDFRoot)) to sEditor End Function_Return sEditor End_Function Object oEditItem is a cCJMenuItem Set psCaption to "Edit Table" Set psToolTip to "Edit Table" Set psDescription to "Edit Table" Set psImage to "TH3EditTable16.ico" Set psCategory to C_$CategoryFile Procedure OnExecute Variant vCommandBarControl Handle hoClient String sEditor tTHWorkspace THWorkspace Get pTHWorkspace of ghoApplication To THWorkspace Move THWorkspace.sDBEditor to sEditor If (sEditor="") Begin Get psDBBPath of ghoEditorProperties to sEditor If (sEditor<>"") Begin Get Client_Id to hoClient Get AdjustUtilityPathToVDFversion of hoClient sEditor to sEditor End Else Begin Send Stop_Box (_T("TheHammer Database Edit Tool not specified", 502)) // Take from defaults Send Popup to oTH3WorkspaceConfigure Move THWorkspace.sDBEditor to sEditor If (sEditor="") Procedure_Return End End Get ProcessRunMacros sEditor to sEditor // Runprogram background sEditor "" End_Procedure End_Object Object oViewItem is a cCJMenuItem Set psCaption to "View Table" Set psToolTip to "View Table" Set psDescription to "View Table" Set psImage to "TH3ViewTable16.ico" Set psCategory to C_$CategoryFile Procedure OnExecute Variant vCommandBarControl Handle hoClient String sViewer tTHWorkspace THWorkspace Get pTHWorkspace of ghoApplication To THWorkspace Move THWorkspace.sDBViewer to sViewer If (sViewer="") Begin Get psDBEPath of ghoEditorProperties to sViewer If (sViewer<>"") Begin Get Client_Id to hoClient Get AdjustUtilityPathToVDFversion of hoClient sViewer to sViewer End Else Begin Send Stop_Box (_T("TheHammer Database Viewer Tool not specified", 506)) // Take from defaults Send Popup to oTH3WorkspaceConfigure Move THWorkspace.sDBViewer to sViewer If (sViewer="") Procedure_Return End End Get ProcessRunMacros sViewer to sViewer // Runprogram background sViewer "" End_Procedure End_Object Object oNewItem is a cCJMenuItem Set psCaption to "Create New Table" Set psToolTip to "Create New Table" Set psDescription to "Create New Table" Set psImage to "TH3NewTable16.ico" Set psCategory to C_$CategoryFile Procedure OnExecute Variant vCommandBarControl String sEditor sParam Handle hoClient tTHWorkspace THWorkspace Get pTHWorkspace of ghoApplication To THWorkspace Move THWorkspace.sDBEditor to sEditor If (sEditor="") Begin Get psDBBPath of ghoEditorProperties to sEditor If (sEditor<>"") Begin Get Client_Id to hoClient Get AdjustUtilityPathToVDFversion of hoClient sEditor to sEditor End Else Begin Send Stop_Box (_T("TheHammer Database Edit Tool not specified", 510)) // Take from defaults Send Popup to oTH3WorkspaceConfigure Move THWorkspace.sDBEditor to sEditor If (sEditor="") Procedure_Return End End Get ProcessRunMacros (sEditor * "-PNEWTABLE") to sEditor // Runprogram background sEditor sParam End_Procedure End_Object Object oFolderItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Open Containing Folder" Set psToolTip to "Open Containing Folder" Set psDescription to "Open Containing Folder" Set psImage to "ActionOpen.ico" Set psCategory to C_$CategoryFile Procedure OnExecute Variant vCommandBarControl Boolean bOpened Handle hTable String sTable sDataPath sOldFileList sFileList Get phTableNumber to hTable Move (CurrentFileListPath(ghoWorkSpaceHandlerEx)) to sFileList Get_FileList sOldFileList Set_FileList sFileList Get_Attribute DF_FILE_ROOT_NAME of hTable to sTable Set_FileList sOldFileList Get PrimaryDataPath of ghoWorkSpaceHandlerEx to sDataPath // // Identify DataFlex file If ((not(sTable contains ":")) and (not(sTable contains "."))) Move (sTable+".DAT") to sTable // Driver name workout (XXXXDRV:TABLE) If (sTable contains ":") Begin Move (Right(sTable, Length(sTable)-Pos(":", sTable))) to sTable Move (sTable+".INT") to sTable End // open explorer in default style at correct path, with filename selected. Runprogram background "Explorer" ("/e,/select,"+sDataPath+sTable) End_Procedure End_Object Object oDDItem is a cCJMenuItem Set psCaption to "Open Data Dictionary" Set psToolTip to "Open Data Dictionary" Set psDescription to "Open Data Dictionary" Set psImage to "TH3OpenDD16.ico" Set psCategory to C_$CategoryFile Procedure OnExecute Variant vCommandBarControl tDBDDClasses ltDDClass tDBDDClasses[] ltDDClasses Handle hoDBTV Handle hTable Integer iIndex String sPathFile Get phTableNumber to hTable Get phInvokingObject to hoDBTV If (hoDBTV) Begin Get ptDDClasses of hoDBTV to ltDDClasses Move hTable to ltDDClass.iTableNo Move (SearchArray(ltDDClass, ltDDClasses)) to iIndex If (iIndex>=0) Begin Get PrimaryDdSrcPath of ghoWorkSpaceHandlerEx to sPathFile Send CAOpenFile of (oClientArea(oMain(Self))) (sPathFile+ltDDClasses[iIndex].sDDFile) End End End_Procedure End_Object Object oPropertiesItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Table Properties..." Set psToolTip to "Table Properties" Set psDescription to "Table Properties" Set psImage to "Properties16.ico" Set psCategory to C_$CategoryFile Procedure OnExecute Variant vCommandBarControl Set phTable of oTableProperties to (phTableNumber(Self)) Send Popup to oTableProperties End_Procedure End_Object #IFDEF TH_TRANSLATION Procedure Translate Set psCaption of oEditItem to gILanguage[499] Set psToolTip of oEditItem to gILanguage[500] Set psDescription of oEditItem to gILanguage[501] Set psCaption of oViewItem to gILanguage[503] Set psToolTip of oViewItem to gILanguage[504] Set psDescription of oViewItem to gILanguage[505] Set psCaption of oNewItem to gILanguage[507] Set psToolTip of oNewItem to gILanguage[508] Set psDescription of oNewItem to gILanguage[509] Set psCaption of oFolderItem to gILanguage[511] Set psToolTip of oFolderItem to gILanguage[512] Set psDescription of oFolderItem to gILanguage[513] Set psCaption of oDDItem to gILanguage[514] Set psToolTip of oDDItem to gILanguage[515] Set psDescription of oDDItem to gILanguage[516] Set psCaption of oPropertiesItem to gILanguage[517] Set psToolTip of oPropertiesItem to gILanguage[518] Set psDescription of oPropertiesItem to gILanguage[519] End_Procedure #ENDIF Procedure OnPopupInit Variant vCommandBarControl Handle hoCommandBarControls String sLanguage tTHWorkspace THWorkspace Forward Send OnPopupInit Get pTHWorkspace of ghoApplication To THWorkspace Set ComVisible of oNewItem to (THWorkspace.sSchema="DataFlex") #IFDEF TH_TRANSLATION Get psCurrentLanguage to sLanguage If (psInterfaceLanguage(ghoEditorProperties)<>sLanguage) Begin Send Translate End Set psCurrentLanguage to sLanguage #ENDIF End_Procedure End_Object