KiCad PCB EDA Suite
PANEL_EDIT_OPTIONS Class Reference

#include <panel_edit_options.h>

Inheritance diagram for PANEL_EDIT_OPTIONS:
PANEL_EDIT_OPTIONS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_EDIT_OPTIONS (wxWindow *aParent, EDA_BASE_FRAME *aUnitsProvider, bool isFootprintEditor)
 
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

wxCheckBox * m_magneticPads
 
wxCheckBox * m_magneticGraphics
 
wxCheckBox * m_flipLeftRight
 
wxStaticText * m_rotationAngleLabel
 
wxTextCtrl * m_rotationAngleCtrl
 
wxStaticText * m_rotationAngleUnits
 
wxCheckBox * m_allowFreePads
 
wxCheckBox * m_escClearsNetHighlight
 
wxStaticBoxSizer * m_mouseCmdsWinLin
 
wxStaticText * m_staticText181
 
wxRadioBox * m_rbCtrlClickAction
 
wxStaticBoxSizer * m_mouseCmdsOSX
 
wxStaticText * m_staticText1811
 
wxRadioBox * m_rbCtrlClickActionMac
 
wxSimplebook * m_optionsBook
 
wxCheckBox * m_cbFpGraphic45Mode
 
wxStaticText * m_staticText2
 
wxChoice * m_magneticPadChoice
 
wxStaticText * m_staticText21
 
wxChoice * m_magneticTrackChoice
 
wxStaticText * m_staticText211
 
wxChoice * m_magneticGraphicsChoice
 
wxCheckBox * m_showSelectedRatsnest
 
wxCheckBox * m_OptDisplayCurvedRatsnestLines
 
wxStaticText * m_staticText5
 
wxRadioButton * m_rbTrackDragMove
 
wxRadioButton * m_rbTrackDrag45
 
wxRadioButton * m_rbTrackDragFree
 
wxCheckBox * m_cbPcbGraphic45Mode
 
wxCheckBox * m_showPageLimits
 
wxCheckBox * m_autoRefillZones
 

Private Member Functions

void loadFPSettings (FOOTPRINT_EDITOR_SETTINGS *aCfg)
 
void loadPCBSettings (PCBNEW_SETTINGS *aCfg)
 

Private Attributes

bool m_isFootprintEditor
 
UNIT_BINDER m_rotationAngle
 

Detailed Description

Definition at line 37 of file panel_edit_options.h.

Constructor & Destructor Documentation

◆ PANEL_EDIT_OPTIONS()

PANEL_EDIT_OPTIONS::PANEL_EDIT_OPTIONS ( wxWindow *  aParent,
EDA_BASE_FRAME aUnitsProvider,
bool  isFootprintEditor 
)

Definition at line 33 of file panel_edit_options.cpp.

34 :
35 PANEL_EDIT_OPTIONS_BASE( aParent ),
36 m_isFootprintEditor( isFootprintEditor ),
39{
44
46
47#ifdef __WXOSX_MAC__
48 m_mouseCmdsOSX->Show( true );
49 m_mouseCmdsWinLin->Show( false );
50 // Disable highlight net option for footprint editor
52#else
53 m_mouseCmdsWinLin->Show( true );
54 m_mouseCmdsOSX->Show( false );
55 // Disable highlight net option for footprint editor
57#endif
58
59 m_optionsBook->SetSelection( isFootprintEditor ? 0 : 1 );
60}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
wxStaticBoxSizer * m_mouseCmdsWinLin
PANEL_EDIT_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)
wxStaticBoxSizer * m_mouseCmdsOSX
UNIT_BINDER m_rotationAngle
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...

References DEGREES, PANEL_EDIT_OPTIONS_BASE::m_allowFreePads, PANEL_EDIT_OPTIONS_BASE::m_flipLeftRight, m_isFootprintEditor, PANEL_EDIT_OPTIONS_BASE::m_magneticGraphics, PANEL_EDIT_OPTIONS_BASE::m_magneticPads, PANEL_EDIT_OPTIONS_BASE::m_mouseCmdsOSX, PANEL_EDIT_OPTIONS_BASE::m_mouseCmdsWinLin, PANEL_EDIT_OPTIONS_BASE::m_optionsBook, PANEL_EDIT_OPTIONS_BASE::m_rbCtrlClickAction, PANEL_EDIT_OPTIONS_BASE::m_rbCtrlClickActionMac, m_rotationAngle, and UNIT_BINDER::SetUnits().

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

◆ loadFPSettings()

void PANEL_EDIT_OPTIONS::loadFPSettings ( FOOTPRINT_EDITOR_SETTINGS aCfg)
private

Definition at line 97 of file panel_edit_options.cpp.

References CAPTURE_ALWAYS, MAGNETIC_SETTINGS::graphics, PANEL_EDIT_OPTIONS_BASE::m_cbFpGraphic45Mode, PANEL_EDIT_OPTIONS_BASE::m_magneticGraphics, FOOTPRINT_EDITOR_SETTINGS::m_MagneticItems, PANEL_EDIT_OPTIONS_BASE::m_magneticPads, FOOTPRINT_EDITOR_SETTINGS::m_RotationAngle, m_rotationAngle, FOOTPRINT_EDITOR_SETTINGS::m_Use45Limit, MAGNETIC_SETTINGS::pads, and UNIT_BINDER::SetAngleValue().

Referenced by ResetPanel(), and TransferDataToWindow().

◆ loadPCBSettings()

void PANEL_EDIT_OPTIONS::loadPCBSettings ( PCBNEW_SETTINGS aCfg)
private

Definition at line 63 of file panel_edit_options.cpp.

64{
66 m_magneticPadChoice->SetSelection( static_cast<int>( aCfg->m_MagneticItems.pads ) );
67 m_magneticTrackChoice->SetSelection( static_cast<int>( aCfg->m_MagneticItems.tracks ) );
69 m_flipLeftRight->SetValue( aCfg->m_FlipLeftRight );
71
72 /* Set display options */
75
76 switch( aCfg->m_TrackDragAction )
77 {
78 case TRACK_DRAG_ACTION::MOVE: m_rbTrackDragMove->SetValue( true ); break;
79 case TRACK_DRAG_ACTION::DRAG: m_rbTrackDrag45->SetValue( true ); break;
80 case TRACK_DRAG_ACTION::DRAG_FREE_ANGLE: m_rbTrackDragFree->SetValue( true ); break;
81 }
82
83#ifdef __WXOSX_MAC__
84 m_rbCtrlClickActionMac->SetSelection( aCfg->m_CtrlClickHighlight );
85#else
86 m_rbCtrlClickAction->SetSelection( aCfg->m_CtrlClickHighlight );
87#endif
88
89 m_showPageLimits->SetValue( aCfg->m_ShowPageLimits );
90 m_autoRefillZones->SetValue( aCfg->m_AutoRefillZones );
91 m_allowFreePads->SetValue( aCfg->m_AllowFreePads );
92
94}
wxCheckBox * m_OptDisplayCurvedRatsnestLines
DISPLAY_OPTIONS m_Display
EDA_ANGLE m_RotationAngle
TRACK_DRAG_ACTION m_TrackDragAction
MAGNETIC_SETTINGS m_MagneticItems
MAGNETIC_OPTIONS tracks

References DRAG, DRAG_FREE_ANGLE, MAGNETIC_SETTINGS::graphics, PANEL_EDIT_OPTIONS_BASE::m_allowFreePads, PCBNEW_SETTINGS::m_AllowFreePads, PANEL_EDIT_OPTIONS_BASE::m_autoRefillZones, PCBNEW_SETTINGS::m_AutoRefillZones, PANEL_EDIT_OPTIONS_BASE::m_cbPcbGraphic45Mode, PCBNEW_SETTINGS::m_CtrlClickHighlight, PCBNEW_SETTINGS::m_Display, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayRatsnestLinesCurved, PANEL_EDIT_OPTIONS_BASE::m_escClearsNetHighlight, PCBNEW_SETTINGS::m_ESCClearsNetHighlight, PANEL_EDIT_OPTIONS_BASE::m_flipLeftRight, PCBNEW_SETTINGS::m_FlipLeftRight, PANEL_EDIT_OPTIONS_BASE::m_magneticGraphicsChoice, PCBNEW_SETTINGS::m_MagneticItems, PANEL_EDIT_OPTIONS_BASE::m_magneticPadChoice, PANEL_EDIT_OPTIONS_BASE::m_magneticTrackChoice, PANEL_EDIT_OPTIONS_BASE::m_OptDisplayCurvedRatsnestLines, PANEL_EDIT_OPTIONS_BASE::m_rbCtrlClickAction, PANEL_EDIT_OPTIONS_BASE::m_rbCtrlClickActionMac, PANEL_EDIT_OPTIONS_BASE::m_rbTrackDrag45, PANEL_EDIT_OPTIONS_BASE::m_rbTrackDragFree, PANEL_EDIT_OPTIONS_BASE::m_rbTrackDragMove, m_rotationAngle, PCBNEW_SETTINGS::m_RotationAngle, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_ShowModuleRatsnest, PANEL_EDIT_OPTIONS_BASE::m_showPageLimits, PCBNEW_SETTINGS::m_ShowPageLimits, PANEL_EDIT_OPTIONS_BASE::m_showSelectedRatsnest, PCBNEW_SETTINGS::m_TrackDragAction, PCBNEW_SETTINGS::m_Use45DegreeLimit, MOVE, MAGNETIC_SETTINGS::pads, UNIT_BINDER::SetAngleValue(), and MAGNETIC_SETTINGS::tracks.

Referenced by ResetPanel(), and TransferDataToWindow().

◆ ResetPanel()

void PANEL_EDIT_OPTIONS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 182 of file panel_edit_options.cpp.

183{
185 {
187 cfg.Load(); // Loading without a file will init to defaults
188
189 loadFPSettings( &cfg );
190 }
191 else
192 {
193 PCBNEW_SETTINGS cfg;
194 cfg.Load(); // Loading without a file will init to defaults
195
196 loadPCBSettings( &cfg );
197 }
198}
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
void loadFPSettings(FOOTPRINT_EDITOR_SETTINGS *aCfg)
void loadPCBSettings(PCBNEW_SETTINGS *aCfg)

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

◆ TransferDataFromWindow()

bool PANEL_EDIT_OPTIONS::TransferDataFromWindow ( )
override

Definition at line 127 of file panel_edit_options.cpp.

128{
129 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
130
132 {
134
136
140
141 cfg->m_Use45Limit = m_cbFpGraphic45Mode->GetValue();
142 }
143 else
144 {
146
149
151
152 cfg->m_MagneticItems.pads = static_cast<MAGNETIC_OPTIONS>( m_magneticPadChoice->GetSelection() );
153 cfg->m_MagneticItems.tracks = static_cast<MAGNETIC_OPTIONS>( m_magneticTrackChoice->GetSelection() );
154 cfg->m_MagneticItems.graphics = !m_magneticGraphicsChoice->GetSelection();
155
156 cfg->m_FlipLeftRight = m_flipLeftRight->GetValue();
158 cfg->m_AutoRefillZones = m_autoRefillZones->GetValue();
159 cfg->m_AllowFreePads = m_allowFreePads->GetValue();
160 cfg->m_ShowPageLimits = m_showPageLimits->GetValue();
161
162 if( m_rbTrackDragMove->GetValue() )
164 else if( m_rbTrackDrag45->GetValue() )
166 else if( m_rbTrackDragFree->GetValue() )
168
169#ifdef __WXOSX_MAC__
170 cfg->m_CtrlClickHighlight = m_rbCtrlClickActionMac->GetSelection();
171#else
172 cfg->m_CtrlClickHighlight = m_rbCtrlClickAction->GetSelection();
173#endif
174
175 cfg->m_Use45DegreeLimit = m_cbPcbGraphic45Mode->GetValue();
176 }
177
178 return true;
179}
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
virtual EDA_ANGLE GetAngleValue()
MAGNETIC_OPTIONS
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References CAPTURE_ALWAYS, DRAG, DRAG_FREE_ANGLE, UNIT_BINDER::GetAngleValue(), SETTINGS_MANAGER::GetAppSettings(), MAGNETIC_SETTINGS::graphics, PANEL_EDIT_OPTIONS_BASE::m_allowFreePads, PCBNEW_SETTINGS::m_AllowFreePads, PANEL_EDIT_OPTIONS_BASE::m_autoRefillZones, PCBNEW_SETTINGS::m_AutoRefillZones, PANEL_EDIT_OPTIONS_BASE::m_cbFpGraphic45Mode, PANEL_EDIT_OPTIONS_BASE::m_cbPcbGraphic45Mode, PCBNEW_SETTINGS::m_CtrlClickHighlight, PCBNEW_SETTINGS::m_Display, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_DisplayRatsnestLinesCurved, PANEL_EDIT_OPTIONS_BASE::m_escClearsNetHighlight, PCBNEW_SETTINGS::m_ESCClearsNetHighlight, PANEL_EDIT_OPTIONS_BASE::m_flipLeftRight, PCBNEW_SETTINGS::m_FlipLeftRight, m_isFootprintEditor, PANEL_EDIT_OPTIONS_BASE::m_magneticGraphics, PANEL_EDIT_OPTIONS_BASE::m_magneticGraphicsChoice, FOOTPRINT_EDITOR_SETTINGS::m_MagneticItems, PCBNEW_SETTINGS::m_MagneticItems, PANEL_EDIT_OPTIONS_BASE::m_magneticPadChoice, PANEL_EDIT_OPTIONS_BASE::m_magneticPads, PANEL_EDIT_OPTIONS_BASE::m_magneticTrackChoice, PANEL_EDIT_OPTIONS_BASE::m_OptDisplayCurvedRatsnestLines, PANEL_EDIT_OPTIONS_BASE::m_rbCtrlClickAction, PANEL_EDIT_OPTIONS_BASE::m_rbCtrlClickActionMac, PANEL_EDIT_OPTIONS_BASE::m_rbTrackDrag45, PANEL_EDIT_OPTIONS_BASE::m_rbTrackDragFree, PANEL_EDIT_OPTIONS_BASE::m_rbTrackDragMove, FOOTPRINT_EDITOR_SETTINGS::m_RotationAngle, m_rotationAngle, PCBNEW_SETTINGS::m_RotationAngle, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_ShowModuleRatsnest, PANEL_EDIT_OPTIONS_BASE::m_showPageLimits, PCBNEW_SETTINGS::m_ShowPageLimits, PANEL_EDIT_OPTIONS_BASE::m_showSelectedRatsnest, PCBNEW_SETTINGS::m_TrackDragAction, PCBNEW_SETTINGS::m_Use45DegreeLimit, FOOTPRINT_EDITOR_SETTINGS::m_Use45Limit, MOVE, NO_EFFECT, MAGNETIC_SETTINGS::pads, Pgm(), and MAGNETIC_SETTINGS::tracks.

◆ TransferDataToWindow()

bool PANEL_EDIT_OPTIONS::TransferDataToWindow ( )
override

Definition at line 106 of file panel_edit_options.cpp.

107{
108 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
109
111 {
113
114 loadFPSettings( cfg );
115 }
116 else
117 {
119
120 loadPCBSettings( cfg );
121 }
122
123 return true;
124}

References SETTINGS_MANAGER::GetAppSettings(), loadFPSettings(), loadPCBSettings(), m_isFootprintEditor, and Pgm().

Member Data Documentation

◆ m_allowFreePads

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_allowFreePads
protectedinherited

◆ m_autoRefillZones

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_autoRefillZones
protectedinherited

◆ m_cbFpGraphic45Mode

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_cbFpGraphic45Mode
protectedinherited

◆ m_cbPcbGraphic45Mode

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_cbPcbGraphic45Mode
protectedinherited

◆ m_escClearsNetHighlight

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_escClearsNetHighlight
protectedinherited

◆ m_flipLeftRight

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_flipLeftRight
protectedinherited

◆ m_isFootprintEditor

bool PANEL_EDIT_OPTIONS::m_isFootprintEditor
private

◆ m_magneticGraphics

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_magneticGraphics
protectedinherited

◆ m_magneticGraphicsChoice

wxChoice* PANEL_EDIT_OPTIONS_BASE::m_magneticGraphicsChoice
protectedinherited

◆ m_magneticPadChoice

wxChoice* PANEL_EDIT_OPTIONS_BASE::m_magneticPadChoice
protectedinherited

◆ m_magneticPads

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_magneticPads
protectedinherited

◆ m_magneticTrackChoice

wxChoice* PANEL_EDIT_OPTIONS_BASE::m_magneticTrackChoice
protectedinherited

◆ m_mouseCmdsOSX

wxStaticBoxSizer* PANEL_EDIT_OPTIONS_BASE::m_mouseCmdsOSX
protectedinherited

◆ m_mouseCmdsWinLin

wxStaticBoxSizer* PANEL_EDIT_OPTIONS_BASE::m_mouseCmdsWinLin
protectedinherited

◆ m_OptDisplayCurvedRatsnestLines

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_OptDisplayCurvedRatsnestLines
protectedinherited

◆ m_optionsBook

wxSimplebook* PANEL_EDIT_OPTIONS_BASE::m_optionsBook
protectedinherited

◆ m_rbCtrlClickAction

wxRadioBox* PANEL_EDIT_OPTIONS_BASE::m_rbCtrlClickAction
protectedinherited

◆ m_rbCtrlClickActionMac

wxRadioBox* PANEL_EDIT_OPTIONS_BASE::m_rbCtrlClickActionMac
protectedinherited

◆ m_rbTrackDrag45

wxRadioButton* PANEL_EDIT_OPTIONS_BASE::m_rbTrackDrag45
protectedinherited

◆ m_rbTrackDragFree

wxRadioButton* PANEL_EDIT_OPTIONS_BASE::m_rbTrackDragFree
protectedinherited

◆ m_rbTrackDragMove

wxRadioButton* PANEL_EDIT_OPTIONS_BASE::m_rbTrackDragMove
protectedinherited

◆ m_rotationAngle

UNIT_BINDER PANEL_EDIT_OPTIONS::m_rotationAngle
private

◆ m_rotationAngleCtrl

wxTextCtrl* PANEL_EDIT_OPTIONS_BASE::m_rotationAngleCtrl
protectedinherited

◆ m_rotationAngleLabel

wxStaticText* PANEL_EDIT_OPTIONS_BASE::m_rotationAngleLabel
protectedinherited

◆ m_rotationAngleUnits

wxStaticText* PANEL_EDIT_OPTIONS_BASE::m_rotationAngleUnits
protectedinherited

◆ m_showPageLimits

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_showPageLimits
protectedinherited

◆ m_showSelectedRatsnest

wxCheckBox* PANEL_EDIT_OPTIONS_BASE::m_showSelectedRatsnest
protectedinherited

◆ m_staticText181

wxStaticText* PANEL_EDIT_OPTIONS_BASE::m_staticText181
protectedinherited

◆ m_staticText1811

wxStaticText* PANEL_EDIT_OPTIONS_BASE::m_staticText1811
protectedinherited

◆ m_staticText2

wxStaticText* PANEL_EDIT_OPTIONS_BASE::m_staticText2
protectedinherited

◆ m_staticText21

wxStaticText* PANEL_EDIT_OPTIONS_BASE::m_staticText21
protectedinherited

◆ m_staticText211

wxStaticText* PANEL_EDIT_OPTIONS_BASE::m_staticText211
protectedinherited

◆ m_staticText5

wxStaticText* PANEL_EDIT_OPTIONS_BASE::m_staticText5
protectedinherited

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