KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_eeschema_display_options.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2009 Wayne Stambaugh <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include <pgm_base.h>
27#include <eeschema_settings.h>
30#include <widgets/ui_common.h>
31#include <widgets/font_choice.h>
32
33// The "official" name of the building Kicad stroke font (always existing)
35
36
39{
40 m_galOptsPanel = new PANEL_GAL_OPTIONS( this, aAppSettings );
41
42 m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND|wxRIGHT, 0 );
43
44 m_highlightColorNote->SetFont( KIUI::GetSmallInfoFont( this ).Italic() );
45}
46
47
49{
50 m_defaultFontCtrl->SetStringSelection( cfg->m_Appearance.default_font );
51
52 if( m_defaultFontCtrl->GetSelection() < 0 )
53 m_defaultFontCtrl->SetSelection( 0 );
54
65
73
79}
80
81
83{
85 m_galOptsPanel->TransferDataToWindow();
86 return true;
87}
88
89
91{
93 {
94 cfg->m_Appearance.default_font = m_defaultFontCtrl->GetSelection() <= 0
95 // This is a keyword. Do not translate.
96 ? wxString( KICAD_FONT_NAME )
97 : m_defaultFontCtrl->GetStringSelection();
98 cfg->m_Appearance.show_hidden_pins = m_checkShowHiddenPins->GetValue();
99 cfg->m_Appearance.show_hidden_fields = m_checkShowHiddenFields->GetValue();
100 cfg->m_Appearance.show_erc_warnings = m_checkShowERCWarnings->GetValue();
101 cfg->m_Appearance.show_erc_errors = m_checkShowERCErrors->GetValue();
102 cfg->m_Appearance.show_erc_exclusions = m_checkShowERCExclusions->GetValue();
103 cfg->m_Appearance.mark_sim_exclusions = m_cbMarkSimExclusions->GetValue();
104 cfg->m_Appearance.show_op_voltages = m_checkShowOPVoltages->GetValue();
105 cfg->m_Appearance.show_op_currents = m_checkShowOPCurrents->GetValue();
106 cfg->m_Appearance.show_pin_alt_icons = m_checkShowPinAltModeIcons->GetValue();
107 cfg->m_Appearance.show_page_limits = m_checkPageLimits->GetValue();
108
109 cfg->m_Selection.draw_selected_children = m_checkSelDrawChildItems->GetValue();
110 cfg->m_Selection.fill_shapes = m_checkSelFillShapes->GetValue();
111 cfg->m_Selection.selection_thickness = KiROUND( m_selWidthCtrl->GetValue() );
112 cfg->m_Selection.highlight_thickness = KiROUND( m_highlightWidthCtrl->GetValue() );
113 cfg->m_Selection.highlight_netclass_colors = m_highlightNetclassColors->GetValue();
114 cfg->m_Selection.highlight_netclass_colors_thickness = m_colHighlightThickness->GetValue();
115 cfg->m_Selection.highlight_netclass_colors_alpha = m_colHighlightTransparency->GetValue() / 100.0;
116
117 cfg->m_CrossProbing.on_selection = m_checkCrossProbeOnSelection->GetValue();
118 cfg->m_CrossProbing.center_on_items = m_checkCrossProbeCenter->GetValue();
119 cfg->m_CrossProbing.zoom_to_fit = m_checkCrossProbeZoom->GetValue();
120 cfg->m_CrossProbing.auto_highlight = m_checkCrossProbeAutoHighlight->GetValue();
121 cfg->m_CrossProbing.flash_selection = m_checkCrossProbeFlash->GetValue();
122 }
123
124 m_galOptsPanel->TransferDataFromWindow();
125
126 return true;
127}
128
129
131{
133 cfg.Load(); // Loading without a file will init to defaults
134
135 loadEEschemaSettings( &cfg );
136
137 m_galOptsPanel->ResetPanel( &cfg );
138}
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:990
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
CROSS_PROBING_SETTINGS m_CrossProbing
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
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)
void ResetPanel() override
Reset the contents of this panel.
PANEL_EESCHEMA_DISPLAY_OPTIONS(wxWindow *aParent, APP_SETTINGS_BASE *aAppSettings)
void loadEEschemaSettings(EESCHEMA_SETTINGS *aCfg)
#define KICAD_FONT_NAME
KICOMMON_API wxFont GetSmallInfoFont(wxWindow *aWindow)
see class PGM_BASE
T * GetAppSettings(const char *aFilename)
bool flash_selection
Flash newly cross-probed selection (visual attention aid).
bool on_selection
Synchronize the selection for multiple items too.
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off).
bool center_on_items
Automatically pan to cross-probed items.
bool auto_highlight
Automatically turn on highlight mode in the target frame.
Functions to provide common constants and other functions to assist in making a consistent UI.