KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
dialog_executecommand_job_settings.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2024 Mark Roszko <mark.roszko@gmail.com>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
23#include <scintilla_tricks.h>
24#include <env_vars.h>
25
26
28 JOB_SPECIAL_EXECUTE* aJob ) :
30 m_job( aJob ),
31 m_scintillaTricks( nullptr )
32{
33 m_scintillaTricks = new SCINTILLA_TRICKS( m_textCtrlCommand, wxT( "{}" ), false,
34 // onAcceptFn
35 [this]( wxKeyEvent& aEvent )
36 {
37 wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
38 },
39
40 // onCharFn
41 [this]( wxStyledTextEvent& aEvent )
42 {
44 // getTokensFn
45 []( const wxString& xRef, wxArrayString* tokens )
46 {
48 } );
49 } );
50
52
54}
55
56
58{
59 delete m_scintillaTricks;
60}
61
62
64{
65 m_job->m_command = m_textCtrlCommand->GetValue();
69
70 return true;
71}
72
73
75{
76 m_textCtrlCommand->SetValue( m_job->m_command );
79
81 m_textCtrlOutputPath->Enable( m_cbRecordOutput->GetValue() );
82
83 return true;
84}
85
86
88{
89 m_textCtrlOutputPath->Enable( m_cbRecordOutput->GetValue() );
90}
Class DIALOG_EXECUTECOMMAND_JOB_SETTINGS_BASE.
DIALOG_EXECUTECOMMAND_JOB_SETTINGS(wxWindow *aParent, JOB_SPECIAL_EXECUTE *aJob)
void OnRecordOutputClicked(wxCommandEvent &event) override
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...
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
Definition: job.cpp:153
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
Definition: job.h:226
Add cut/copy/paste, dark theme, autocomplete and brace highlighting to a wxStyleTextCtrl instance.
void DoTextVarAutocomplete(const std::function< void(const wxString &xRef, wxArrayString *tokens)> &getTokensFn)
Functions related to environment variables, including help functions.
KICOMMON_API void GetEnvVarAutocompleteTokens(wxArrayString *aVars)
Return autocomplete tokens for environment variables for Scintilla.
Definition: env_vars.cpp:73