47 [
this]( wxKeyEvent& aEvent )
49 wxPostEvent(
this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
53 [
this]( wxStyledTextEvent& aEvent )
57 [
this](
const wxString& xRef, wxArrayString* tokens )
64 for(
const auto& [varName, varValue] :
m_project->GetTextVars() )
66 if( tokens->Index( varName ) == wxNOT_FOUND )
67 tokens->Add( varName );
81 [
this]( wxFocusEvent& aEvent )
88 [
this]( wxFocusEvent& aEvent )
169 int row = aEvent.GetRow();
185 wxRegEx re(
".*?(\\$\\{(.+?)\\})|(\\$\\((.+?)\\)).*?", wxRE_ADVANCED );
186 wxASSERT( re.IsValid() );
188 std::set<wxString> unique;
195 wxArrayString envTokens;
198 for(
const wxString& token : envTokens )
199 unique.insert( token );
204 for(
const auto& [varName, varValue] :
m_project->GetTextVars() )
205 unique.insert( varName );
209 while( re.Matches( src ) )
211 wxString envvar = re.GetMatch( src, 2 );
214 if( envvar.IsEmpty() )
215 envvar = re.GetMatch( src, 4 );
218 unique.insert( envvar );
221 src.Replace( re.GetMatch( src, 0 ), wxEmptyString );
228 for(
const wxString& evName : unique )
233 m_path_subs_grid->SetCellValue( row, 0, wxT(
"${" ) + evName + wxT(
"}" ) );
240 evValue =
_(
"<value set at runtime>" );
246 wxString token = wxT(
"${" ) + evName + wxT(
"}" );
249 if( evValue == token )
250 evValue = wxEmptyString;
wxCheckBox * m_cbRecordOutput
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.
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.
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.