KiCad PCB EDA Suite
PANEL_EESCHEMA_EDITING_OPTIONS Class Reference

#include <panel_eeschema_editing_options.h>

Inheritance diagram for PANEL_EESCHEMA_EDITING_OPTIONS:
PANEL_EESCHEMA_EDITING_OPTIONS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_EESCHEMA_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_staticText24
 
wxChoice * m_choiceLineMode
 
wxCheckBox * m_mouseDragIsDrag
 
wxCheckBox * m_cbAutoStartWires
 
wxCheckBox * m_escClearsNetHighlight
 
wxStaticText * m_borderColorLabel
 
COLOR_SWATCHm_borderColorSwatch
 
wxStaticText * m_backgroundColorLabel
 
COLOR_SWATCHm_backgroundColorSwatch
 
wxCheckBox * m_cbPinSelectionOpt
 
wxSimplebook * m_leftClickCmdsBook
 
wxPanel * m_pageWinLin
 
wxStaticText * m_staticText8
 
wxStaticLine * m_staticline1
 
wxStaticText * m_staticText91
 
wxStaticText * m_staticText101
 
wxStaticText * m_staticText131
 
wxStaticText * m_staticText141
 
wxStaticText * m_staticText151
 
wxStaticText * m_staticText161
 
wxPanel * m_pageMac
 
wxStaticText * m_staticText81
 
wxStaticLine * m_staticline2
 
wxStaticText * m_staticText11
 
wxStaticText * m_staticText12
 
wxStaticText * m_staticText9
 
wxStaticText * m_staticText10
 
wxStaticText * m_staticText15
 
wxStaticText * m_staticText16
 
wxStaticText * m_staticText13
 
wxStaticText * m_staticText14
 
wxCheckBox * m_checkAutoplaceFields
 
wxCheckBox * m_checkAutoplaceJustify
 
wxCheckBox * m_checkAutoplaceAlign
 
wxStaticText * m_hPitchLabel
 
wxTextCtrl * m_hPitchCtrl
 
wxStaticText * m_hPitchUnits
 
wxStaticText * m_vPitchLabel
 
wxTextCtrl * m_vPitchCtrl
 
wxStaticText * m_vPitchUnits
 
wxStaticText * m_labelIncrementLabel
 
wxSpinCtrl * m_spinLabelRepeatStep
 
wxCheckBox * m_footprintPreview
 

Private Member Functions

void loadEEschemaSettings (EESCHEMA_SETTINGS *aCfg)
 

Private Attributes

UNIT_BINDER m_hPitch
 
UNIT_BINDER m_vPitch
 

Detailed Description

Definition at line 29 of file panel_eeschema_editing_options.h.

Constructor & Destructor Documentation

◆ PANEL_EESCHEMA_EDITING_OPTIONS()

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

Definition at line 32 of file panel_eeschema_editing_options.cpp.

33 :
37{
38 // Make the color swatch show "Clear Color" instead
39 m_borderColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
40 m_backgroundColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
41
42 m_spinLabelRepeatStep->SetRange( -100000, 100000 );
43#if wxCHECK_VERSION( 3, 1, 6 )
44 m_spinLabelRepeatStep->SetIncrement( 1 );
45#endif
46
47#ifdef __WXOSX_MAC__
48 m_leftClickCmdsBook->SetSelection( 1 );
49#else
50 m_leftClickCmdsBook->SetSelection( 0 );
51#endif
52}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
void SetDefaultColor(const KIGFX::COLOR4D &aColor)
Sets the color that will be chosen with the "Reset to Default" button in the chooser.
PANEL_EESCHEMA_EDITING_OPTIONS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(652, 466), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

References PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_backgroundColorSwatch, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_borderColorSwatch, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_leftClickCmdsBook, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_spinLabelRepeatStep, and COLOR_SWATCH::SetDefaultColor().

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

◆ loadEEschemaSettings()

void PANEL_EESCHEMA_EDITING_OPTIONS::loadEEschemaSettings ( EESCHEMA_SETTINGS aCfg)
private

Definition at line 55 of file panel_eeschema_editing_options.cpp.

56{
60
61 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
62 COLOR_SETTINGS* settings = mgr.GetColorSettings();
63 COLOR4D schematicBackground = settings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
64
65 m_borderColorSwatch->SetSwatchBackground( schematicBackground );
67
68 m_backgroundColorSwatch->SetSwatchBackground( schematicBackground );
70
71 m_choiceLineMode->SetSelection( aCfg->m_Drawing.line_mode );
73
77
78 m_mouseDragIsDrag->SetValue( !aCfg->m_Input.drag_is_move );
80
83}
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
void SetSwatchColor(const KIGFX::COLOR4D &aColor, bool aSendEvent)
Set the current swatch color directly.
void SetSwatchBackground(const KIGFX::COLOR4D &aBackground)
Set the swatch background color.
AUTOPLACE_FIELDS m_AutoplaceFields
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:376
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94

References EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::align_to_grid, EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::allow_rejustify, EESCHEMA_SETTINGS::DRAWING::auto_start_wires, EESCHEMA_SETTINGS::DRAWING::default_repeat_offset_x, EESCHEMA_SETTINGS::DRAWING::default_repeat_offset_y, EESCHEMA_SETTINGS::DRAWING::default_sheet_background_color, EESCHEMA_SETTINGS::DRAWING::default_sheet_border_color, EESCHEMA_SETTINGS::INPUT::drag_is_move, EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, EESCHEMA_SETTINGS::INPUT::esc_clears_net_highlight, EESCHEMA_SETTINGS::APPEARANCE::footprint_preview, COLOR_SETTINGS::GetColor(), SETTINGS_MANAGER::GetColorSettings(), LAYER_SCHEMATIC_BACKGROUND, EESCHEMA_SETTINGS::DRAWING::line_mode, EESCHEMA_SETTINGS::m_Appearance, EESCHEMA_SETTINGS::m_AutoplaceFields, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_backgroundColorSwatch, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_borderColorSwatch, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_cbAutoStartWires, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_cbPinSelectionOpt, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceAlign, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceFields, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceJustify, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_choiceLineMode, EESCHEMA_SETTINGS::m_Drawing, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_escClearsNetHighlight, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_footprintPreview, m_hPitch, EESCHEMA_SETTINGS::m_Input, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_mouseDragIsDrag, EESCHEMA_SETTINGS::m_Selection, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_spinLabelRepeatStep, m_vPitch, EDA_IU_SCALE::MilsToIU(), Pgm(), EESCHEMA_SETTINGS::DRAWING::repeat_label_increment, schIUScale, EESCHEMA_SETTINGS::SELECTION::select_pin_selects_symbol, COLOR_SWATCH::SetSwatchBackground(), COLOR_SWATCH::SetSwatchColor(), and UNIT_BINDER::SetValue().

Referenced by ResetPanel(), and TransferDataToWindow().

◆ ResetPanel()

void PANEL_EESCHEMA_EDITING_OPTIONS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 126 of file panel_eeschema_editing_options.cpp.

127{
129 cfg.Load(); // Loading without a file will init to defaults
130
131 loadEEschemaSettings( &cfg );
132}
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
void loadEEschemaSettings(EESCHEMA_SETTINGS *aCfg)

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

◆ TransferDataFromWindow()

bool PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataFromWindow ( )
override

Definition at line 97 of file panel_eeschema_editing_options.cpp.

98{
99 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
101
104
108
109 cfg->m_Drawing.line_mode = m_choiceLineMode->GetSelection();
111
115
116 cfg->m_Input.drag_is_move = !m_mouseDragIsDrag->GetValue();
118
121
122 return true;
123}
KIGFX::COLOR4D GetSwatchColor() const
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.
constexpr int IUToMils(int iu) const
Definition: base_units.h:100

References EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::align_to_grid, EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::allow_rejustify, EESCHEMA_SETTINGS::DRAWING::auto_start_wires, EESCHEMA_SETTINGS::DRAWING::default_repeat_offset_x, EESCHEMA_SETTINGS::DRAWING::default_repeat_offset_y, EESCHEMA_SETTINGS::DRAWING::default_sheet_background_color, EESCHEMA_SETTINGS::DRAWING::default_sheet_border_color, EESCHEMA_SETTINGS::INPUT::drag_is_move, EESCHEMA_SETTINGS::AUTOPLACE_FIELDS::enable, EESCHEMA_SETTINGS::INPUT::esc_clears_net_highlight, EESCHEMA_SETTINGS::APPEARANCE::footprint_preview, SETTINGS_MANAGER::GetAppSettings(), COLOR_SWATCH::GetSwatchColor(), UNIT_BINDER::GetValue(), EDA_IU_SCALE::IUToMils(), EESCHEMA_SETTINGS::DRAWING::line_mode, EESCHEMA_SETTINGS::m_Appearance, EESCHEMA_SETTINGS::m_AutoplaceFields, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_backgroundColorSwatch, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_borderColorSwatch, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_cbAutoStartWires, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_cbPinSelectionOpt, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceAlign, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceFields, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceJustify, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_choiceLineMode, EESCHEMA_SETTINGS::m_Drawing, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_escClearsNetHighlight, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_footprintPreview, m_hPitch, EESCHEMA_SETTINGS::m_Input, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_mouseDragIsDrag, EESCHEMA_SETTINGS::m_Selection, PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_spinLabelRepeatStep, m_vPitch, Pgm(), EESCHEMA_SETTINGS::DRAWING::repeat_label_increment, schIUScale, and EESCHEMA_SETTINGS::SELECTION::select_pin_selects_symbol.

◆ TransferDataToWindow()

bool PANEL_EESCHEMA_EDITING_OPTIONS::TransferDataToWindow ( )
override

Definition at line 86 of file panel_eeschema_editing_options.cpp.

87{
88 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
90
92
93 return true;
94}

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

Member Data Documentation

◆ m_backgroundColorLabel

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_backgroundColorLabel
protectedinherited

◆ m_backgroundColorSwatch

COLOR_SWATCH* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_backgroundColorSwatch
protectedinherited

◆ m_borderColorLabel

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_borderColorLabel
protectedinherited

◆ m_borderColorSwatch

◆ m_cbAutoStartWires

wxCheckBox* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_cbAutoStartWires
protectedinherited

◆ m_cbPinSelectionOpt

wxCheckBox* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_cbPinSelectionOpt
protectedinherited

◆ m_checkAutoplaceAlign

wxCheckBox* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceAlign
protectedinherited

◆ m_checkAutoplaceFields

wxCheckBox* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceFields
protectedinherited

◆ m_checkAutoplaceJustify

wxCheckBox* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_checkAutoplaceJustify
protectedinherited

◆ m_choiceLineMode

wxChoice* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_choiceLineMode
protectedinherited

◆ m_escClearsNetHighlight

wxCheckBox* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_escClearsNetHighlight
protectedinherited

◆ m_footprintPreview

wxCheckBox* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_footprintPreview
protectedinherited

◆ m_hPitch

UNIT_BINDER PANEL_EESCHEMA_EDITING_OPTIONS::m_hPitch
private

◆ m_hPitchCtrl

wxTextCtrl* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_hPitchCtrl
protectedinherited

◆ m_hPitchLabel

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_hPitchLabel
protectedinherited

◆ m_hPitchUnits

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_hPitchUnits
protectedinherited

◆ m_labelIncrementLabel

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_labelIncrementLabel
protectedinherited

◆ m_leftClickCmdsBook

wxSimplebook* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_leftClickCmdsBook
protectedinherited

◆ m_mouseDragIsDrag

wxCheckBox* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_mouseDragIsDrag
protectedinherited

◆ m_pageMac

wxPanel* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_pageMac
protectedinherited

◆ m_pageWinLin

wxPanel* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_pageWinLin
protectedinherited

◆ m_spinLabelRepeatStep

wxSpinCtrl* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_spinLabelRepeatStep
protectedinherited

◆ m_staticline1

wxStaticLine* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticline1
protectedinherited

◆ m_staticline2

wxStaticLine* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticline2
protectedinherited

◆ m_staticText10

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText10
protectedinherited

◆ m_staticText101

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText101
protectedinherited

◆ m_staticText11

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText11
protectedinherited

◆ m_staticText12

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText12
protectedinherited

◆ m_staticText13

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText13
protectedinherited

◆ m_staticText131

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText131
protectedinherited

◆ m_staticText14

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText14
protectedinherited

◆ m_staticText141

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText141
protectedinherited

◆ m_staticText15

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText15
protectedinherited

◆ m_staticText151

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText151
protectedinherited

◆ m_staticText16

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText16
protectedinherited

◆ m_staticText161

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText161
protectedinherited

◆ m_staticText24

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText24
protectedinherited

◆ m_staticText8

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText8
protectedinherited

◆ m_staticText81

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText81
protectedinherited

◆ m_staticText9

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText9
protectedinherited

◆ m_staticText91

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_staticText91
protectedinherited

◆ m_vPitch

UNIT_BINDER PANEL_EESCHEMA_EDITING_OPTIONS::m_vPitch
private

◆ m_vPitchCtrl

wxTextCtrl* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_vPitchCtrl
protectedinherited

◆ m_vPitchLabel

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_vPitchLabel
protectedinherited

◆ m_vPitchUnits

wxStaticText* PANEL_EESCHEMA_EDITING_OPTIONS_BASE::m_vPitchUnits
protectedinherited

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