KiCad PCB EDA Suite
paged_dialog.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 (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20
21#ifndef PAGED_DIALOG_H
22#define PAGED_DIALOG_H
23
24#include <dialog_shim.h>
25
26
27class WX_INFOBAR;
28class wxTreebook;
29
31{
32public:
33 PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aShowReset,
34 const wxString& aAuxiliaryAction = wxEmptyString );
35 ~PAGED_DIALOG() override;
36
37 wxTreebook* GetTreebook() { return m_treebook; }
38
39 void SetInitialPage( const wxString& aPage, const wxString& aParentPage = wxEmptyString );
40
41 void SetModified() { m_modified = true; }
42
43 void SetError( const wxString& aMessage, const wxString& aPageName, int aCtrlId, int aRow = -1,
44 int aCol = -1 );
45
46 void SetError( const wxString& aMessage, wxWindow* aPage, wxWindow* aCtrl, int aRow = -1,
47 int aCol = -1 );
48
49 void UpdateResetButton( int aPage );
50
51protected:
53
54 bool TransferDataToWindow() override;
55 bool TransferDataFromWindow() override;
56
57 virtual void onAuxiliaryAction( wxCommandEvent& aEvent ) { aEvent.Skip(); }
58 virtual void onResetButton( wxCommandEvent& aEvent );
59 virtual void onPageChanged( wxBookCtrlEvent& aEvent );
60 virtual void onPageChanging( wxBookCtrlEvent& aEvent );
61 virtual void onCharHook( wxKeyEvent& aEvent );
62
63 wxTreebook* m_treebook;
65 wxButton* m_resetButton;
66 wxButton* m_cancelButton;
68
69private:
70 wxString m_title;
71
72 wxBoxSizer* m_buttonsSizer;
73
74 std::vector<bool> m_macHack;
75};
76
77
78#endif //PAGED_DIALOG_H
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:83
WX_INFOBAR * m_infoBar
Definition: paged_dialog.h:67
bool TransferDataToWindow() override
~PAGED_DIALOG() override
wxButton * m_auxiliaryButton
Definition: paged_dialog.h:64
std::vector< bool > m_macHack
Definition: paged_dialog.h:74
wxTreebook * m_treebook
Definition: paged_dialog.h:63
bool TransferDataFromWindow() override
void finishInitialization()
void UpdateResetButton(int aPage)
PAGED_DIALOG(wxWindow *aParent, const wxString &aTitle, bool aShowReset, const wxString &aAuxiliaryAction=wxEmptyString)
void SetInitialPage(const wxString &aPage, const wxString &aParentPage=wxEmptyString)
virtual void onPageChanging(wxBookCtrlEvent &aEvent)
virtual void onCharHook(wxKeyEvent &aEvent)
virtual void onAuxiliaryAction(wxCommandEvent &aEvent)
Definition: paged_dialog.h:57
wxString m_title
Definition: paged_dialog.h:70
wxButton * m_cancelButton
Definition: paged_dialog.h:66
void SetModified()
Definition: paged_dialog.h:41
virtual void onResetButton(wxCommandEvent &aEvent)
virtual void onPageChanged(wxBookCtrlEvent &aEvent)
wxBoxSizer * m_buttonsSizer
Definition: paged_dialog.h:72
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
wxTreebook * GetTreebook()
Definition: paged_dialog.h:37
wxButton * m_resetButton
Definition: paged_dialog.h:65
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:75