// TH3RunToolBar.pkg (File Toolbar Pane) // Created by Sergey V Natarov (senatc@postman.ru) on 09/03/2017 @ 11:40 // Use cCJCommandBarSystem.pkg Use cCJStandardMenuItemClasses.pkg Object oRunToolBar is a cCJToolbar Set psTitle to "Build" Object oRunItem is a cCJMenuItem Set psCaption to "Run" Set psToolTip to "Run " Set psDescription to "Run current project" Set psImage to "THRun32.ico" Set pbActiveUpdate to True Set psCategory to "Build" Set psShortcut to "F5" Function CreateComControl Handle hoControls Returns Variant Variant vControl Forward Get CreateComControl hoControls to vControl Send ComSetIconSize 32 32 Function_Return vControl End_Function Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send CABuildRun of hoClient End_Procedure Function IsEnabled Returns Boolean Boolean bEnabled Handle hoCompiler Get BuiltInCompiler to hoCompiler If (hoCompiler) Begin Get piCompilingMode of hoCompiler to bEnabled End Function_Return (not(bEnabled)) End_Function End_Object Object oStopItem is a cCJMenuItem Set psCaption to "Stop" Set psToolTip to "Stop" Set psDescription to "Stop current project compilation process" Set psImage to "THStop32.ico" Set pbActiveUpdate to True Set psCategory to "Build" Set psShortcut to "Shift+F5" Procedure OnExecute Variant vCommandBarControl Boolean bCompiling Handle hoCompiler Get BuiltInCompiler to hoCompiler Get piCompilingMode of hoCompiler to bCompiling If (bCompiling) Send ComStopCompile to hoCompiler End_Procedure Function IsEnabled Returns Boolean Boolean bEnabled Handle hoCompiler Get BuiltInCompiler to hoCompiler If (hoCompiler) Begin Get piCompilingMode of hoCompiler to bEnabled End Function_Return bEnabled End_Function End_Object Object oCompileItem is a cCJMenuItem Set psCaption to "Compile" Set psToolTip to "Compile current file" Set psDescription to "Compile current project" Set psImage to "THCompile64.ico" Set pbActiveUpdate to True Set psCategory to "Build" Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send CABuildCompile of hoClient End_Procedure Function IsEnabled Returns Boolean Boolean bEnabled Handle hoCompiler Get BuiltInCompiler to hoCompiler If (hoCompiler) Begin Get piCompilingMode of hoCompiler to bEnabled End Function_Return (not(bEnabled)) End_Function End_Object Object oExecuteItem is a cCJMenuItem Set pbControlBeginGroup to True Set psCaption to "Execute " Set psToolTip to "Execute " Set psDescription to "Execute current project" Set psImage to "THRun64.ico" Set pbActiveUpdate to True Set psCategory to "Build" Procedure OnExecute Variant vCommandBarControl Handle hoClient Get Client_Id to hoClient Send CABuildExecute of hoClient End_Procedure Function IsEnabled Returns Boolean Boolean bEnabled Handle hoCompiler String sFile sExt sCurFile sTmp sDesc Handle hoClient Move False to bEnabled Get Client_Id to hoClient Get BuiltInCompiler to hoCompiler If (hoCompiler) Begin Get piCompilingMode of hoCompiler to bEnabled End // If (gsCurrentProgramFile<>"") Move gsCurrentProgramFile to sFile Get CAFileNameCur of hoClient to sCurFile Move (Right(Uppercase(Trim(sCurFile)),4)) to sExt If (sExt=".SRC") Move sCurFile to sFile If (sFile<>"") Begin #IFDEF TH_TRANSLATION Move (Replace("%1", gILanguage[420], sFile)) to sDesc Set psToolTip of oRunItem to sDesc Move (Replace("%1", gILanguage[421], sCurFile)) to sDesc Set psToolTip of oCompileItem to sDesc #ELSE Set psToolTip of oRunItem to ("&Run"*'<'+sFile+'>') Set psToolTip of oCompileItem to ("&Compile"*'<'+sCurFile+'>') #ENDIF Move (FileFromPath(sFile)) to sTmp If (sTmp Ne "") Begin Move (Left(sTmp,Length(sTmp)-4)) to sTmp If (Trim(gsCurrentCommandLinePara)) Ne "" Begin Append sTmp " " (Character(34)) gsCurrentCommandLinePara (Character(34)) End Move sTmp to sFile End #IFDEF TH_TRANSLATION Move (Replace("%1", gILanguage[422], sCurFile)) to sDesc #ELSE Move ("&Execute"*'<'+sFile+'>') to sDesc #ENDIF Set psToolTip of oExecuteItem to sDesc End // Function_Return (not(bEnabled)) End_Function End_Object #IFDEF TH_TRANSLATION Procedure Translate Set psTitle to gILanguage[407] Set psCaption of oRunItem to gILanguage[408] Set psToolTip of oRunItem to gILanguage[409] Set psDescription of oRunItem to gILanguage[410] Set psCaption of oStopItem to gILanguage[411] Set psToolTip of oStopItem to gILanguage[412] Set psDescription of oStopItem to gILanguage[413] Set psCaption of oCompileItem to gILanguage[414] Set psToolTip of oCompileItem to gILanguage[415] Set psDescription of oCompileItem to gILanguage[416] Set psCaption of oExecuteItem to gILanguage[417] Set psToolTip of oExecuteItem to gILanguage[418] Set psDescription of oExecuteItem to gILanguage[419] End_Procedure #ENDIF End_Object