KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 UNITS_PROVIDER* aUnitsProvider,
34 wxWindow* aEventSource ) :
36 m_lineWidth( aUnitsProvider, aEventSource, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits ),
37 m_textSize( aUnitsProvider, aEventSource, m_textSizeLabel, m_textSizeCtrl, m_textSizeUnits ),
38 m_pinLength( aUnitsProvider, aEventSource, m_pinLengthLabel, m_pinLengthCtrl, m_pinLengthUnits ),
39 m_pinNameSize( aUnitsProvider, aEventSource ,m_pinNameSizeLabel, m_pinNameSizeCtrl, m_pinNameSizeUnits ),
40 m_pinNumberSize( aUnitsProvider, aEventSource, m_pinNumSizeLabel, m_pinNumSizeCtrl, m_pinNumSizeUnits )
41{
42 m_widthHelpText->SetFont( KIUI::GetInfoFont( this ).Italic() );
43}
44
45
47{
53 m_choicePinDisplacement->SetSelection( aCfg->m_Repeat.pin_step == 50 ? 1 : 0 );
54 m_spinRepeatLabel->SetValue( aCfg->m_Repeat.label_delta );
56}
57
58
60{
61 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
63
64 loadSymEditorSettings( settings );
65
66 return true;
67}
68
69
71{
72 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
74
80 settings->m_Repeat.label_delta = m_spinRepeatLabel->GetValue();
81 settings->m_Repeat.pin_step = m_choicePinDisplacement->GetSelection() == 1 ? 50 : 100;
83
84 return true;
85}
86
87
89{
91 cfg.Load(); // Loading without a file will init to defaults
92
94}
95
96
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
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, UNITS_PROVIDER *aUnitsProvider, wxWindow *aEventSource)
void ResetPanel() override
Reset the contents of this panel.
void loadSymEditorSettings(SYMBOL_EDITOR_SETTINGS *aCfg)
T * GetAppSettings()
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:156
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:115
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.