KiCad PCB EDA Suite
panel_gerbview_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) 2010-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 #include <fctsys.h>
23 #include <common.h>
24 #include <gerbview.h>
25 #include <gerbview_frame.h>
26 
28 
29 
31  PANEL_GERBVIEW_SETTINGS_BASE( aWindow, wxID_ANY ),
32  m_Parent( aFrame )
33 {
34 }
35 
36 
38 {
39  m_PolarDisplay->SetSelection( m_Parent->GetShowPolarCoords() ? 1 : 0 );
40  m_BoxUnits->SetSelection( m_Parent->GetUserUnits() ? 1 : 0 );
42 
43  for( unsigned i = 0; i < arrayDim( g_GerberPageSizeList ); ++i )
44  {
46  {
47  m_PageSize->SetSelection( i );
48  break;
49  }
50  }
51 
52  return true;
53 }
54 
55 
57 {
58  m_Parent->SetShowPolarCoords( m_PolarDisplay->GetSelection() != 0 );
59  m_Parent->SetUserUnits( m_BoxUnits->GetSelection() == 0 ? INCHES : MILLIMETRES );
61 
62  PAGE_INFO pageInfo( g_GerberPageSizeList[ m_PageSize->GetSelection() ] );
63  m_Parent->SetPageSettings( pageInfo );
64 
65  return true;
66 }
67 
void SetUserUnits(EDA_UNITS_T aUnits)
void SetPageSettings(const PAGE_INFO &aPageSettings) override
void SetShowPolarCoords(bool aShow)
const wxString & GetType() const
Definition: page_info.h:97
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
Definition: common.h:155
GBR_DISPLAY_OPTIONS m_DisplayOptions
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:108
const PAGE_INFO & GetPageSettings() const override
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
EDA_UNITS_T GetUserUnits() const
Return the user units currently in use.
size_t i
Definition: json11.cpp:597
Class PANEL_GERBVIEW_SETTINGS_BASE.
The common library.
PANEL_GERBVIEW_SETTINGS(GERBVIEW_FRAME *aFrame, wxWindow *aWindow)
const wxChar * g_GerberPageSizeList[]
List of page sizes.
Definition: gerbview.cpp:35