KiCad PCB EDA Suite
panel_pcm_settings.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) 2022 Andrew Lutsenko, anlutsenko at gmail dot com
5 * Copyright (C) 2022 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 "panel_pcm_settings.h"
26
27#include <pgm_base.h>
30#include <widgets/ui_common.h>
31
33{
34 wxSize minSize = m_libPrefix->GetMinSize();
35 int minWidth = m_libPrefix->GetTextExtent( wxT( "XXX.XXX" ) ).GetWidth();
36
37 m_libPrefix->SetMinSize( wxSize( minWidth, minSize.GetHeight() ) );
38
39 m_libHelp->SetFont( KIUI::GetInfoFont( this ).Italic() );
40}
41
42
44{
45 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
47
48 m_updateCheck->SetValue( settings->m_PcmUpdateCheck );
49 m_libAutoAdd->SetValue( settings->m_PcmLibAutoAdd );
50 m_libAutoRemove->SetValue( settings->m_PcmLibAutoRemove );
51 m_libPrefix->SetValue( settings->m_PcmLibPrefix );
52
53 return true;
54}
55
56
58{
59 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
61
62 settings->m_PcmUpdateCheck = m_updateCheck->GetValue();
63 settings->m_PcmLibAutoAdd = m_libAutoAdd->GetValue();
64 settings->m_PcmLibAutoRemove = m_libAutoRemove->GetValue();
65 settings->m_PcmLibPrefix = m_libPrefix->GetValue();
66
67 return true;
68}
wxString m_PcmLibPrefix
Class PANEL_PCM_SETTINGS_BASE.
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
PANEL_PCM_SETTINGS(wxWindow *parent)
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
const int minSize
Push and Shove router track width and via size dialog.
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:111
Functions to provide common constants and other functions to assist in making a consistent UI.