44 [
this]( wxKeyEvent& aEvent )
46 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
50 [
this]( wxStyledTextEvent& aEvent )
54 [](
const wxString& xRef, wxArrayString* tokens )
69 [
this]( wxFocusEvent& aEvent )
76 [
this]( wxFocusEvent& aEvent )
149 int row = aEvent.GetRow();
165 wxRegEx re(
".*?(\\$\\{(.+?)\\})|(\\$\\((.+?)\\)).*?", wxRE_ADVANCED );
166 wxASSERT( re.IsValid() );
168 std::set<wxString> unique;
175 wxArrayString envTokens;
178 for(
const wxString& token : envTokens )
179 unique.insert( token );
184 for(
const auto& [varName, varValue] :
m_project->GetTextVars() )
185 unique.insert( varName );
189 while( re.Matches( src ) )
191 wxString envvar = re.GetMatch( src, 2 );
194 if( envvar.IsEmpty() )
195 envvar = re.GetMatch( src, 4 );
198 unique.insert( envvar );
201 src.Replace( re.GetMatch( src, 0 ), wxEmptyString );
208 for(
const wxString& evName : unique )
213 m_path_subs_grid->SetCellValue( row, 0, wxT(
"${" ) + evName + wxT(
"}" ) );
220 evValue =
_(
"<value set at runtime>" );
226 wxString token = wxT(
"${" ) + evName + wxT(
"}" );
229 if( evValue == token )
230 evValue = wxEmptyString;
wxCheckBox * m_cbRecordOutput
wxCheckBox * m_cbIgnoreExitCode
WX_GRID * m_path_subs_grid
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 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.
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Functions related to environment variables, including help functions.
#define OUTPUT_TMP_PATH_VAR_NAME
KICOMMON_API void GetEnvVarAutocompleteTokens(wxArrayString *aVars)
Return autocomplete tokens for environment variables for Scintilla.
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.