KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_packages_and_updates.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 The 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, see <https://www.gnu.org/licenses/>.
19 */
20
22
23#include <pgm_base.h>
26#include <widgets/ui_common.h>
27
30{
31 wxSize minSize = m_libPrefix->GetMinSize();
32 int minWidth = m_libPrefix->GetTextExtent( wxT( "XXX.XXX" ) ).GetWidth();
33
34 m_libPrefix->SetMinSize( wxSize( minWidth, minSize.GetHeight() ) );
35
36#ifndef KICAD_UPDATE_CHECK
37 m_generalLabel->Hide();
38 m_staticline3->Hide();
39 m_cbKicadUpdate->Hide();
40#endif
41}
42
43
45{
47 {
48 m_cbKicadUpdate->SetValue( cfg->m_KiCadUpdateCheck );
49 m_cbPcmUpdate->SetValue( cfg->m_PcmUpdateCheck );
50 m_libAutoAdd->SetValue( cfg->m_PcmLibAutoAdd );
51 m_libAutoRemove->SetValue( cfg->m_PcmLibAutoRemove );
52 m_libPrefix->SetValue( cfg->m_PcmLibPrefix );
53 }
54
55 return true;
56}
57
58
60{
62 {
63 cfg->m_KiCadUpdateCheck = m_cbKicadUpdate->GetValue();
64 cfg->m_PcmUpdateCheck = m_cbPcmUpdate->GetValue();
65 cfg->m_PcmLibAutoAdd = m_libAutoAdd->GetValue();
66 cfg->m_PcmLibAutoRemove = m_libAutoRemove->GetValue();
67 cfg->m_PcmLibPrefix = m_libPrefix->GetValue();
68 }
69
70 return true;
71}
PANEL_PACKAGES_AND_UPDATES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
const int minSize
Push and Shove router track width and via size dialog.
see class PGM_BASE
T * GetAppSettings(const char *aFilename)
Functions to provide common constants and other functions to assist in making a consistent UI.