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_fileFormatLabel
 
wxStaticLine * m_staticline1
 
wxStaticText * m_fileFormatHelp
 
wxRadioBox * m_rbUnits
 
wxRadioBox * m_rbZeroFormat
 
wxStaticText * m_coordinatesLabel
 
wxStaticLine * m_staticline2
 
wxStaticText * m_coordsFormatHelp
 
wxStaticText * m_hint1
 
wxStaticText * m_staticTextUnitsmm
 
wxChoice * m_choiceIntegerMM
 
wxStaticText * m_staticText8
 
wxChoice * m_choiceMantissaMM
 
wxStaticText * m_staticTextUnitsInch
 
wxChoice * m_choiceIntegerInch
 
wxStaticText * m_staticText9
 
wxChoice * m_choiceMantissaInch
 
wxStaticText * m_hint2
 

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 29 of file panel_gerbview_excellon_settings.cpp.

29 :
30 PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE( aParent, wxID_ANY )
31{
32 wxFont helpFont = KIUI::GetInfoFont( this ).Italic();
33 m_fileFormatHelp->SetFont( helpFont );
34 m_coordsFormatHelp->SetFont( helpFont );
35 m_hint1->SetFont( helpFont );
36 m_hint2->SetFont( helpFont );
37}
PANEL_GERBVIEW_EXCELLON_SETTINGS_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)
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:156

References KIUI::GetInfoFont(), PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_coordsFormatHelp, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_fileFormatHelp, PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_hint1, and PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_hint2.

◆ ~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 76 of file panel_gerbview_excellon_settings.cpp.

77{
78 m_rbUnits->SetSelection( aSettings.m_UnitsMM ? 1 : 0 );
79 m_rbZeroFormat->SetSelection( aSettings.m_LeadingZero );
80
81 // The first value of these param is 2, not 0
82 #define FIRST_VALUE 2
83 m_choiceIntegerMM->SetSelection( aSettings.m_MmIntegerLen-FIRST_VALUE );
84 m_choiceMantissaMM->SetSelection( aSettings.m_MmMantissaLen-FIRST_VALUE );
85 m_choiceIntegerInch->SetSelection( aSettings.m_InchIntegerLen-FIRST_VALUE );
86 m_choiceMantissaInch->SetSelection( aSettings.m_InchMantissaLen-FIRST_VALUE );
87}
#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 69 of file panel_gerbview_excellon_settings.cpp.

70{
71 EXCELLON_DEFAULTS defaults;
72 applySettingsToPanel( defaults );
73}
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 52 of file panel_gerbview_excellon_settings.cpp.

53{
54 GERBVIEW_SETTINGS* config = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
55
56 config->m_ExcellonDefaults.m_UnitsMM = m_rbUnits->GetSelection() != 0;
57 config->m_ExcellonDefaults.m_LeadingZero = m_rbZeroFormat->GetSelection();
58 // The first value of these param is 2, not 0
59 #define FIRST_VALUE 2
60 config->m_ExcellonDefaults.m_MmIntegerLen = m_choiceIntegerMM->GetSelection()+FIRST_VALUE;
61 config->m_ExcellonDefaults.m_MmMantissaLen = m_choiceMantissaMM->GetSelection()+FIRST_VALUE;
62 config->m_ExcellonDefaults.m_InchIntegerLen = m_choiceIntegerInch->GetSelection()+FIRST_VALUE;
63 config->m_ExcellonDefaults.m_InchMantissaLen = m_choiceMantissaInch->GetSelection()+FIRST_VALUE;
64
65 return true;
66}
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 40 of file panel_gerbview_excellon_settings.cpp.

41{
42 GERBVIEW_SETTINGS* config = Pgm().GetSettingsManager().GetAppSettings<GERBVIEW_SETTINGS>();
43 EXCELLON_DEFAULTS curr_settings;
44 config->GetExcellonDefaults( curr_settings );
45
46 applySettingsToPanel( curr_settings );
47
48 return true;
49}

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_coordinatesLabel

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_coordinatesLabel
protectedinherited

◆ m_coordsFormatHelp

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_coordsFormatHelp
protectedinherited

◆ m_fileFormatHelp

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_fileFormatHelp
protectedinherited

◆ m_fileFormatLabel

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_fileFormatLabel
protectedinherited

◆ m_hint1

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_hint1
protectedinherited

◆ m_hint2

wxStaticText* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_hint2
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_staticline2

wxStaticLine* PANEL_GERBVIEW_EXCELLON_SETTINGS_BASE::m_staticline2
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: