KiCad PCB EDA Suite
cvpcb/dialogs/dialog_display_options.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 
28 #include <fctsys.h>
29 
30 #include <wxstruct.h>
31 #include <common.h>
32 #include <cvpcb.h>
33 #include <class_drawpanel.h>
34 #include <listview_classes.h>
36 
37 #include <dialog_display_options.h>
38 
39 
41 {
42  DIALOG_FOOTPRINTS_DISPLAY_OPTIONS* OptionWindow =
44 
45  OptionWindow->ShowModal();
46  OptionWindow->Destroy();
47 }
48 
49 
52 {
53  m_Parent = parent;
54 
55  initDialog();
56  m_sdbSizer1OK->SetDefault();
57  GetSizer()->SetSizeHints( this );
58  Centre();
59 }
60 
62 {
63 }
64 
65 
71 {
72  /* mandatory to use escape key as cancel under wxGTK. */
73  SetFocus();
74 
76 
77  m_EdgesDisplayOption->SetValue( not displ_opts->m_DisplayModEdgeFill );
78  m_TextDisplayOption->SetValue( not displ_opts->m_DisplayModTextFill );
79  m_ShowPadSketch->SetValue( not displ_opts->m_DisplayPadFill );
80  m_ShowPadNum->SetValue( displ_opts->m_DisplayPadNum );
82 }
83 
84 
85 
91 {
93 
94  displ_opts->m_DisplayModEdgeFill = not m_EdgesDisplayOption->GetValue();
95  displ_opts->m_DisplayModTextFill = not m_TextDisplayOption->GetValue();
96  displ_opts->m_DisplayPadNum = m_ShowPadNum->GetValue();
97  displ_opts->m_DisplayPadFill = not m_ShowPadSketch->GetValue();
100 }
101 
102 
107 void DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::OnOkClick( wxCommandEvent& event )
108 {
110  EndModal( 1 );
111 }
112 
113 
119 {
120  EndModal( -1 );
121 }
122 
123 
129 {
131 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:325
void SetEnableZoomNoCenter(bool aEnable)
Definition: draw_panel.cpp:656
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:337
void InstallOptionsDisplay(wxCommandEvent &event)
void OnApplyClick(wxCommandEvent &event) override
bool m_DisplayModEdgeFill
Definition: pcbstruct.h:69
void OnCancelClick(wxCommandEvent &event) override
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
Base window classes and related definitions.
bool GetEnableZoomNoCenter() const
Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE.
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
bool m_DisplayPadFill
Definition: pcbstruct.h:65
bool m_DisplayPadNum
Definition: pcbstruct.h:67
The common library.
bool m_DisplayModTextFill
Definition: pcbstruct.h:70
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...