KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_text_variables.h
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
23#include <wx/valtext.h>
24
25#include <map>
26#include <memory>
27
28class PROJECT;
29
30
32{
33public:
34 PANEL_TEXT_VARIABLES( wxWindow* aParent, PROJECT* aProject );
35 ~PANEL_TEXT_VARIABLES() override;
36
37 bool TransferDataToWindow() override;
38 bool TransferDataFromWindow() override;
39
40 void ImportSettingsFrom( const PROJECT* aOtherProject );
41
42protected:
43 // Various button callbacks
44 void OnUpdateUI( wxUpdateUIEvent& event ) override;
45 void OnGridCellChanging( wxGridEvent& event );
46 void OnAddTextVar( wxCommandEvent& event ) override;
47 void OnRemoveTextVar( wxCommandEvent& event ) override;
48
49 void AppendTextVar( const wxString& aName, const wxString& aValue );
50
51 void checkReload();
52
53private:
55
56 std::map<wxString, wxString> m_lastLoaded;
58
59 wxString m_errorMsg;
62
63 wxTextValidator m_nameValidator;
64};
PANEL_TEXT_VARIABLES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
bool TransferDataToWindow() override
std::map< wxString, wxString > m_lastLoaded
void OnGridCellChanging(wxGridEvent &event)
void OnUpdateUI(wxUpdateUIEvent &event) override
void OnRemoveTextVar(wxCommandEvent &event) override
bool TransferDataFromWindow() override
void OnAddTextVar(wxCommandEvent &event) override
void AppendTextVar(const wxString &aName, const wxString &aValue)
wxTextValidator m_nameValidator
void ImportSettingsFrom(const PROJECT *aOtherProject)
PANEL_TEXT_VARIABLES(wxWindow *aParent, PROJECT *aProject)
Container for project specific data.
Definition project.h:62