KiCad PCB EDA Suite
dialog_gencad_export_options.h
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 CERN
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef __DIALOG_GENCAD_EXPORT_OPTIONS_H__
26 #define __DIALOG_GENCAD_EXPORT_OPTIONS_H__
27 
28 #include <dialog_shim.h>
29 
30 class PCB_EDIT_FRAME;
31 class wxTextCtrl;
32 
35 {
36  FLIP_BOTTOM_PADS, // flip bottom components padstacks geometry
37  UNIQUE_PIN_NAMES, // generate unique pin names
38  INDIVIDUAL_SHAPES, // generate a shape for each component
39  USE_AUX_ORIGIN, // use auxiliary axis as origin
40  STORE_ORIGIN_COORDS // saves the origin point coordinates or (0, 0)
41 };
42 
43 
45 {
46  public:
49 
51  bool GetOption( GENCAD_EXPORT_OPT aOption ) const;
52 
54  std::map<GENCAD_EXPORT_OPT, bool> GetAllOptions() const;
55 
57  wxString GetFileName() const;
58 
59  protected:
60  bool TransferDataFromWindow() override;
61 
63  void createOptCheckboxes();
64 
66  void onBrowse( wxCommandEvent& aEvent );
67 
68  std::map<GENCAD_EXPORT_OPT, wxCheckBox*> m_options;
69 
70  // Widgets
71  wxGridSizer* m_optsSizer;
72  wxTextCtrl* m_filePath;
73 };
74 
75 #endif //__DIALOG_GENCAD_EXPORT_OPTIONS_H__
void onBrowse(wxCommandEvent &aEvent)
Browse output file event handler
std::map< GENCAD_EXPORT_OPT, bool > GetAllOptions() const
Returns all export settings
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:82
bool GetOption(GENCAD_EXPORT_OPT aOption) const
Checks whether an option has been selected
std::map< GENCAD_EXPORT_OPT, wxCheckBox * > m_options
GENCAD_EXPORT_OPT
Settings for GenCAD exporter
Class PCB_EDIT_FRAME is the main frame for Pcbnew.
wxString GetFileName() const
Returns the selected file path
DIALOG_GENCAD_EXPORT_OPTIONS(PCB_EDIT_FRAME *aParent)
void createOptCheckboxes()
Creates checkboxes for GenCAD export options