// TH3HelpMenu.mn Use cCJCommandBarSystem.pkg Use cCJAboutMenuItem.pkg Class cCJLanguageMenuItem is a cCJMenuItem Procedure Construct_Object Forward Send Construct_Object End_Procedure #IFDEF TH_TRANSLATION Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send THTranslateTo to hoClient (psCaption(Self)) End_Procedure #ENDIF End_Class Object oHelpMenu is a cCJMenuItem Set peControlType to xtpControlPopup Set psCaption to "&Help" Set psDescription to "Access Information for learning and using The Hammer 3.0 application." Set psToolTip to "Help" #IFDEF TH_TRANSLATION Object oLanguagePopupMenu is a cCJMenuItem Property Handle[] phArrayOfWindows Set peControlType to xtpControlPopup Set psCaption to "Language" Set psToolTip to "Select current interface language" Set psDescription to "Select current interface language" Set psImage to "language16.ico" //Set pbEnabled to False Object oTranslateItem is a cCJMenuItem Set pbAddToDesignerMenu to True Set psCaption to "Translate..." Set psToolTip to "Translates interface items into the selected language" Set psDescription to "Translates interface items into the selected language" Procedure OnExecute Variant vCommandBarControl End_Procedure End_Object Object oDefaultItem is a cCJMenuItem Set pbAddToDesignerMenu to True Set psCaption to "Default (English)" Set psToolTip to "Shows interface items in English" Set psDescription to "Shows interface items in English" Set pbControlBeginGroup to True //Set pbChecked to True Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send THTranslateTo to hoClient "" End_Procedure End_Object Procedure OnPopupInit Variant vCommandBarControl Handle hCommandBarControls String sLabel sC sDesc sLanguage Integer iC iCount iWindows Handle[] hArrayOfWindows Variant vItem Get phArrayOfWindows to hArrayOfWindows Move (SizeOfArray(hArrayOfWindows)) to iWindows For iC from 0 to (iWindows-1) If (hArrayOfWindows[iC]) ; Send Destroy of hArrayOfWindows[iC] // assume this removes all menu items of this action Loop Move (ResizeArray(hArrayOfWindows,0)) to hArrayOfWindows Get psInterfaceLanguage of ghoEditorProperties to sLanguage String sPath sFile Get mLanguageFilePath to sPath Move (sPath+"\*.lng") to sPath Direct_Input channel 1 ("DIR:"+sPath) Move 0 to iC While (not(SeqEof)) Readln channel 1 sFile If ( (sFile<>"") and (Uppercase(sFile) contains ".LNG") ) Begin Move (Left(sFile, Length(sFile)-4)) to sFile Get Create U_cCJLanguageMenuItem to hArrayOfWindows[iC] Set psCaption of hArrayOfWindows[iC] to sFile Move (Replace("%1", gILanguage[343], sFile)) to sDesc Set psDescription of hArrayOfWindows[iC] to sDesc Set pbChecked of hArrayOfWindows[iC] to (sFile=sLanguage) Get AddDynamicControl of hArrayOfWindows[iC] hCommandBarControls to vItem Increment iC End Loop Close_Input channel 1 Set phArrayOfWindows to hArrayOfWindows // Default item Set pbChecked of oDefaultItem to (sLanguage="") End_Procedure End_Object #ENDIF Object oAboutMenuItem is a cCJAboutMenuItem Set pbControlBeginGroup to True End_Object #IFDEF TH_TRANSLATION Procedure Translate Set psCaption of oLanguagePopupMenu to gILanguage[334] Set psToolTip of oLanguagePopupMenu to gILanguage[335] Set psDescription of oLanguagePopupMenu to gILanguage[336] Set psCaption of oTranslateItem to gILanguage[337] Set psToolTip of oTranslateItem to gILanguage[338] Set psDescription of oTranslateItem to gILanguage[339] Set psCaption of oDefaultItem to gILanguage[340] Set psToolTip of oDefaultItem to gILanguage[341] Set psDescription of oDefaultItem to gILanguage[342] Set psCaption of oAboutMenuItem to gILanguage[344] Set psToolTip of oAboutMenuItem to gILanguage[345] Set psDescription of oAboutMenuItem to gILanguage[346] End_Procedure #ENDIF End_Object