KiCad PCB EDA Suite
dialog_fp_browser_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) 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 <class_drawpanel.h>
28 #include <footprint_viewer_frame.h>
29 
31 
32 
33 void FOOTPRINT_VIEWER_FRAME::InstallDisplayOptions( wxCommandEvent& event )
34 {
36 
37  dlg.ShowModal();
38 }
39 
40 
43  m_frame( aParent )
44 {
45  initDialog();
46  m_sdbSizerOK->SetDefault();
47 
49 }
50 
51 
53 {
54 }
55 
56 
58 {
59  /* mandatory to use escape key as cancel under wxGTK. */
60  SetFocus();
61 
62  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
63 
64  m_EdgesDisplayOption->SetValue( not displ_opts->m_DisplayModEdgeFill );
65  m_TextDisplayOption->SetValue( not displ_opts->m_DisplayModTextFill );
66  m_ShowPadSketch->SetValue( not displ_opts->m_DisplayPadFill );
67  m_ShowPadNum->SetValue( displ_opts->m_DisplayPadNum );
68 
69  m_autoZoomOption->SetValue( m_frame->GetAutoZoom() );
70 }
71 
72 
74 {
75  auto displ_opts = (PCB_DISPLAY_OPTIONS*)m_frame->GetDisplayOptions();
76 
77  displ_opts->m_DisplayModEdgeFill = not m_EdgesDisplayOption->GetValue();
78  displ_opts->m_DisplayModTextFill = not m_TextDisplayOption->GetValue();
79  displ_opts->m_DisplayPadNum = m_ShowPadNum->GetValue();
80  displ_opts->m_DisplayPadFill = not m_ShowPadSketch->GetValue();
82 
83  m_frame->SetAutoZoom( m_autoZoomOption->GetValue() );
84 }
85 
86 
88 {
90  return true;
91 }
92 
93 
95 {
97 }
DIALOG_FP_BROWSER_DISPLAY_OPTIONS(FOOTPRINT_VIEWER_FRAME *aParent)
Component library viewer main window.
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Class DIALOG_FP_BROWSER_DISPLAY_OPTIONS_BASE.
void SetAutoZoom(bool aEnable)
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
void ApplyDisplaySettingsToGAL()
Updates the GAL with display settings changes.
Class PCB_DISPLAY_OPTIONS handles display options like enable/disable some optional drawings...
void OnApplyClick(wxCommandEvent &event) override
void InstallDisplayOptions(wxCommandEvent &event)
The common library.