KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-2023 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#include <widgets/wx_treebook.h>
26
27
28class WX_INFOBAR;
29class WX_TREEBOOK;
30
32{
33public:
34 PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aShowReset, bool aShowOpenFolder,
35 const wxString& aAuxiliaryAction = wxEmptyString,
36 const wxSize& aInitialSize = wxDefaultSize );
37 ~PAGED_DIALOG() override;
38
40
41 void SetInitialPage( const wxString& aPage, const wxString& aParentPage = wxEmptyString );
42
43 void SetModified() { m_modified = true; }
44
45 void SetError( const wxString& aMessage, const wxString& aPageName, int aCtrlId, int aRow = -1,
46 int aCol = -1 );
47
48 void SetError( const wxString& aMessage, wxWindow* aPage, wxWindow* aCtrl, int aRow = -1,
49 int aCol = -1 );
50
51 void UpdateResetButton( int aPage );
52
53 static PAGED_DIALOG* GetDialog( wxWindow* aWindow );
54
55protected:
57
58 bool TransferDataToWindow() override;
59 bool TransferDataFromWindow() override;
60
61 virtual void onAuxiliaryAction( wxCommandEvent& aEvent ) { aEvent.Skip(); }
62 virtual void onResetButton( wxCommandEvent& aEvent );
63 virtual void onOpenPreferencesButton( wxCommandEvent& aEvent );
64 virtual void onPageChanged( wxBookCtrlEvent& aEvent );
65 virtual void onPageChanging( wxBookCtrlEvent& aEvent );
66 virtual void onCharHook( wxKeyEvent& aEvent );
67
70 wxButton* m_resetButton;
73
74private:
75 wxString m_title;
76
77 wxBoxSizer* m_buttonsSizer;
78
79 std::vector<bool> m_macHack;
80};
81
82
83#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:84
WX_TREEBOOK * GetTreebook()
Definition: paged_dialog.h:39
WX_INFOBAR * m_infoBar
Definition: paged_dialog.h:72
bool TransferDataToWindow() override
~PAGED_DIALOG() override
wxButton * m_auxiliaryButton
Definition: paged_dialog.h:69
std::vector< bool > m_macHack
Definition: paged_dialog.h:79
wxButton * m_openPrefsDirButton
Definition: paged_dialog.h:71
bool TransferDataFromWindow() override
void finishInitialization()
void UpdateResetButton(int aPage)
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:61
wxString m_title
Definition: paged_dialog.h:75
virtual void onOpenPreferencesButton(wxCommandEvent &aEvent)
void SetModified()
Definition: paged_dialog.h:43
static PAGED_DIALOG * GetDialog(wxWindow *aWindow)
virtual void onResetButton(wxCommandEvent &aEvent)
WX_TREEBOOK * m_treebook
Definition: paged_dialog.h:68
virtual void onPageChanged(wxBookCtrlEvent &aEvent)
wxBoxSizer * m_buttonsSizer
Definition: paged_dialog.h:77
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
wxButton * m_resetButton
Definition: paged_dialog.h:70
A modified version of the wxInfoBar class that allows us to:
Definition: wx_infobar.h:75