KiCad PCB EDA Suite
PANEL_SYM_EDITING_OPTIONS Class Reference

#include <panel_sym_editing_options.h>

Inheritance diagram for PANEL_SYM_EDITING_OPTIONS:
PANEL_SYM_EDITING_OPTIONS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_SYM_EDITING_OPTIONS (wxWindow *aWindow, EDA_BASE_FRAME *aUnitsProvider)
 
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

wxStaticText * m_lineWidthLabel
 
wxTextCtrl * m_lineWidthCtrl
 
wxStaticText * m_lineWidthUnits
 
wxStaticText * m_widthHelpText
 
wxStaticText * m_textSizeLabel
 
wxTextCtrl * m_textSizeCtrl
 
wxStaticText * m_textSizeUnits
 
wxStaticText * m_pinLengthLabel
 
wxTextCtrl * m_pinLengthCtrl
 
wxStaticText * m_pinLengthUnits
 
wxStaticText * m_pinNumSizeLabel
 
wxTextCtrl * m_pinNumSizeCtrl
 
wxStaticText * m_pinNumSizeUnits
 
wxStaticText * m_pinNameSizeLabel
 
wxTextCtrl * m_pinNameSizeCtrl
 
wxStaticText * m_pinNameSizeUnits
 
wxCheckBox * m_cbShowPinElectricalType
 
wxStaticText * m_pinPitchLabel
 
wxChoice * m_choicePinDisplacement
 
wxStaticText * m_pinPitchUnits
 
wxStaticText * m_labelIncrementLabel1
 
wxSpinCtrl * m_spinRepeatLabel
 

Private Member Functions

void loadSymEditorSettings (SYMBOL_EDITOR_SETTINGS *aCfg)
 

Private Attributes

UNIT_BINDER m_lineWidth
 
UNIT_BINDER m_textSize
 
UNIT_BINDER m_pinLength
 
UNIT_BINDER m_pinNameSize
 
UNIT_BINDER m_pinNumberSize
 

Detailed Description

Definition at line 29 of file panel_sym_editing_options.h.

Constructor & Destructor Documentation

◆ PANEL_SYM_EDITING_OPTIONS()

PANEL_SYM_EDITING_OPTIONS::PANEL_SYM_EDITING_OPTIONS ( wxWindow *  aWindow,
EDA_BASE_FRAME aUnitsProvider 
)

Definition at line 32 of file panel_sym_editing_options.cpp.

33 :
40{
41 m_widthHelpText->SetFont( KIUI::GetInfoFont( this ).Italic() );
42}
PANEL_SYM_EDITING_OPTIONS_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:144

References KIUI::GetInfoFont(), and PANEL_SYM_EDITING_OPTIONS_BASE::m_widthHelpText.

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

◆ loadSymEditorSettings()

void PANEL_SYM_EDITING_OPTIONS::loadSymEditorSettings ( SYMBOL_EDITOR_SETTINGS aCfg)
private

Definition at line 45 of file panel_sym_editing_options.cpp.

46{
47 m_lineWidth.SetValue( Mils2iu( aCfg->m_Defaults.line_width ) );
48 m_textSize.SetValue( Mils2iu( aCfg->m_Defaults.text_size ) );
49 m_pinLength.SetValue( Mils2iu( aCfg->m_Defaults.pin_length ) );
52 m_choicePinDisplacement->SetSelection( aCfg->m_Repeat.pin_step == 50 ? 1 : 0 );
53 m_spinRepeatLabel->SetValue( aCfg->m_Repeat.label_delta );
55}
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.

References SYMBOL_EDITOR_SETTINGS::REPEAT::label_delta, SYMBOL_EDITOR_SETTINGS::DEFAULTS::line_width, PANEL_SYM_EDITING_OPTIONS_BASE::m_cbShowPinElectricalType, PANEL_SYM_EDITING_OPTIONS_BASE::m_choicePinDisplacement, SYMBOL_EDITOR_SETTINGS::m_Defaults, m_lineWidth, m_pinLength, m_pinNameSize, m_pinNumberSize, SYMBOL_EDITOR_SETTINGS::m_Repeat, SYMBOL_EDITOR_SETTINGS::m_ShowPinElectricalType, PANEL_SYM_EDITING_OPTIONS_BASE::m_spinRepeatLabel, m_textSize, SYMBOL_EDITOR_SETTINGS::DEFAULTS::pin_length, SYMBOL_EDITOR_SETTINGS::DEFAULTS::pin_name_size, SYMBOL_EDITOR_SETTINGS::DEFAULTS::pin_num_size, SYMBOL_EDITOR_SETTINGS::REPEAT::pin_step, UNIT_BINDER::SetValue(), and SYMBOL_EDITOR_SETTINGS::DEFAULTS::text_size.

Referenced by ResetPanel(), and TransferDataToWindow().

◆ ResetPanel()

void PANEL_SYM_EDITING_OPTIONS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 87 of file panel_sym_editing_options.cpp.

88{
90 cfg.Load(); // Loading without a file will init to defaults
91
93}
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
void loadSymEditorSettings(SYMBOL_EDITOR_SETTINGS *aCfg)

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

◆ TransferDataFromWindow()

bool PANEL_SYM_EDITING_OPTIONS::TransferDataFromWindow ( )
override

Definition at line 69 of file panel_sym_editing_options.cpp.

70{
71 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
73
74 settings->m_Defaults.line_width = Iu2Mils( (int) m_lineWidth.GetValue() );
75 settings->m_Defaults.text_size = Iu2Mils( (int) m_textSize.GetValue() );
76 settings->m_Defaults.pin_length = Iu2Mils( (int) m_pinLength.GetValue() );
77 settings->m_Defaults.pin_num_size = Iu2Mils( (int) m_pinNumberSize.GetValue() );
78 settings->m_Defaults.pin_name_size = Iu2Mils( (int) m_pinNameSize.GetValue() );
79 settings->m_Repeat.label_delta = m_spinRepeatLabel->GetValue();
80 settings->m_Repeat.pin_step = m_choicePinDisplacement->GetSelection() == 1 ? 50 : 100;
82
83 return true;
84}
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
virtual long long int GetValue()
Return the current value in Internal Units.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References SETTINGS_MANAGER::GetAppSettings(), UNIT_BINDER::GetValue(), SYMBOL_EDITOR_SETTINGS::REPEAT::label_delta, SYMBOL_EDITOR_SETTINGS::DEFAULTS::line_width, PANEL_SYM_EDITING_OPTIONS_BASE::m_cbShowPinElectricalType, PANEL_SYM_EDITING_OPTIONS_BASE::m_choicePinDisplacement, SYMBOL_EDITOR_SETTINGS::m_Defaults, m_lineWidth, m_pinLength, m_pinNameSize, m_pinNumberSize, SYMBOL_EDITOR_SETTINGS::m_Repeat, SYMBOL_EDITOR_SETTINGS::m_ShowPinElectricalType, PANEL_SYM_EDITING_OPTIONS_BASE::m_spinRepeatLabel, m_textSize, Pgm(), SYMBOL_EDITOR_SETTINGS::DEFAULTS::pin_length, SYMBOL_EDITOR_SETTINGS::DEFAULTS::pin_name_size, SYMBOL_EDITOR_SETTINGS::DEFAULTS::pin_num_size, SYMBOL_EDITOR_SETTINGS::REPEAT::pin_step, and SYMBOL_EDITOR_SETTINGS::DEFAULTS::text_size.

◆ TransferDataToWindow()

bool PANEL_SYM_EDITING_OPTIONS::TransferDataToWindow ( )
override

Definition at line 58 of file panel_sym_editing_options.cpp.

59{
60 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
62
63 loadSymEditorSettings( settings );
64
65 return true;
66}

References SETTINGS_MANAGER::GetAppSettings(), loadSymEditorSettings(), and Pgm().

Member Data Documentation

◆ m_cbShowPinElectricalType

wxCheckBox* PANEL_SYM_EDITING_OPTIONS_BASE::m_cbShowPinElectricalType
protectedinherited

◆ m_choicePinDisplacement

wxChoice* PANEL_SYM_EDITING_OPTIONS_BASE::m_choicePinDisplacement
protectedinherited

◆ m_labelIncrementLabel1

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_labelIncrementLabel1
protectedinherited

◆ m_lineWidth

UNIT_BINDER PANEL_SYM_EDITING_OPTIONS::m_lineWidth
private

Definition at line 43 of file panel_sym_editing_options.h.

Referenced by loadSymEditorSettings(), and TransferDataFromWindow().

◆ m_lineWidthCtrl

wxTextCtrl* PANEL_SYM_EDITING_OPTIONS_BASE::m_lineWidthCtrl
protectedinherited

◆ m_lineWidthLabel

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_lineWidthLabel
protectedinherited

◆ m_lineWidthUnits

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_lineWidthUnits
protectedinherited

◆ m_pinLength

UNIT_BINDER PANEL_SYM_EDITING_OPTIONS::m_pinLength
private

Definition at line 46 of file panel_sym_editing_options.h.

Referenced by loadSymEditorSettings(), and TransferDataFromWindow().

◆ m_pinLengthCtrl

wxTextCtrl* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinLengthCtrl
protectedinherited

◆ m_pinLengthLabel

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinLengthLabel
protectedinherited

◆ m_pinLengthUnits

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinLengthUnits
protectedinherited

◆ m_pinNameSize

UNIT_BINDER PANEL_SYM_EDITING_OPTIONS::m_pinNameSize
private

Definition at line 47 of file panel_sym_editing_options.h.

Referenced by loadSymEditorSettings(), and TransferDataFromWindow().

◆ m_pinNameSizeCtrl

wxTextCtrl* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinNameSizeCtrl
protectedinherited

◆ m_pinNameSizeLabel

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinNameSizeLabel
protectedinherited

◆ m_pinNameSizeUnits

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinNameSizeUnits
protectedinherited

◆ m_pinNumberSize

UNIT_BINDER PANEL_SYM_EDITING_OPTIONS::m_pinNumberSize
private

Definition at line 48 of file panel_sym_editing_options.h.

Referenced by loadSymEditorSettings(), and TransferDataFromWindow().

◆ m_pinNumSizeCtrl

wxTextCtrl* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinNumSizeCtrl
protectedinherited

◆ m_pinNumSizeLabel

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinNumSizeLabel
protectedinherited

◆ m_pinNumSizeUnits

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinNumSizeUnits
protectedinherited

◆ m_pinPitchLabel

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinPitchLabel
protectedinherited

◆ m_pinPitchUnits

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_pinPitchUnits
protectedinherited

◆ m_spinRepeatLabel

wxSpinCtrl* PANEL_SYM_EDITING_OPTIONS_BASE::m_spinRepeatLabel
protectedinherited

◆ m_textSize

UNIT_BINDER PANEL_SYM_EDITING_OPTIONS::m_textSize
private

Definition at line 44 of file panel_sym_editing_options.h.

Referenced by loadSymEditorSettings(), and TransferDataFromWindow().

◆ m_textSizeCtrl

wxTextCtrl* PANEL_SYM_EDITING_OPTIONS_BASE::m_textSizeCtrl
protectedinherited

◆ m_textSizeLabel

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_textSizeLabel
protectedinherited

◆ m_textSizeUnits

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_textSizeUnits
protectedinherited

◆ m_widthHelpText

wxStaticText* PANEL_SYM_EDITING_OPTIONS_BASE::m_widthHelpText
protectedinherited

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