34 #include <wx/checkbox.h> 35 #include <wx/filepicker.h> 36 #include <wx/statline.h> 40 const wxString& aPath )
41 :
DIALOG_SHIM( aParent, wxID_ANY,
_(
"Export to GenCAD settings" ), wxDefaultPosition,
42 wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
44 wxBoxSizer* m_mainSizer=
new wxBoxSizer( wxVERTICAL );
49 _(
"Select a GenCAD export filename"),
51 wxDefaultPosition, wxSize( -1,-1 ),
52 wxFLP_SAVE|wxFLP_USE_TEXTCTRL );
53 m_mainSizer->Add(
m_filePicker, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 5 );
57 m_mainSizer->Add(
m_optsSizer, 1, wxEXPAND | wxALL, 10 );
59 wxSizer* stdButtons = CreateSeparatedButtonSizer( wxOK | wxCANCEL );
60 m_mainSizer->Add( stdButtons, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
62 SetSizer( m_mainSizer );
86 wxASSERT_MSG(
false, wxT(
"Missing checkbox for an option" ) );
90 return it->second->IsChecked();
96 std::map<GENCAD_EXPORT_OPT, bool> retVal;
99 retVal[option.first] = option.second->IsChecked();
113 if( !wxDialog::TransferDataFromWindow() )
118 if( wxFile::Exists( fn ) )
121 KIDIALOG dlg(
this, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
122 dlg.SetOKLabel(
_(
"Overwrite" ) );
134 std::map<GENCAD_EXPORT_OPT, wxString> opts =
138 {
INDIVIDUAL_SHAPES,
_(
"Generate a new shape for each footprint instance (do not reuse shapes)" ) },
143 for(
const auto& option : opts )
145 wxCheckBox* chkbox =
new wxCheckBox(
this, wxID_ANY, option.second );
bool GetOption(GENCAD_EXPORT_OPT aOption) const
Return all export settings.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
This file is part of the common library.
bool TransferDataFromWindow() override
Create checkboxes for GenCAD export options.
~DIALOG_GENCAD_EXPORT_OPTIONS()
Check whether an option has been selected.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
std::map< GENCAD_EXPORT_OPT, bool > GetAllOptions() const
Return the selected file path.
wxString GetFileName() const
wxString GencadFileWildcard()
std::map< GENCAD_EXPORT_OPT, wxCheckBox * > m_options
Definition of file extensions used in Kicad.
GENCAD_EXPORT_OPT
Settings for GenCAD exporter.
DIALOG_GENCAD_EXPORT_OPTIONS(PCB_EDIT_FRAME *aParent, const wxString &aPath)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
The main frame for Pcbnew.
wxGridSizer * m_optsSizer
wxFilePickerCtrl * m_filePicker
void createOptCheckboxes()