KiCad PCB EDA Suite
PANEL_GERBVIEW_EXCELLON_SETTINGS Class Reference

#include <panel_gerbview_excellon_settings.h>

Inheritance diagram for PANEL_GERBVIEW_EXCELLON_SETTINGS:
PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_GERBVIEW_EXCELLON_SETTINGS (wxWindow *aParent)
 
 ~PANEL_GERBVIEW_EXCELLON_SETTINGS ()
 
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 Member Functions

virtual void onUnitsChange (wxCommandEvent &event)
 

Protected Attributes

wxStaticText * m_staticText11
 
wxRadioBox * m_rbUnits
 
wxRadioBox * m_rbZeroFormat
 
wxStaticLine * m_staticline1
 
wxStaticText * m_staticText6
 
wxStaticText * m_staticText10
 
wxStaticText * m_staticText7
 
wxStaticText * m_staticTextUnitsmm
 
wxChoice * m_choiceIntegerMM
 
wxStaticText * m_staticText8
 
wxChoice * m_choiceMantissaMM
 
wxStaticText * m_staticTextUnitsInch
 
wxChoice * m_choiceIntegerInch
 
wxStaticText * m_staticText9
 
wxChoice * m_choiceMantissaInch
 

Private Member Functions

bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
void ResetPanel () override
 Reset the contents of this panel. More...
 
void applySettingsToPanel (const EXCELLON_DEFAULTS &aSettings)
 

Detailed Description

Definition at line 32 of file panel_gerbview_excellon_settings.h.

Constructor & Destructor Documentation

◆ PANEL_GERBVIEW_EXCELLON_SETTINGS()

PANEL_GERBVIEW_EXCELLON_SETTINGS::PANEL_GERBVIEW_EXCELLON_SETTINGS ( wxWindow *  aParent)

Definition at line 28 of file panel_gerbview_excellon_settings.cpp.

28 :
29 PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE( aParent, wxID_ANY )
30{
31}
PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(440, 336), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

◆ ~PANEL_GERBVIEW_EXCELLON_SETTINGS()

PANEL_GERBVIEW_EXCELLON_SETTINGS::~PANEL_GERBVIEW_EXCELLON_SETTINGS ( )
inline

Definition at line 36 of file panel_gerbview_excellon_settings.h.

36{};

Member Function Documentation

◆ applySettingsToPanel()

void PANEL_GERBVIEW_EXCELLON_SETTINGS::applySettingsToPanel ( const EXCELLON_DEFAULTS aSettings)
private

Definition at line 70 of file panel_gerbview_excellon_settings.cpp.

71{
72 m_rbUnits->SetSelection( aSettings.m_UnitsMM ? 1 : 0 );
73 m_rbZeroFormat->SetSelection( aSettings.m_LeadingZero );
74
75 // The first value of these param is 2, not 0
76 #define FIRST_VALUE 2
77 m_choiceIntegerMM->SetSelection( aSettings.m_MmIntegerLen-FIRST_VALUE );
78 m_choiceMantissaMM->SetSelection( aSettings.m_MmMantissaLen-FIRST_VALUE );
79 m_choiceIntegerInch->SetSelection( aSettings.m_InchIntegerLen-FIRST_VALUE );
80 m_choiceMantissaInch->SetSelection( aSettings.m_InchMantissaLen-FIRST_VALUE );
81}
#define FIRST_VALUE

References FIRST_VALUE, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceIntegerInch, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceIntegerMM, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceMantissaInch, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceMantissaMM, EXCELLON_DEFAULTS::m_InchIntegerLen, EXCELLON_DEFAULTS::m_InchMantissaLen, EXCELLON_DEFAULTS::m_LeadingZero, EXCELLON_DEFAULTS::m_MmIntegerLen, EXCELLON_DEFAULTS::m_MmMantissaLen, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_rbUnits, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_rbZeroFormat, and EXCELLON_DEFAULTS::m_UnitsMM.

Referenced by ResetPanel(), and TransferDataToWindow().

◆ 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().

◆ onUnitsChange()

virtual void PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::onUnitsChange ( wxCommandEvent &  event)
inlineprotectedvirtualinherited

◆ ResetPanel()

void PANEL_GERBVIEW_EXCELLON_SETTINGS::ResetPanel ( )
overrideprivatevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 63 of file panel_gerbview_excellon_settings.cpp.

64{
65 EXCELLON_DEFAULTS defaults;
66 applySettingsToPanel( defaults );
67}
void applySettingsToPanel(const EXCELLON_DEFAULTS &aSettings)
management of default values used to read a Excellon (.nc) drill file Some important parameters are n...

References applySettingsToPanel().

◆ TransferDataFromWindow()

bool PANEL_GERBVIEW_EXCELLON_SETTINGS::TransferDataFromWindow ( )
overrideprivate

Definition at line 46 of file panel_gerbview_excellon_settings.cpp.

47{
48 GERBVIEW_SETTINGS* config = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
49
50 config->m_ExcellonDefaults.m_UnitsMM = m_rbUnits->GetSelection() != 0;
51 config->m_ExcellonDefaults.m_LeadingZero = m_rbZeroFormat->GetSelection();
52 // The first value of these param is 2, not 0
53 #define FIRST_VALUE 2
54 config->m_ExcellonDefaults.m_MmIntegerLen = m_choiceIntegerMM->GetSelection()+FIRST_VALUE;
55 config->m_ExcellonDefaults.m_MmMantissaLen = m_choiceMantissaMM->GetSelection()+FIRST_VALUE;
56 config->m_ExcellonDefaults.m_InchIntegerLen = m_choiceIntegerInch->GetSelection()+FIRST_VALUE;
57 config->m_ExcellonDefaults.m_InchMantissaLen = m_choiceMantissaInch->GetSelection()+FIRST_VALUE;
58
59 return true;
60}
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References config, FIRST_VALUE, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceIntegerInch, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceIntegerMM, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceMantissaInch, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceMantissaMM, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_rbUnits, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_rbZeroFormat, and Pgm().

◆ TransferDataToWindow()

bool PANEL_GERBVIEW_EXCELLON_SETTINGS::TransferDataToWindow ( )
overrideprivate

Definition at line 34 of file panel_gerbview_excellon_settings.cpp.

35{
36 GERBVIEW_SETTINGS* config = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
37 EXCELLON_DEFAULTS curr_settings;
38 config->GetExcellonDefaults( curr_settings );
39
40 applySettingsToPanel( curr_settings );
41
42 return true;
43}

References applySettingsToPanel(), config, and Pgm().

Member Data Documentation

◆ m_choiceIntegerInch

◆ m_choiceIntegerMM

◆ m_choiceMantissaInch

wxChoice* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceMantissaInch
protectedinherited

◆ m_choiceMantissaMM

wxChoice* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_choiceMantissaMM
protectedinherited

◆ m_rbUnits

wxRadioBox* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_rbUnits
protectedinherited

◆ m_rbZeroFormat

wxRadioBox* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_rbZeroFormat
protectedinherited

◆ m_staticline1

wxStaticLine* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticline1
protectedinherited

◆ m_staticText10

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticText10
protectedinherited

◆ m_staticText11

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticText11
protectedinherited

◆ m_staticText6

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticText6
protectedinherited

◆ m_staticText7

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticText7
protectedinherited

◆ m_staticText8

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticText8
protectedinherited

◆ m_staticText9

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticText9
protectedinherited

◆ m_staticTextUnitsInch

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticTextUnitsInch
protectedinherited

◆ m_staticTextUnitsmm

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticTextUnitsmm
protectedinherited

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