41 wxString builtinHelp =
_(
"Built-in variables:" );
44 builtinHelp += wxS(
"\n ${" ) +
name + wxS(
"} " ) +
text;
54 [
this]( wxKeyEvent& aEvent )
56 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
60 [
this]( wxStyledTextEvent& aEvent )
64 [
this](
const wxString& xRef, wxArrayString* tokens )
74 for(
const auto& [varName, varValue] :
m_project->GetTextVars() )
76 if( tokens->Index( varName ) == wxNOT_FOUND )
77 tokens->Add( varName );
91 [
this]( wxFocusEvent& aEvent )
98 [
this]( wxFocusEvent& aEvent )
179 int row = aEvent.GetRow();
195 wxRegEx re(
".*?(\\$\\{(.+?)\\})|(\\$\\((.+?)\\)).*?", wxRE_ADVANCED );
196 wxASSERT( re.IsValid() );
198 std::set<wxString> unique;
205 wxArrayString envTokens;
208 for(
const wxString& token : envTokens )
209 unique.insert( token );
214 for(
const auto& [varName, varValue] :
m_project->GetTextVars() )
215 unique.insert( varName );
219 while( re.Matches( src ) )
221 wxString envvar = re.GetMatch( src, 2 );
224 if( envvar.IsEmpty() )
225 envvar = re.GetMatch( src, 4 );
228 unique.insert( envvar );
231 src.Replace( re.GetMatch( src, 0 ), wxEmptyString );
239 unique.insert(
name );
241 for(
const wxString& evName : unique )
246 m_path_subs_grid->SetCellValue( row, 0, wxT(
"${" ) + evName + wxT(
"}" ) );
253 evValue =
_(
"<value set at runtime>" );
259 wxString token = wxT(
"${" ) + evName + wxT(
"}" );
262 if( evValue == token )
263 evValue = wxEmptyString;
wxCheckBox * m_cbRecordOutput
wxStaticText * m_stBuiltinHelp
wxCheckBox * m_cbIgnoreExitCode
WX_GRID * m_path_subs_grid
wxTextCtrl * m_textCtrlExpanded
DIALOG_EXECUTECOMMAND_JOB_SETTINGS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Execute Command Job Settings"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxStyledTextCtrl * m_textCtrlCommand
wxTextCtrl * m_textCtrlOutputPath
SCINTILLA_TRICKS * m_scintillaTricks
JOB_SPECIAL_EXECUTE * m_job
void onCommandChanged(wxStyledTextEvent &aEvent)
~DIALOG_EXECUTECOMMAND_JOB_SETTINGS()
DIALOG_EXECUTECOMMAND_JOB_SETTINGS(wxWindow *aParent, JOB_SPECIAL_EXECUTE *aJob, PROJECT *aProject)
wxWindow * m_lastFocusedInput
bool TransferDataToWindow() override
void populateEnvironReadOnlyTable()
Fill the variable table with the available variables and any referenced in the command,...
bool TransferDataFromWindow() override
void onSizeGrid(wxSizeEvent &event) override
void adjustPathSubsGridColumns(int aWidth)
void updateExpandedPreview()
Show the command with variables expanded as the job runner will run it.
void OnRecordOutputClicked(wxCommandEvent &event) override
void onVarGridDClick(wxGridEvent &aEvent)
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Container for project specific data.
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
Functions related to environment variables, including help functions.
std::map< wxString, wxString > GetExecuteBuiltinVariableHelp()
Describe each variable returned by GetExecuteBuiltinVariables() for the user.
wxString ExpandExecuteCommand(const wxString &aCommand, const PROJECT *aProject)
Expand an Execute Command string, including the built-in variables.
#define OUTPUT_TMP_PATH_VAR_NAME
KICOMMON_API void GetEnvVarAutocompleteTokens(wxArrayString *aVars)
Return autocomplete tokens for environment variables for Scintilla.
KICOMMON_API wxFont GetMonospacedUIFont(int aRelativeSize=0)
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
Functions to provide common constants and other functions to assist in making a consistent UI.