KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_defaults.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
25
30#include <pcb_edit_frame.h>
31
32#include <kidialog.h>
33
34
36 PANEL_SETUP_DEFAULTS_BASE( aParentWindow ),
37 m_Frame( aFrame ),
38 m_BrdSettings( &m_Frame->GetBoard()->GetDesignSettings() ),
42{
43 m_scrollSizer->Add( m_textAndGraphicsPanel, 0, wxEXPAND, 5 );
44 m_scrollSizer->AddSpacer( 10 );
45 m_scrollSizer->Add( m_dimensionsPanel, 0, wxEXPAND, 5 );
46 m_scrollSizer->AddSpacer( 10 );
47 m_scrollSizer->Add( m_zonesPanel, 0, wxEXPAND, 5 );
48
49 Layout();
50 GetSizer()->Fit( this );
51}
52
53
55{
56 m_textAndGraphicsPanel->TransferDataToWindow();
57 m_dimensionsPanel->TransferDataToWindow();
58 m_zonesPanel->TransferDataToWindow();
59
60 Layout();
61
62 return true;
63}
64
65
67{
68 if( !m_textAndGraphicsPanel->TransferDataFromWindow() )
69 return false;
70
71 if( !m_dimensionsPanel->TransferDataFromWindow() )
72 return false;
73
74 if( !m_zonesPanel->TransferDataFromWindow() )
75 return false;
76
77 return true;
78}
79
80
82{
83 if( !m_textAndGraphicsPanel->CommitPendingChanges() )
84 return;
85
86 if( !m_dimensionsPanel->CommitPendingChanges() )
87 return;
88
89 if( !m_zonesPanel->CommitPendingChanges() )
90 return;
91
92 BOARD_DESIGN_SETTINGS* savedSettings = m_BrdSettings;
93
96
97 m_BrdSettings = savedSettings;
98}
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition board.cpp:1069
PANEL_SETUP_DEFAULTS_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)
PANEL_SETUP_DEFAULTS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame)
PANEL_SETUP_TEXT_AND_GRAPHICS * m_textAndGraphicsPanel
bool TransferDataFromWindow() override
void ImportSettingsFrom(BOARD *aBoard)
BOARD_DESIGN_SETTINGS * m_BrdSettings
PANEL_SETUP_DIMENSIONS * m_dimensionsPanel
PANEL_SETUP_ZONES * m_zonesPanel
bool TransferDataToWindow() override
The main frame for Pcbnew.
BOARD * GetBoard()