KiCad PCB EDA Suite
symbol_filedlg_save_as.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) 2022 KiCad Developers, see AUTHORS.txt for contributors.
5*
6* This program is free software: you can redistribute it and/or modify it
7* under the terms of the GNU General Public License as published by the
8* Free Software Foundation, either version 3 of the License, or (at your
9* option) any later version.
10*
11* This program is distributed in the hope that it will be useful, but
12* WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14* General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License along
17* with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef SYMBOL_FILEDLG_SAVE_AS_
21#define SYMBOL_FILEDLG_SAVE_AS_
22
24#include <wx/filedlgcustomize.h>
25
26class SYMBOL_FILEDLG_SAVE_AS : public wxFileDialogCustomizeHook
27{
28public:
30
31 virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override
32 {
33 m_simpleSaveAs = customizer.AddRadioButton( _( "Do not update library tables" ) );
35 customizer.AddRadioButton( _( "Update existing library table entry" ) );
37 customizer.AddRadioButton( _( "Add new global library table entry" ) );
39 customizer.AddRadioButton( _( "Add new project library table entry" ) );
40
41 // Note, due to windows api, wx does not actually support calling SetValue( false ) (it asserts)
43 m_simpleSaveAs->SetValue( true );
44
46 m_replaceTableEntry->SetValue( true );
47
49 m_addGlobalTableEntry->SetValue( true );
50
52 m_addProjectTableEntry->SetValue( true );
53 }
54
55 virtual void TransferDataFromCustomControls() override
56 {
57 if( m_replaceTableEntry->GetValue() )
59 else if( m_addGlobalTableEntry->GetValue() )
61 else if( m_addProjectTableEntry->GetValue() )
63 else
65 }
66
68
69private:
71
72 wxFileDialogRadioButton* m_simpleSaveAs;
73 wxFileDialogRadioButton* m_replaceTableEntry;
74 wxFileDialogRadioButton* m_addGlobalTableEntry;
75 wxFileDialogRadioButton* m_addProjectTableEntry;
76
78};
79
80#endif
virtual void AddCustomControls(wxFileDialogCustomize &customizer) override
wxDECLARE_NO_COPY_CLASS(SYMBOL_FILEDLG_SAVE_AS)
SYMBOL_SAVEAS_TYPE GetOption() const
wxFileDialogRadioButton * m_addGlobalTableEntry
wxFileDialogRadioButton * m_simpleSaveAs
virtual void TransferDataFromCustomControls() override
wxFileDialogRadioButton * m_replaceTableEntry
wxFileDialogRadioButton * m_addProjectTableEntry
SYMBOL_FILEDLG_SAVE_AS(SYMBOL_SAVEAS_TYPE aOption)
#define _(s)
SYMBOL_SAVEAS_TYPE