KiCad PCB EDA Suite
PANEL_PCBNEW_DISPLAY_ORIGIN Class Reference

#include <panel_pcbnew_display_origin.h>

Inheritance diagram for PANEL_PCBNEW_DISPLAY_ORIGIN:
PANEL_PCBNEW_DISPLAY_ORIGIN_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_PCBNEW_DISPLAY_ORIGIN (wxWindow *aParent)
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
void ResetPanel () override
 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
 

Private Member Functions

void loadPCBSettings (PCBNEW_SETTINGS *aCfg)
 

Detailed Description

Definition at line 31 of file panel_pcbnew_display_origin.h.

Constructor & Destructor Documentation

◆ PANEL_PCBNEW_DISPLAY_ORIGIN()

PANEL_PCBNEW_DISPLAY_ORIGIN::PANEL_PCBNEW_DISPLAY_ORIGIN ( wxWindow *  aParent)

Definition at line 31 of file panel_pcbnew_display_origin.cpp.

31 :
33{
34}
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)

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 }
#define _(s)

References _.

Referenced by RESETTABLE_PANEL::GetHelpTextAtPoint().

◆ loadPCBSettings()

void PANEL_PCBNEW_DISPLAY_ORIGIN::loadPCBSettings ( PCBNEW_SETTINGS aCfg)
private

Definition at line 37 of file panel_pcbnew_display_origin.cpp.

38{
39 int origin = 0;
40
41 switch( aCfg->m_Display.m_DisplayOrigin )
42 {
43 case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_PAGE: origin = 0; break;
44 case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_AUX: origin = 1; break;
45 case PCB_DISPLAY_ORIGIN::PCB_ORIGIN_GRID: origin = 2; break;
46 }
47
48 m_DisplayOrigin->SetSelection( origin );
49 m_XAxisDirection->SetSelection( aCfg->m_Display.m_DisplayInvertXAxis ? 1 : 0 );
50 m_YAxisDirection->SetSelection( aCfg->m_Display.m_DisplayInvertYAxis ? 0 : 1 );
51}
DISPLAY_OPTIONS m_Display
@ PCB_ORIGIN_AUX
@ PCB_ORIGIN_GRID
@ PCB_ORIGIN_PAGE

References PCBNEW_SETTINGS::m_Display, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayInvertXAxis, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayInvertYAxis, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_DisplayOrigin, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayOrigin, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_XAxisDirection, PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_YAxisDirection, PCB_ORIGIN_AUX, PCB_ORIGIN_GRID, and PCB_ORIGIN_PAGE.

Referenced by ResetPanel(), and TransferDataToWindow().

◆ ResetPanel()

void PANEL_PCBNEW_DISPLAY_ORIGIN::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 82 of file panel_pcbnew_display_origin.cpp.

83{
85 cfg.Load(); // Loading without a file will init to defaults
86
87 loadPCBSettings( &cfg );
88}
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
void loadPCBSettings(PCBNEW_SETTINGS *aCfg)

References JSON_SETTINGS::Load(), and loadPCBSettings().

◆ TransferDataFromWindow()

bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataFromWindow ( )
override

◆ TransferDataToWindow()

bool PANEL_PCBNEW_DISPLAY_ORIGIN::TransferDataToWindow ( )
override

Definition at line 54 of file panel_pcbnew_display_origin.cpp.

55{
56 PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
57
58 loadPCBSettings( cfg );
59
60 return true;
61}

References loadPCBSettings(), and Pgm().

Member Data Documentation

◆ m_DisplayOrigin

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_DisplayOrigin
protectedinherited

◆ m_XAxisDirection

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_XAxisDirection
protectedinherited

◆ m_YAxisDirection

wxRadioBox* PANEL_PCBNEW_DISPLAY_ORIGIN_BASE::m_YAxisDirection
protectedinherited

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