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 The 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
17 * along with this program. If not, see <https://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
49 wxWindow* ShowPage( const wxString& aTitle );
50
51 void SetModified() { m_modified = true; }
52
53 void SetError( const wxString& aMessage, const wxString& aPageName, int aCtrlId, int aRow = -1,
54 int aCol = -1 );
55
56 void SetError( const wxString& aMessage, wxWindow* aPage, wxWindow* aCtrl, int aRow = -1,
57 int aCol = -1 );
58
59 void UpdateResetButton( int aPage );
60
62
63 static PAGED_DIALOG* GetDialog( wxWindow* aWindow );
64
65protected:
67
68 bool TransferDataToWindow() override;
69 bool TransferDataFromWindow() override;
70
71 virtual void onAuxiliaryAction( wxCommandEvent& aEvent ) { aEvent.Skip(); }
72 virtual void onResetButton( wxCommandEvent& aEvent );
73 virtual void onOpenPrefsDir( wxCommandEvent& aEvent );
74 virtual void onPageChanged( wxBookCtrlEvent& aEvent );
75 virtual void onPageChanging( wxBookCtrlEvent& aEvent );
76 virtual void onCharHook( wxKeyEvent& aEvent );
77 void onTreeLeftDown( wxMouseEvent& aEvent );
78 void onTreeItemActivated( wxTreeEvent& aEvent );
79
82 wxButton* m_resetButton;
85
86private:
87 wxString m_title;
88
89 wxBoxSizer* m_buttonsSizer;
90
91 std::vector<bool> m_macHack;
92
93 wxTreeItemId m_clickExpandedItem;
94};
95
96
97#endif //PAGED_DIALOG_H
DIALOG_SHIM(wxWindow *aParent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, const wxString &name=wxDialogNameStr)
WX_TREEBOOK * GetTreebook()
virtual void onOpenPrefsDir(wxCommandEvent &aEvent)
wxTreeItemId m_clickExpandedItem
WX_INFOBAR * m_infoBar
void onTreeItemActivated(wxTreeEvent &aEvent)
bool TransferDataToWindow() override
~PAGED_DIALOG() override
PAGED_DIALOG(wxWindow *aParent, const wxString &aTitle, bool aShowReset, bool aShowOpenFolder, const wxString &aAuxiliaryAction=wxEmptyString, const wxSize &aInitialSize=wxDefaultSize)
wxButton * m_auxiliaryButton
std::vector< bool > m_macHack
wxButton * m_openPrefsDirButton
void onTreeLeftDown(wxMouseEvent &aEvent)
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)
WX_INFOBAR * GetInfoBar()
wxString m_title
void SetModified()
static PAGED_DIALOG * GetDialog(wxWindow *aWindow)
virtual void onResetButton(wxCommandEvent &aEvent)
WX_TREEBOOK * m_treebook
virtual void onPageChanged(wxBookCtrlEvent &aEvent)
wxBoxSizer * m_buttonsSizer
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
wxButton * m_resetButton
wxWindow * ShowPage(const wxString &aTitle)
Select the page with the given title.
A modified version of the wxInfoBar class that allows us to:
Definition wx_infobar.h:77