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
27
#include "
panel_gerbview_settings.h
"
28
29
30
PANEL_GERBVIEW_SETTINGS::PANEL_GERBVIEW_SETTINGS
(
GERBVIEW_FRAME
*aFrame, wxWindow* aWindow ) :
31
PANEL_GERBVIEW_SETTINGS_BASE
( aWindow, wxID_ANY ),
32
m_Parent( aFrame )
33
{
34
}
35
36
37
bool
PANEL_GERBVIEW_SETTINGS::TransferDataToWindow
( )
38
{
39
m_PolarDisplay
->SetSelection(
m_Parent
->
GetShowPolarCoords
() ? 1 : 0 );
40
m_BoxUnits
->SetSelection(
m_Parent
->
GetUserUnits
() ? 1 : 0 );
41
m_ShowPageLimitsOpt
->SetValue(
m_Parent
->
GetDisplayOptions
().
m_DisplayPageLimits
);
42
43
for
(
unsigned
i
= 0;
i
<
arrayDim
(
g_GerberPageSizeList
); ++
i
)
44
{
45
if
(
g_GerberPageSizeList
[
i
] ==
m_Parent
->
GetPageSettings
().
GetType
() )
46
{
47
m_PageSize
->SetSelection(
i
);
48
break
;
49
}
50
}
51
52
return
true
;
53
}
54
55
56
bool
PANEL_GERBVIEW_SETTINGS::TransferDataFromWindow
()
57
{
58
m_Parent
->
SetShowPolarCoords
(
m_PolarDisplay
->GetSelection() != 0 );
59
m_Parent
->
SetUserUnits
(
m_BoxUnits
->GetSelection() == 0 ?
INCHES
:
MILLIMETRES
);
60
61
auto
opts =
m_Parent
->
GetDisplayOptions
();
62
opts.
m_DisplayPageLimits
=
m_ShowPageLimitsOpt
->GetValue();
63
64
PAGE_INFO
pageInfo(
g_GerberPageSizeList
[
m_PageSize
->GetSelection() ] );
65
m_Parent
->
SetPageSettings
( pageInfo );
66
67
m_Parent
->
UpdateDisplayOptions
( opts );
68
69
return
true
;
70
}
71
gerbview.h
PANEL_GERBVIEW_SETTINGS_BASE::m_ShowPageLimitsOpt
wxCheckBox * m_ShowPageLimitsOpt
Definition:
panel_gerbview_settings_base.h:39
EDA_BASE_FRAME::SetUserUnits
void SetUserUnits(EDA_UNITS_T aUnits)
Definition:
eda_base_frame.h:211
PANEL_GERBVIEW_SETTINGS::m_Parent
GERBVIEW_FRAME * m_Parent
Definition:
panel_gerbview_settings.h:35
PANEL_GERBVIEW_SETTINGS::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition:
panel_gerbview_settings.cpp:56
PANEL_GERBVIEW_SETTINGS_BASE::m_BoxUnits
wxRadioBox * m_BoxUnits
Definition:
panel_gerbview_settings_base.h:37
GERBVIEW_FRAME::SetPageSettings
void SetPageSettings(const PAGE_INFO &aPageSettings) override
Definition:
gerbview_frame.cpp:892
EDA_DRAW_FRAME::SetShowPolarCoords
void SetShowPolarCoords(bool aShow)
Definition:
eda_draw_frame.h:211
GERBVIEW_FRAME::GetDisplayOptions
const GBR_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions returns the display options current in use.
Definition:
gerbview_frame.h:71
PAGE_INFO::GetType
const wxString & GetType() const
Definition:
page_info.h:97
PANEL_GERBVIEW_SETTINGS_BASE::m_PolarDisplay
wxRadioBox * m_PolarDisplay
Definition:
panel_gerbview_settings_base.h:36
GERBVIEW_FRAME::UpdateDisplayOptions
void UpdateDisplayOptions(const GBR_DISPLAY_OPTIONS &aOptions)
Updates the display options and refreshes the view as needed.
Definition:
gerbview_frame.cpp:607
PAGE_INFO
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
INCHES
Definition:
common.h:134
MILLIMETRES
Definition:
common.h:135
panel_gerbview_settings.h
arrayDim
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition:
macros.h:108
PANEL_GERBVIEW_SETTINGS_BASE::m_PageSize
wxRadioBox * m_PageSize
Definition:
panel_gerbview_settings_base.h:38
fctsys.h
GERBVIEW_FRAME::GetPageSettings
const PAGE_INFO & GetPageSettings() const override
Definition:
gerbview_frame.cpp:917
EDA_DRAW_FRAME::GetShowPolarCoords
bool GetShowPolarCoords() const
For those frames that support polar coordinates.
Definition:
eda_draw_frame.h:210
GERBVIEW_FRAME
Definition:
gerbview_frame.h:58
EDA_BASE_FRAME::GetUserUnits
EDA_UNITS_T GetUserUnits() const
Return the user units currently in use.
Definition:
eda_base_frame.h:210
i
size_t i
Definition:
json11.cpp:649
PANEL_GERBVIEW_SETTINGS_BASE
Class PANEL_GERBVIEW_SETTINGS_BASE.
Definition:
panel_gerbview_settings_base.h:30
common.h
The common library.
PANEL_GERBVIEW_SETTINGS::PANEL_GERBVIEW_SETTINGS
PANEL_GERBVIEW_SETTINGS(GERBVIEW_FRAME *aFrame, wxWindow *aWindow)
Definition:
panel_gerbview_settings.cpp:30
PANEL_GERBVIEW_SETTINGS::TransferDataToWindow
bool TransferDataToWindow() override
Definition:
panel_gerbview_settings.cpp:37
GBR_DISPLAY_OPTIONS::m_DisplayPageLimits
bool m_DisplayPageLimits
Definition:
gbr_display_options.h:46
gerbview_frame.h
g_GerberPageSizeList
const wxChar * g_GerberPageSizeList[]
List of page sizes.
Definition:
gerbview.cpp:38
gerbview
dialogs
panel_gerbview_settings.cpp
Generated on Sun Nov 17 2019 23:54:47 for KiCad PCB EDA Suite by
1.8.15