KiCad PCB EDA Suite
RESETTABLE_PANEL Class Referenceabstract

A wxPanel that is designed to be reset in a standard manner. More...

#include <resettable_panel.h>

Inheritance diagram for RESETTABLE_PANEL:
PANEL_3D_COLORS_BASE PANEL_3D_DISPLAY_OPTIONS_BASE PANEL_3D_OPENGL_OPTIONS_BASE PANEL_3D_RAYTRACING_OPTIONS_BASE PANEL_COLOR_SETTINGS_BASE PANEL_COMMON_SETTINGS_BASE PANEL_DATA_COLLECTION_BASE PANEL_DISPLAY_OPTIONS_BASE PANEL_EDIT_OPTIONS_BASE PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE PANEL_EESCHEMA_EDITING_OPTIONS_BASE PANEL_FP_EDITOR_DEFAULTS_BASE PANEL_GERBVIEW_DISPLAY_OPTIONS_BASE PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE PANEL_HOTKEYS_EDITOR PANEL_MOUSE_SETTINGS_BASE PANEL_PCBNEW_DISPLAY_ORIGIN_BASE PANEL_PL_EDITOR_COLOR_SETTINGS_BASE PANEL_PL_EDITOR_DISPLAY_OPTIONS PANEL_SETUP_PINMAP_BASE PANEL_SYM_DISPLAY_OPTIONS PANEL_SYM_EDITING_OPTIONS_BASE

Public Member Functions

 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 void ResetPanel ()=0
 Reset the contents of this panel. More...
 
virtual wxString GetResetTooltip () const
 Get the tooltip the reset button should display when showing this panel. More...
 
wxString GetHelpTextAtPoint (const wxPoint &aPt, wxHelpEvent::Origin aOrigin) const override
 Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }. More...
 

Detailed Description

A wxPanel that is designed to be reset in a standard manner.

Definition at line 34 of file resettable_panel.h.

Constructor & Destructor Documentation

◆ RESETTABLE_PANEL()

RESETTABLE_PANEL::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 
)
inline

Definition at line 37 of file resettable_panel.h.

42 : wxPanel( aParent, aId, aPos, aSize, aStyle | wxRESETTABLE, aName )
43 {
44 Bind( wxEVT_COMMAND_BUTTON_CLICKED,
45 [&]( wxCommandEvent& aCmd )
46 {
47 if( aCmd.GetId() == ID_RESET_PANEL )
48 ResetPanel();
49 else
50 aCmd.Skip();
51 } );
52 }
virtual void ResetPanel()=0
Reset the contents of this panel.
#define wxRESETTABLE
#define ID_RESET_PANEL

References ID_RESET_PANEL, and ResetPanel().

Member Function Documentation

◆ GetHelpTextAtPoint()

wxString RESETTABLE_PANEL::GetHelpTextAtPoint ( const wxPoint &  aPt,
wxHelpEvent::Origin  aOrigin 
) const
inlineoverride

Overridden to supply the reset button tooltip when queried with { -INT_MAX, INT_MAX }.

Definition at line 72 of file resettable_panel.h.

73 {
74 if( aPt == wxPoint( -INT_MAX, INT_MAX ) )
75 return GetResetTooltip();
76 else
77 return wxPanel::GetHelpTextAtPoint( aPt, aOrigin );
78 }
virtual wxString GetResetTooltip() const
Get the tooltip the reset button should display when showing this panel.

References GetResetTooltip().

◆ GetResetTooltip()

virtual wxString RESETTABLE_PANEL::GetResetTooltip ( ) const
inlinevirtual

Get the tooltip the reset button should display when showing this panel.

Returns
the tooltip

Reimplemented in PANEL_COLOR_SETTINGS, and PANEL_HOTKEYS_EDITOR.

Definition at line 64 of file resettable_panel.h.

65 {
66 return _( "Reset all settings on this page to their default" );
67 }
#define _(s)

References _.

Referenced by GetHelpTextAtPoint().

◆ ResetPanel()


The documentation for this class was generated from the following file: