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, see <https://www.gnu.org/licenses/>.
18 */
19
21
25#include <pcb_edit_frame.h>
26
27#include <kidialog.h>
28
29
31 PANEL_SETUP_DEFAULTS_BASE( aParentWindow ),
32 m_Frame( aFrame ),
33 m_BrdSettings( &m_Frame->GetBoard()->GetDesignSettings() ),
36{
37 m_scrollSizer->Add( m_textAndGraphicsPanel, 0, wxEXPAND, 5 );
38 m_scrollSizer->AddSpacer( 10 );
39 m_scrollSizer->Add( m_dimensionsPanel, 0, wxEXPAND, 5 );
40
41 Layout();
42 GetSizer()->Fit( this );
43}
44
45
47{
48 m_textAndGraphicsPanel->TransferDataToWindow();
49 m_dimensionsPanel->TransferDataToWindow();
50
51 Layout();
52
53 return true;
54}
55
56
58{
59 if( !m_textAndGraphicsPanel->TransferDataFromWindow() )
60 return false;
61
62 if( !m_dimensionsPanel->TransferDataFromWindow() )
63 return false;
64
65 return true;
66}
67
68
70{
71 if( !m_textAndGraphicsPanel->CommitPendingChanges() )
72 return;
73
74 if( !m_dimensionsPanel->CommitPendingChanges() )
75 return;
76
77 BOARD_DESIGN_SETTINGS* savedSettings = m_BrdSettings;
78
81
82 m_BrdSettings = savedSettings;
83}
Container for design settings for a BOARD object.
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition board.cpp:1149
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
bool TransferDataToWindow() override
The main frame for Pcbnew.