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 #include <common.h>
26 #include <footprint_viewer_frame.h>
28 
29 
30 void FOOTPRINT_VIEWER_FRAME::InstallDisplayOptions( wxCommandEvent& event )
31 {
33 
34  dlg.ShowModal();
35 }
36 
37 
40  m_frame( aParent )
41 {
42  initDialog();
43  m_sdbSizerOK->SetDefault();
44 
46 }
47 
48 
50 {
51 }
52 
53 
55 {
56  SetFocus(); // mandatory to use escape key as cancel under wxGTK.
57 
58  const PCB_DISPLAY_OPTIONS& displ_opts = m_frame->GetDisplayOptions();
59 
60  m_EdgesDisplayOption->SetValue( not displ_opts.m_DisplayModEdgeFill );
61  m_TextDisplayOption->SetValue( not displ_opts.m_DisplayModTextFill );
62  m_ShowPadSketch->SetValue( not displ_opts.m_DisplayPadFill );
63  m_ShowPadNum->SetValue( displ_opts.m_DisplayPadNum );
64 
65  m_autoZoomOption->SetValue( m_frame->GetAutoZoom() );
66 }
67 
68 
70 {
72 
73  displ_opts.m_DisplayModEdgeFill = not m_EdgesDisplayOption->GetValue();
74  displ_opts.m_DisplayModTextFill = not m_TextDisplayOption->GetValue();
75  displ_opts.m_DisplayPadNum = m_ShowPadNum->GetValue();
76  displ_opts.m_DisplayPadFill = not m_ShowPadSketch->GetValue();
77  m_frame->SetDisplayOptions( displ_opts );
79 
80  m_frame->SetAutoZoom( m_autoZoomOption->GetValue() );
81 }
82 
83 
85 {
87  return true;
88 }
89 
90 
92 {
94 }
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 SetDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Function GetDisplayOptions returns the display options current in use Display options are relative to...
void InstallDisplayOptions(wxCommandEvent &aEvent)
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
The common library.