KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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
40
42{
43 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
45
46 m_updateCheck->SetValue( settings->m_PcmUpdateCheck );
47 m_libAutoAdd->SetValue( settings->m_PcmLibAutoAdd );
48 m_libAutoRemove->SetValue( settings->m_PcmLibAutoRemove );
49 m_libPrefix->SetValue( settings->m_PcmLibPrefix );
50
51 return true;
52}
53
54
56{
57 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
59
60 settings->m_PcmUpdateCheck = m_updateCheck->GetValue();
61 settings->m_PcmLibAutoAdd = m_libAutoAdd->GetValue();
62 settings->m_PcmLibAutoRemove = m_libAutoRemove->GetValue();
63 settings->m_PcmLibPrefix = m_libPrefix->GetValue();
64
65 return true;
66}
wxString m_PcmLibPrefix
Class PANEL_PCM_SETTINGS_BASE.
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
PANEL_PCM_SETTINGS(wxWindow *parent)
T * GetAppSettings()
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.
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:115
Functions to provide common constants and other functions to assist in making a consistent UI.