KiCad PCB EDA Suite
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE Class Referenceabstract

Class PANEL_PCBNEW_DISPLAY_ORIGIN_BASE. More...

#include <panel_pcbnew_display_origin_base.h>

Inheritance diagram for PANEL_PCBNEW_DISPLAY_ORIGIN_BASE:
RESETTABLE_PANEL PANEL_PCBNEW_DISPLAY_ORIGIN

Public Member Functions

 PANEL_PCBNEW_DISPLAY_ORIGIN_BASE (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
 
 ~PANEL_PCBNEW_DISPLAY_ORIGIN_BASE ()
 
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...
 

Protected Attributes

wxRadioBox * m_DisplayOrigin
 
wxRadioBox * m_XAxisDirection
 
wxRadioBox * m_YAxisDirection
 

Detailed Description

Constructor & Destructor Documentation

◆ PANEL_PCBNEW_DISPLAY_ORIGIN_BASE()

PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::PANEL_PCBNEW_DISPLAY_ORIGIN_BASE ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxSize( -1,-1 ),
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxEmptyString 
)

Definition at line 12 of file panel_pcbnew_display_origin_base.cpp.

12 : RESETTABLE_PANEL( parent, id, pos, size, style, name )
13{
14 wxBoxSizer* bPanelSizer;
15 bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
16
17 wxBoxSizer* bMargins;
18 bMargins = new wxBoxSizer( wxHORIZONTAL );
19
20 wxBoxSizer* bLeftSizer;
21 bLeftSizer = new wxBoxSizer( wxVERTICAL );
22
23 wxString m_DisplayOriginChoices[] = { _("Page origin"), _("Drill/place file origin"), _("Grid origin") };
24 int m_DisplayOriginNChoices = sizeof( m_DisplayOriginChoices ) / sizeof( wxString );
25 m_DisplayOrigin = new wxRadioBox( this, wxID_ANY, _("Display Origin"), wxDefaultPosition, wxDefaultSize, m_DisplayOriginNChoices, m_DisplayOriginChoices, 1, wxRA_SPECIFY_COLS );
26 m_DisplayOrigin->SetSelection( 0 );
27 m_DisplayOrigin->SetToolTip( _("Select which origin is used for X,Y coordinate display.") );
28
29 bLeftSizer->Add( m_DisplayOrigin, 0, wxALL|wxEXPAND, 5 );
30
31 wxString m_XAxisDirectionChoices[] = { _("Increases right"), _("Increases left") };
32 int m_XAxisDirectionNChoices = sizeof( m_XAxisDirectionChoices ) / sizeof( wxString );
33 m_XAxisDirection = new wxRadioBox( this, wxID_ANY, _("X Axis"), wxDefaultPosition, wxDefaultSize, m_XAxisDirectionNChoices, m_XAxisDirectionChoices, 1, wxRA_SPECIFY_COLS );
34 m_XAxisDirection->SetSelection( 0 );
35 m_XAxisDirection->SetToolTip( _("Select which the direction on the screen in which the X axis increases.") );
36
37 bLeftSizer->Add( m_XAxisDirection, 0, wxALL|wxEXPAND, 5 );
38
39 wxString m_YAxisDirectionChoices[] = { _("Increases up"), _("Increases down") };
40 int m_YAxisDirectionNChoices = sizeof( m_YAxisDirectionChoices ) / sizeof( wxString );
41 m_YAxisDirection = new wxRadioBox( this, wxID_ANY, _("Y Axis"), wxDefaultPosition, wxDefaultSize, m_YAxisDirectionNChoices, m_YAxisDirectionChoices, 1, wxRA_SPECIFY_COLS );
42 m_YAxisDirection->SetSelection( 0 );
43 m_YAxisDirection->SetToolTip( _("Select which the direction on the screen in which the Y axis increases.") );
44
45 bLeftSizer->Add( m_YAxisDirection, 0, wxALL|wxEXPAND, 5 );
46
47
48 bMargins->Add( bLeftSizer, 1, wxEXPAND|wxRIGHT, 5 );
49
50 wxBoxSizer* bRightSizer;
51 bRightSizer = new wxBoxSizer( wxVERTICAL );
52
53
54 bRightSizer->Add( 0, 0, 1, wxEXPAND, 5 );
55
56
57 bMargins->Add( bRightSizer, 1, wxEXPAND|wxRIGHT, 5 );
58
59
60 bPanelSizer->Add( bMargins, 1, wxTOP|wxRIGHT, 5 );
61
62
63 this->SetSizer( bPanelSizer );
64 this->Layout();
65 bPanelSizer->Fit( this );
66}
const char * name
Definition: DXF_plotter.cpp:56
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)
#define _(s)

References _, m_DisplayOrigin, m_XAxisDirection, and m_YAxisDirection.

◆ ~PANEL_PCBNEW_DISPLAY_ORIGIN_BASE()

PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::~PANEL_PCBNEW_DISPLAY_ORIGIN_BASE ( )

Definition at line 68 of file panel_pcbnew_display_origin_base.cpp.

69{
70}

Member Function Documentation

◆ GetHelpTextAtPoint()

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

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 RESETTABLE_PANEL::GetResetTooltip().

◆ GetResetTooltip()

virtual wxString RESETTABLE_PANEL::GetResetTooltip ( ) const
inlinevirtualinherited

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 }

References _.

Referenced by RESETTABLE_PANEL::GetHelpTextAtPoint().

◆ ResetPanel()

Member Data Documentation

◆ m_DisplayOrigin

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_DisplayOrigin
protected

◆ m_XAxisDirection

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_XAxisDirection
protected

◆ m_YAxisDirection

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_YAxisDirection
protected

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