KiCad PCB EDA Suite
resettable_panel.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) 2020 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 #ifndef RESETTABLE_PANEL_H_
21 #define RESETTABLE_PANEL_H_
22 
23 #include <wx/panel.h>
24 
25 class PAGED_DIALOG;
26 
30 class RESETTABLE_PANEL : public wxPanel
31 {
32 public:
33  RESETTABLE_PANEL( wxWindow* aParent, wxWindowID aId = wxID_ANY,
34  const wxPoint& aPos = wxDefaultPosition,
35  const wxSize& aSize = wxSize( -1,-1 ),
36  long aStyle = wxTAB_TRAVERSAL,
37  const wxString& aName = wxEmptyString )
38  : wxPanel( aParent, aId, aPos, aSize, aStyle, aName )
39  {
40  }
41 
45  virtual void ResetPanel() = 0;
46 
52  virtual wxString GetResetTooltip()
53  {
54  return _( "Reset all settings on this page to their default" );
55  }
56 };
57 
58 #endif
RESETTABLE_PANEL(wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxSize(-1,-1), long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)
virtual wxString GetResetTooltip()
Get the tooltip the reset button should display when showing this panel.
#define _(s)
virtual void ResetPanel()=0
Reset the contents of this panel.
A wxPanel that is designed to be reset in a standard manner.