KiCad PCB EDA Suite
dialog_block_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) 2017 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 
25 #include <dialog_block_options.h>
26 
27 #include <wxPcbStruct.h>
28 
29 
31  OPTIONS& aOptions, bool aShowLegacyOptions,
32  const wxString& aTitle ) :
33  DIALOG_BLOCK_OPTIONS_BASE( aParent, -1, aTitle ),
34  m_options( aOptions )
35 {
36  if( !aShowLegacyOptions )
37  {
38  m_DrawBlockItems->Hide();
39  }
40 
43 
44  if( m_Include_Modules->GetValue() )
45  m_IncludeLockedModules->Enable();
46  else
47  m_IncludeLockedModules->Disable();
48 
56 
57  m_sdbSizer1OK->SetDefault();
58  SetFocus();
59  GetSizer()->SetSizeHints( this );
60  Centre();
61 }
62 
63 
64 void DIALOG_BLOCK_OPTIONS::checkBoxClicked( wxCommandEvent& aEvent )
65 {
66  if( m_Include_Modules->GetValue() )
67  m_IncludeLockedModules->Enable();
68  else
69  m_IncludeLockedModules->Disable();
70 }
71 
72 
73 void DIALOG_BLOCK_OPTIONS::ExecuteCommand( wxCommandEvent& event )
74 {
82  m_options.drawItems = m_DrawBlockItems->GetValue();
84 
85  EndModal( wxID_OK );
86 }
void checkBoxClicked(wxCommandEvent &aEvent) override
Reference to the options struct to fill.
void ExecuteCommand(wxCommandEvent &event) override
Struct that will be set with the result of the user choices in the dialog.
Class DIALOG_BLOCK_OPTIONS_BASE.
DIALOG_BLOCK_OPTIONS(PCB_BASE_FRAME *aParent, OPTIONS &aOptions, bool aShowLegacyOptions, const wxString &aTitle)
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...