KiCad PCB EDA Suite
PANEL_DISPLAY_OPTIONS Class Reference

#include <panel_display_options.h>

Inheritance diagram for PANEL_DISPLAY_OPTIONS:
PANEL_DISPLAY_OPTIONS_BASE RESETTABLE_PANEL

Public Member Functions

 PANEL_DISPLAY_OPTIONS (wxWindow *aParent, APP_SETTINGS_BASE *aAppSettings)
 
bool TransferDataFromWindow () override
 
bool TransferDataToWindow () 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 Types

enum  { ID_SHOW_CLEARANCE = 1000 }
 

Protected Attributes

wxBoxSizer * m_galOptionsSizer
 
wxSimplebook * m_optionsBook
 
wxRadioBox * m_ShowNetNamesOption
 
wxCheckBox * m_OptDisplayPadNumber
 
wxCheckBox * m_OptDisplayPadNoConn
 
wxRadioBox * m_OptDisplayTracksClearance
 
wxCheckBox * m_OptDisplayPadClearence
 
wxCheckBox * m_checkCrossProbeOnSelection
 
wxCheckBox * m_checkCrossProbeCenter
 
wxCheckBox * m_checkCrossProbeZoom
 
wxCheckBox * m_checkCrossProbeAutoHighlight
 
wxCheckBox * m_live3Drefresh
 

Private Member Functions

void loadPCBSettings (PCBNEW_SETTINGS *aCfg)
 

Private Attributes

bool m_isPCBEdit
 
GAL_OPTIONS_PANELm_galOptsPanel
 

Detailed Description

Definition at line 28 of file panel_display_options.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
ID_SHOW_CLEARANCE 

Definition at line 36 of file panel_display_options_base.h.

Constructor & Destructor Documentation

◆ PANEL_DISPLAY_OPTIONS()

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

Definition at line 39 of file panel_display_options.cpp.

39 :
41 m_isPCBEdit( dynamic_cast<PCBNEW_SETTINGS*>( aAppSettings ) != nullptr )
42{
43 m_galOptsPanel = new GAL_OPTIONS_PANEL( this, aAppSettings );
44 m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND, 0 );
45
46 m_optionsBook->SetSelection( m_isPCBEdit ? 1 : 0 );
47}
PANEL_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)
GAL_OPTIONS_PANEL * m_galOptsPanel

References PANEL_DISPLAY_OPTIONS_BASE::m_galOptionsSizer, m_galOptsPanel, m_isPCBEdit, and PANEL_DISPLAY_OPTIONS_BASE::m_optionsBook.

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

◆ loadPCBSettings()

void PANEL_DISPLAY_OPTIONS::loadPCBSettings ( PCBNEW_SETTINGS aCfg)
private

Definition at line 50 of file panel_display_options.cpp.

51{
53 m_OptDisplayTracksClearance->SetSelection( i );
54
58 m_ShowNetNamesOption->SetSelection( aCfg->m_Display.m_NetNames );
59 m_live3Drefresh->SetValue( aCfg->m_Display.m_Live3DRefresh );
64}
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:167
DISPLAY_OPTIONS m_Display
VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay
static long GetConfigForVal(const MAP &aMap, CFG_NATIVE_VAL< MAP > aVal)
Get the mapped config value (the one to write to file, or use in an index) from the given native (pro...
Definition: config_map.h:69
static const UTIL::CFG_MAP< TRACK_CLEARANCE_MODE > clearanceModeMap
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
TRACK_CLEARANCE_MODE m_TrackClearance

References CROSS_PROBING_SETTINGS::auto_highlight, CROSS_PROBING_SETTINGS::center_on_items, clearanceModeMap, UTIL::GetConfigForVal(), PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeAutoHighlight, PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeCenter, PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeOnSelection, PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeZoom, APP_SETTINGS_BASE::m_CrossProbing, PCBNEW_SETTINGS::m_Display, PCB_VIEWERS_SETTINGS_BASE::VIEWERS_DISPLAY_OPTIONS::m_DisplayPadNumbers, PANEL_DISPLAY_OPTIONS_BASE::m_live3Drefresh, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_Live3DRefresh, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_NetNames, PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadClearence, PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadNoConn, PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadNumber, PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayTracksClearance, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_PadClearance, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_PadNoConnects, PANEL_DISPLAY_OPTIONS_BASE::m_ShowNetNamesOption, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_TrackClearance, PCB_VIEWERS_SETTINGS_BASE::m_ViewersDisplay, CROSS_PROBING_SETTINGS::on_selection, and CROSS_PROBING_SETTINGS::zoom_to_fit.

Referenced by ResetPanel(), and TransferDataToWindow().

◆ ResetPanel()

void PANEL_DISPLAY_OPTIONS::ResetPanel ( )
overridevirtual

Reset the contents of this panel.

Implements RESETTABLE_PANEL.

Definition at line 112 of file panel_display_options.cpp.

113{
114 PCBNEW_SETTINGS cfg;
115 cfg.Load(); // Loading without a file will init to defaults
116
117 if( m_isPCBEdit )
118 loadPCBSettings( &cfg );
119
120 m_galOptsPanel->ResetPanel( &cfg );
121}
bool ResetPanel(APP_SETTINGS_BASE *aAppSettings)
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
void loadPCBSettings(PCBNEW_SETTINGS *aCfg)

References JSON_SETTINGS::Load(), loadPCBSettings(), m_galOptsPanel, m_isPCBEdit, and GAL_OPTIONS_PANEL::ResetPanel().

◆ TransferDataFromWindow()

bool PANEL_DISPLAY_OPTIONS::TransferDataFromWindow ( )
override

Definition at line 86 of file panel_display_options.cpp.

87{
89
90 if( m_isPCBEdit )
91 {
92 PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
93
94 int i = m_OptDisplayTracksClearance->GetSelection();
96
100 cfg->m_Display.m_NetNames = m_ShowNetNamesOption->GetSelection();
101 cfg->m_Display.m_Live3DRefresh = m_live3Drefresh->GetValue();
106 }
107
108 return true;
109}
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.
static CFG_NATIVE_VAL< MAP > GetValFromConfig(const MAP &aMap, long aConf)
Get the native value corresponding to the config value (read from file or UI, probably) and find it i...
Definition: config_map.h:96
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111

References CROSS_PROBING_SETTINGS::auto_highlight, CROSS_PROBING_SETTINGS::center_on_items, clearanceModeMap, UTIL::GetValFromConfig(), PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeAutoHighlight, PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeCenter, PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeOnSelection, PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeZoom, APP_SETTINGS_BASE::m_CrossProbing, PCBNEW_SETTINGS::m_Display, PCB_VIEWERS_SETTINGS_BASE::VIEWERS_DISPLAY_OPTIONS::m_DisplayPadNumbers, m_galOptsPanel, m_isPCBEdit, PANEL_DISPLAY_OPTIONS_BASE::m_live3Drefresh, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_Live3DRefresh, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_NetNames, PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadClearence, PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadNoConn, PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadNumber, PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayTracksClearance, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_PadClearance, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_PadNoConnects, PANEL_DISPLAY_OPTIONS_BASE::m_ShowNetNamesOption, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_TrackClearance, PCB_VIEWERS_SETTINGS_BASE::m_ViewersDisplay, CROSS_PROBING_SETTINGS::on_selection, Pgm(), GAL_OPTIONS_PANEL::TransferDataFromWindow(), and CROSS_PROBING_SETTINGS::zoom_to_fit.

◆ TransferDataToWindow()

bool PANEL_DISPLAY_OPTIONS::TransferDataToWindow ( )
override

Definition at line 67 of file panel_display_options.cpp.

68{
69 if( m_isPCBEdit )
70 {
71 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
73
74 loadPCBSettings( cfg );
75 }
76
78
79 return true;
80}
bool TransferDataToWindow() override
Load the panel controls from the given opt.
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...

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

Member Data Documentation

◆ m_checkCrossProbeAutoHighlight

wxCheckBox* PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeAutoHighlight
protectedinherited

◆ m_checkCrossProbeCenter

wxCheckBox* PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeCenter
protectedinherited

◆ m_checkCrossProbeOnSelection

wxCheckBox* PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeOnSelection
protectedinherited

◆ m_checkCrossProbeZoom

wxCheckBox* PANEL_DISPLAY_OPTIONS_BASE::m_checkCrossProbeZoom
protectedinherited

◆ m_galOptionsSizer

wxBoxSizer* PANEL_DISPLAY_OPTIONS_BASE::m_galOptionsSizer
protectedinherited

◆ m_galOptsPanel

GAL_OPTIONS_PANEL* PANEL_DISPLAY_OPTIONS::m_galOptsPanel
private

◆ m_isPCBEdit

bool PANEL_DISPLAY_OPTIONS::m_isPCBEdit
private

◆ m_live3Drefresh

wxCheckBox* PANEL_DISPLAY_OPTIONS_BASE::m_live3Drefresh
protectedinherited

◆ m_OptDisplayPadClearence

wxCheckBox* PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadClearence
protectedinherited

◆ m_OptDisplayPadNoConn

wxCheckBox* PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadNoConn
protectedinherited

◆ m_OptDisplayPadNumber

wxCheckBox* PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayPadNumber
protectedinherited

◆ m_OptDisplayTracksClearance

wxRadioBox* PANEL_DISPLAY_OPTIONS_BASE::m_OptDisplayTracksClearance
protectedinherited

◆ m_optionsBook

wxSimplebook* PANEL_DISPLAY_OPTIONS_BASE::m_optionsBook
protectedinherited

◆ m_ShowNetNamesOption

wxRadioBox* PANEL_DISPLAY_OPTIONS_BASE::m_ShowNetNamesOption
protectedinherited

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