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 <class_drawpanel.h>
25 #include <gerbview.h>
26 #include <gerbview_frame.h>
27 
29 
30 
32  PANEL_GERBVIEW_SETTINGS_BASE( aWindow, wxID_ANY ),
33  m_Parent( aFrame )
34 {
35 }
36 
37 
39 {
41  m_BoxUnits->SetSelection( m_Parent->GetUserUnits() ? 1 : 0 );
43 
44  for( unsigned i = 0; i < DIM( g_GerberPageSizeList ); ++i )
45  {
47  {
48  m_PageSize->SetSelection( i );
49  break;
50  }
51  }
52 
53  return true;
54 }
55 
56 
58 {
59  m_Parent->m_DisplayOptions.m_DisplayPolarCood = ( m_PolarDisplay->GetSelection() != 0 );
60  m_Parent->SetUserUnits( m_BoxUnits->GetSelection() == 0 ? INCHES : MILLIMETRES );
62 
63  PAGE_INFO pageInfo( g_GerberPageSizeList[ m_PageSize->GetSelection() ] );
64  m_Parent->SetPageSettings( pageInfo );
65 
66  return true;
67 }
68 
#define DIM(x)
of elements in an array
Definition: macros.h:98
void SetPageSettings(const PAGE_INFO &aPageSettings) override
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
EDA_UNITS_T GetUserUnits() const override
Return the user units currently in use.
Definition: draw_frame.h:284
Definition: common.h:160
GBR_DISPLAY_OPTIONS m_DisplayOptions
bool m_DisplayPolarCood
Option to display coordinates in status bar in X,Y or Polar coords.
const PAGE_INFO & GetPageSettings() const override
size_t i
Definition: json11.cpp:597
Class PANEL_GERBVIEW_SETTINGS_BASE.
The common library.
PANEL_GERBVIEW_SETTINGS(GERBVIEW_FRAME *aFrame, wxWindow *aWindow)
const wxString & GetType() const
Definition: page_info.h:97
void SetUserUnits(EDA_UNITS_T aUnits)
Definition: draw_frame.h:285
const wxChar * g_GerberPageSizeList[]
List of page sizes.
Definition: gerbview.cpp:38