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 (C) 1992-2023 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
38 APP_SETTINGS_BASE* aAppSettings ) :
40{
41 m_galOptsPanel = new GAL_OPTIONS_PANEL( this, aAppSettings );
42
43 m_galOptionsSizer->Add( m_galOptsPanel, 1, wxEXPAND|wxRIGHT, 15 );
44
45 m_highlightColorNote->SetFont( KIUI::GetInfoFont( this ).Italic() );
46}
47
48
50{
51 m_defaultFontCtrl->SetStringSelection( cfg->m_Appearance.default_font );
52
53 if( m_defaultFontCtrl->GetSelection() < 0 )
54 m_defaultFontCtrl->SetSelection( 0 );
55
64
69
74}
75
76
78{
79 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
81
83
85
86 return true;
87}
88
89
91{
92 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
94
95 cfg->m_Appearance.default_font = m_defaultFontCtrl->GetSelection() <= 0
96 ? wxString( KICAD_FONT_NAME ) // This is a keyword. Do not translate
97 : m_defaultFontCtrl->GetStringSelection();
106
111
116
118
119 return true;
120}
121
122
124{
126 cfg.Load(); // Loading without a file will init to defaults
127
128 loadEEschemaSettings( &cfg );
129
130 m_galOptsPanel->ResetPanel( &cfg );
131}
132
133
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:156
bool ResetPanel(APP_SETTINGS_BASE *aAppSettings)
bool TransferDataToWindow() override
Load the panel controls from the given opt.
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
Class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE.
void ResetPanel() override
Reset the contents of this panel.
PANEL_EESCHEMA_DISPLAY_OPTIONS(wxWindow *aParent, APP_SETTINGS_BASE *aAppSettings)
void loadEEschemaSettings(EESCHEMA_SETTINGS *aCfg)
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
#define KICAD_FONT_NAME
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:151
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:119
bool on_selection
Synchronize the selection for multiple items too.
Definition: app_settings.h:33
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off)
Definition: app_settings.h:35
bool center_on_items
Automatically pan to cross-probed items.
Definition: app_settings.h:34
bool auto_highlight
Automatically turn on highlight mode in the target frame.
Definition: app_settings.h:36
Functions to provide common constants and other functions to assist in making a consistent UI.
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