KiCad PCB EDA Suite
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-2018 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 
26 #include <common.h>
27 #include <cvpcb.h>
28 #include <class_drawpanel.h>
30 
31 #include <dialog_display_options.h>
32 
33 
35 {
36  DIALOG_FOOTPRINTS_DISPLAY_OPTIONS OptionWindow( this );
37 
38  OptionWindow.ShowModal();
39 }
40 
41 
44 {
45  m_Parent = parent;
46 
47  initDialog();
48  m_sdbSizerOK->SetDefault();
49 
51 }
52 
53 
55 {
56 }
57 
58 
60 {
61  /* mandatory to use escape key as cancel under wxGTK. */
62  SetFocus();
63 
64  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
65 
66  m_EdgesDisplayOption->SetValue( not displ_opts->m_DisplayModEdgeFill );
67  m_TextDisplayOption->SetValue( not displ_opts->m_DisplayModTextFill );
68  m_ShowPadSketch->SetValue( not displ_opts->m_DisplayPadFill );
69  m_ShowPadNum->SetValue( displ_opts->m_DisplayPadNum );
70 
71  m_autoZoomOption->SetValue( m_Parent->GetAutoZoom() );
72 }
73 
74 
76 {
77  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_Parent->GetDisplayOptions();
78 
79  displ_opts->m_DisplayModEdgeFill = not m_EdgesDisplayOption->GetValue();
80  displ_opts->m_DisplayModTextFill = not m_TextDisplayOption->GetValue();
81  displ_opts->m_DisplayPadNum = m_ShowPadNum->GetValue();
82  displ_opts->m_DisplayPadFill = not m_ShowPadSketch->GetValue();
84 
85  m_Parent->SetAutoZoom( m_autoZoomOption->GetValue() );
86 }
87 
88 
90 {
92  return true;
93 }
94 
95 
97 {
99 }
void InstallOptionsDisplay(wxCommandEvent &event)
void OnApplyClick(wxCommandEvent &event) override
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void ApplyDisplaySettingsToGAL()
Updates the GAL with display settings changes.
Class DISPLAY_FOOTPRINTS_FRAME is used to display footprints.
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings...
Class DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE.
DISPLAY_FOOTPRINTS_FRAME * m_Parent
The common library.
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS(DISPLAY_FOOTPRINTS_FRAME *parent)