KiCad PCB EDA Suite
panel_modedit_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) 1992-2016 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 
24 #include <board_design_settings.h>
25 #include <fctsys.h>
26 #include <footprint_edit_frame.h>
27 #include <pcb_edit_frame.h>
28 #include <pcbnew.h>
29 #include <pcbnew_settings.h>
30 #include <widgets/paged_dialog.h>
31 
32 #include <panel_modedit_settings.h>
33 
34 
36  PAGED_DIALOG* aParent) :
37  PANEL_MODEDIT_SETTINGS_BASE( aParent->GetTreebook() ),
38  m_frame( aFrame )
39 {}
40 
41 
43 {
44  // Display options
45  m_PolarDisplay->SetSelection( m_frame->GetShowPolarCoords() ? 1 : 0 );
46  m_UnitsSelection->SetSelection( m_frame->GetUserUnits() == EDA_UNITS::INCHES ? 0 : 1 );
47 
48  // Editing options
50  m_MagneticPads->SetValue(
52 
53  return true;
54 }
55 
56 
58 {
59  // Display options
60  m_frame->SetShowPolarCoords( m_PolarDisplay->GetSelection() != 0 );
63 
64  // Editing options
68 
69  return true;
70 }
Class PANEL_MODEDIT_SETTINGS_BASE.
void SetShowPolarCoords(bool aShow)
bool m_Use45DegreeGraphicSegments
PANEL_MODEDIT_SETTINGS(FOOTPRINT_EDIT_FRAME *aFrame, PAGED_DIALOG *aWindow)
MAGNETIC_OPTIONS m_MagneticPads
FOOTPRINT_EDIT_FRAME * m_frame
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
PCBNEW_SETTINGS & Settings()
void SetUserUnits(EDA_UNITS aUnits)
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
bool TransferDataFromWindow() override