KiCad PCB EDA Suite
PANEL_EESCHEMA_DISPLAY_OPTIONS Class Reference

#include <panel_eeschema_display_options.h>

Inheritance diagram for PANEL_EESCHEMA_DISPLAY_OPTIONS:
PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_EESCHEMA_DISPLAY_OPTIONS (wxWindow *aParent, APP_SETTINGS_BASE *aAppSettings)
 
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

wxBoxSizer * m_galOptionsSizer
 
wxStaticText * m_defaultFontLabel
 
FONT_CHOICEm_defaultFontCtrl
 
wxCheckBox * m_checkShowHiddenPins
 
wxCheckBox * m_checkShowHiddenFields
 
wxCheckBox * m_checkShowERCErrors
 
wxCheckBox * m_checkShowERCWarnings
 
wxCheckBox * m_checkShowERCExclusions
 
wxCheckBox * m_checkPageLimits
 
wxCheckBox * m_checkSelDrawChildItems
 
wxCheckBox * m_checkSelFillShapes
 
wxStaticText * m_selWidthLabel
 
wxSpinCtrlDouble * m_selWidthCtrl
 
wxStaticText * m_highlightColorNote
 
wxStaticText * m_highlightWidthLabel
 
wxSpinCtrlDouble * m_highlightWidthCtrl
 
wxCheckBox * m_checkCrossProbeOnSelection
 
wxCheckBox * m_checkCrossProbeCenter
 
wxCheckBox * m_checkCrossProbeZoom
 
wxCheckBox * m_checkCrossProbeAutoHighlight
 

Private Member Functions

void loadEEschemaSettings (EESCHEMA_SETTINGS *aCfg)
 

Private Attributes

GAL_OPTIONS_PANELm_galOptsPanel
 

Detailed Description

Definition at line 30 of file panel_eeschema_display_options.h.

Constructor & Destructor Documentation

◆ PANEL_EESCHEMA_DISPLAY_OPTIONS()

PANEL_EESCHEMA_DISPLAY_OPTIONS::PANEL_EESCHEMA_DISPLAY_OPTIONS ( wxWindow *  aParent,
APP_SETTINGS_BASE aAppSettings 
)

Definition at line 37 of file panel_eeschema_display_options.cpp.

38 :
40{
41 m_galOptsPanel = new GAL_OPTIONS_PANEL( this, aAppSettings );
42
43 m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
44
45 m_highlightColorNote->SetFont( KIUI::GetInfoFont( this ).Italic() );
46}
PANEL_EESCHEMA_DISPLAY_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(), PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_galOptionsSizer, m_galOptsPanel, and PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_highlightColorNote.

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_DISPLAY_OPTIONS::loadEEschemaSettings ( EESCHEMA_SETTINGS aCfg)
private

Definition at line 49 of file panel_eeschema_display_options.cpp.

50{
51 m_defaultFontCtrl->SetStringSelection( cfg->m_Appearance.default_font );
52
53 if( m_defaultFontCtrl->GetSelection() < 0 )
54 m_defaultFontCtrl->SetSelection( 0 );
55
56 m_checkShowHiddenPins->SetValue( cfg->m_Appearance.show_hidden_pins );
57 m_checkShowHiddenFields->SetValue( cfg->m_Appearance.show_hidden_fields );
58 m_checkShowERCErrors->SetValue( cfg->m_Appearance.show_erc_errors );
59 m_checkShowERCWarnings->SetValue( cfg->m_Appearance.show_erc_warnings );
60 m_checkShowERCExclusions->SetValue( cfg->m_Appearance.show_erc_exclusions );
61 m_checkPageLimits->SetValue( cfg->m_Appearance.show_page_limits );
62
63 m_checkSelDrawChildItems->SetValue( cfg->m_Selection.draw_selected_children );
64 m_checkSelFillShapes->SetValue( cfg->m_Selection.fill_shapes );
65 m_selWidthCtrl->SetValue( cfg->m_Selection.selection_thickness );
66 m_highlightWidthCtrl->SetValue( cfg->m_Selection.highlight_thickness );
67
68 m_checkCrossProbeOnSelection->SetValue( cfg->m_CrossProbing.on_selection );
69 m_checkCrossProbeCenter->SetValue( cfg->m_CrossProbing.center_on_items );
70 m_checkCrossProbeZoom->SetValue( cfg->m_CrossProbing.zoom_to_fit );
71 m_checkCrossProbeAutoHighlight->SetValue( cfg->m_CrossProbing.auto_highlight );
72}

References CROSS_PROBING_SETTINGS::auto_highlight, CROSS_PROBING_SETTINGS::center_on_items, EESCHEMA_SETTINGS::APPEARANCE::default_font, EESCHEMA_SETTINGS::SELECTION::draw_selected_children, EESCHEMA_SETTINGS::SELECTION::fill_shapes, EESCHEMA_SETTINGS::SELECTION::highlight_thickness, EESCHEMA_SETTINGS::m_Appearance, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeAutoHighlight, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeCenter, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeOnSelection, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeZoom, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkPageLimits, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkSelDrawChildItems, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkSelFillShapes, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCErrors, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCExclusions, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCWarnings, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenFields, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenPins, APP_SETTINGS_BASE::m_CrossProbing, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_defaultFontCtrl, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_highlightWidthCtrl, EESCHEMA_SETTINGS::m_Selection, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_selWidthCtrl, CROSS_PROBING_SETTINGS::on_selection, EESCHEMA_SETTINGS::SELECTION::selection_thickness, EESCHEMA_SETTINGS::APPEARANCE::show_erc_errors, EESCHEMA_SETTINGS::APPEARANCE::show_erc_exclusions, EESCHEMA_SETTINGS::APPEARANCE::show_erc_warnings, EESCHEMA_SETTINGS::APPEARANCE::show_hidden_fields, EESCHEMA_SETTINGS::APPEARANCE::show_hidden_pins, EESCHEMA_SETTINGS::APPEARANCE::show_page_limits, and CROSS_PROBING_SETTINGS::zoom_to_fit.

Referenced by ResetPanel(), and TransferDataToWindow().

◆ ResetPanel()

void PANEL_EESCHEMA_DISPLAY_OPTIONS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 119 of file panel_eeschema_display_options.cpp.

120{
122 cfg.Load(); // Loading without a file will init to defaults
123
124 loadEEschemaSettings( &cfg );
125
126 m_galOptsPanel->ResetPanel( &cfg );
127}
bool ResetPanel(APP_SETTINGS_BASE *aAppSettings)
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(), loadEEschemaSettings(), m_galOptsPanel, and GAL_OPTIONS_PANEL::ResetPanel().

◆ TransferDataFromWindow()

bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow ( )
override

Definition at line 88 of file panel_eeschema_display_options.cpp.

89{
90 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
92
93 cfg->m_Appearance.default_font = m_defaultFontCtrl->GetSelection() <= 0
94 ? KICAD_FONT_NAME // This is a keyword. Do not translate
95 : m_defaultFontCtrl->GetStringSelection();
102
107
112
114
115 return true;
116}
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:170
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
#define KICAD_FONT_NAME
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
bool on_selection
Synchronize the selection for multiple items too.
Definition: app_settings.h:32
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off)
Definition: app_settings.h:34
bool center_on_items
Automatically pan to cross-probed items.
Definition: app_settings.h:33
bool auto_highlight
Automatically turn on highlight mode in the target frame.
Definition: app_settings.h:35
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:85

References CROSS_PROBING_SETTINGS::auto_highlight, CROSS_PROBING_SETTINGS::center_on_items, EESCHEMA_SETTINGS::APPEARANCE::default_font, EESCHEMA_SETTINGS::SELECTION::draw_selected_children, EESCHEMA_SETTINGS::SELECTION::fill_shapes, SETTINGS_MANAGER::GetAppSettings(), EESCHEMA_SETTINGS::SELECTION::highlight_thickness, KICAD_FONT_NAME, KiROUND(), EESCHEMA_SETTINGS::m_Appearance, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeAutoHighlight, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeCenter, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeOnSelection, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeZoom, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkPageLimits, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkSelDrawChildItems, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkSelFillShapes, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCErrors, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCExclusions, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCWarnings, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenFields, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenPins, APP_SETTINGS_BASE::m_CrossProbing, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_defaultFontCtrl, m_galOptsPanel, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_highlightWidthCtrl, EESCHEMA_SETTINGS::m_Selection, PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_selWidthCtrl, CROSS_PROBING_SETTINGS::on_selection, Pgm(), EESCHEMA_SETTINGS::SELECTION::selection_thickness, EESCHEMA_SETTINGS::APPEARANCE::show_erc_errors, EESCHEMA_SETTINGS::APPEARANCE::show_erc_exclusions, EESCHEMA_SETTINGS::APPEARANCE::show_erc_warnings, EESCHEMA_SETTINGS::APPEARANCE::show_hidden_fields, EESCHEMA_SETTINGS::APPEARANCE::show_hidden_pins, EESCHEMA_SETTINGS::APPEARANCE::show_page_limits, GAL_OPTIONS_PANEL::TransferDataFromWindow(), and CROSS_PROBING_SETTINGS::zoom_to_fit.

◆ TransferDataToWindow()

bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow ( )
override

Definition at line 75 of file panel_eeschema_display_options.cpp.

76{
77 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
79
81
83
84 return true;
85}
bool TransferDataToWindow() override
Load the panel controls from the given opt.

References SETTINGS_MANAGER::GetAppSettings(), loadEEschemaSettings(), m_galOptsPanel, Pgm(), and GAL_OPTIONS_PANEL::TransferDataToWindow().

Member Data Documentation

◆ m_checkCrossProbeAutoHighlight

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeAutoHighlight
protectedinherited

◆ m_checkCrossProbeCenter

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeCenter
protectedinherited

◆ m_checkCrossProbeOnSelection

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeOnSelection
protectedinherited

◆ m_checkCrossProbeZoom

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkCrossProbeZoom
protectedinherited

◆ m_checkPageLimits

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkPageLimits
protectedinherited

◆ m_checkSelDrawChildItems

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkSelDrawChildItems
protectedinherited

◆ m_checkSelFillShapes

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkSelFillShapes
protectedinherited

◆ m_checkShowERCErrors

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCErrors
protectedinherited

◆ m_checkShowERCExclusions

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCExclusions
protectedinherited

◆ m_checkShowERCWarnings

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowERCWarnings
protectedinherited

◆ m_checkShowHiddenFields

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenFields
protectedinherited

◆ m_checkShowHiddenPins

wxCheckBox* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_checkShowHiddenPins
protectedinherited

◆ m_defaultFontCtrl

FONT_CHOICE* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_defaultFontCtrl
protectedinherited

◆ m_defaultFontLabel

wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_defaultFontLabel
protectedinherited

◆ m_galOptionsSizer

wxBoxSizer* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_galOptionsSizer
protectedinherited

◆ m_galOptsPanel

GAL_OPTIONS_PANEL* PANEL_EESCHEMA_DISPLAY_OPTIONS::m_galOptsPanel
private

◆ m_highlightColorNote

wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_highlightColorNote
protectedinherited

◆ m_highlightWidthCtrl

wxSpinCtrlDouble* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_highlightWidthCtrl
protectedinherited

◆ m_highlightWidthLabel

wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_highlightWidthLabel
protectedinherited

◆ m_selWidthCtrl

wxSpinCtrlDouble* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_selWidthCtrl
protectedinherited

◆ m_selWidthLabel

wxStaticText* PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::m_selWidthLabel
protectedinherited

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