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 <fctsys.h>
25 #include <pcbnew.h>
26 #include <pcb_edit_frame.h>
27 #include <board_design_settings.h>
28 #include <widgets/paged_dialog.h>
29 #include <footprint_edit_frame.h>
30 
31 #include <panel_modedit_settings.h>
32 
33 
35  PAGED_DIALOG* aParent) :
36  PANEL_MODEDIT_SETTINGS_BASE( aParent->GetTreebook() ),
37  m_frame( aFrame )
38 {}
39 
40 
42 {
43  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
44 
45  // Display options
46  m_PolarDisplay->SetSelection( displ_opts->m_DisplayPolarCood ? 1 : 0 );
47  m_UnitsSelection->SetSelection( m_frame->GetUserUnits() == INCHES ? 0 : 1 );
48 
49  // Editing options
53 
54  return true;
55 }
56 
57 
59 {
60  // Display options
61  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
62  displ_opts->m_DisplayPolarCood = m_PolarDisplay->GetSelection() != 0;
63 
64  m_frame->SetUserUnits( m_UnitsSelection->GetSelection() == 0 ? INCHES : MILLIMETRES );
65 
66  // Editing options
70 
71  return true;
72 }
Class PANEL_MODEDIT_SETTINGS_BASE.
MAGNETIC_PAD_OPTION_VALUES m_magneticPads
Definition of class FOOTPRINT_EDIT_FRAME.
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
static bool m_use45DegreeGraphicSegments
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings...
PANEL_MODEDIT_SETTINGS(FOOTPRINT_EDIT_FRAME *aFrame, PAGED_DIALOG *aWindow)
PCB_GENERAL_SETTINGS & Settings()
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:284
Definition: common.h:160
FOOTPRINT_EDIT_FRAME * m_frame
void SetUserUnits(EDA_UNITS_T aUnits)
Definition: draw_frame.h:285
bool TransferDataFromWindow() override