KiCad PCB EDA Suite
panel_sym_editing_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-2021 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>
26#include <widgets/ui_common.h>
30
31
33 EDA_BASE_FRAME* aUnitsProvider ) :
35 m_lineWidth( aUnitsProvider, schIUScale, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ),
36 m_textSize( aUnitsProvider, schIUScale, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits ),
37 m_pinLength( aUnitsProvider, schIUScale, m_pinLengthLabel, m_pinLengthCtrl, m_pinLengthUnits ),
38 m_pinNameSize( aUnitsProvider, schIUScale ,m_pinNameSizeLabel, m_pinNameSizeCtrl, m_pinNameSizeUnits ),
39 m_pinNumberSize( aUnitsProvider, schIUScale, m_pinNumSizeLabel, m_pinNumSizeCtrl, m_pinNumSizeUnits )
40{
41 m_widthHelpText->SetFont( KIUI::GetInfoFont( this ).Italic() );
42}
43
44
46{
52 m_choicePinDisplacement->SetSelection( aCfg->m_Repeat.pin_step == 50 ? 1 : 0 );
53 m_spinRepeatLabel->SetValue( aCfg->m_Repeat.label_delta );
55}
56
57
59{
60 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
62
63 loadSymEditorSettings( settings );
64
65 return true;
66}
67
68
70{
71 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
73
79 settings->m_Repeat.label_delta = m_spinRepeatLabel->GetValue();
80 settings->m_Repeat.pin_step = m_choicePinDisplacement->GetSelection() == 1 ? 50 : 100;
82
83 return true;
84}
85
86
88{
90 cfg.Load(); // Loading without a file will init to defaults
91
93}
94
95
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
The base frame for deriving all KiCad main window classes.
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
Class PANEL_SYM_EDITING_OPTIONS_BASE.
PANEL_SYM_EDITING_OPTIONS(wxWindow *aWindow, EDA_BASE_FRAME *aUnitsProvider)
void ResetPanel() override
Reset the contents of this panel.
void loadSymEditorSettings(SYMBOL_EDITOR_SETTINGS *aCfg)
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:144
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
constexpr int IUToMils(int iu) const
Definition: base_units.h:100
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94
Functions to provide common constants and other functions to assist in making a consistent UI.