KiCad PCB EDA Suite
Loading...
Searching...
No Matches
symbol_library_save_as_filedlg_hook.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 The 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_LIBRARY_SAVE_AS_FILEDLG_HOOK : public wxFileDialogCustomizeHook
27{
28public:
32
33 virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override
34 {
35 wxString padding;
36#ifdef __WXMAC__
37 padding = wxT( " " );
38 customizer.AddStaticText( padding + wxT( "\n\n" ) ); // Increase height of static box
39#endif
40
41 // Radio buttons are only grouped if they are consecutive. If we want padding, we need to add it
42 // to the radio button labels
43 m_simpleSaveAs = customizer.AddRadioButton( _( "Do not update library tables" ) + padding );
44 m_replaceTableEntry = customizer.AddRadioButton( _( "Update existing library table entry" ) + padding );
45 m_addGlobalTableEntry = customizer.AddRadioButton( _( "Add new global library table entry" ) + padding );
46 m_addProjectTableEntry = customizer.AddRadioButton( _( "Add new project library table entry" ) + padding );
47
48 // Note, due to windows api, wx does not actually support calling SetValue( false ) (it asserts)
50 m_simpleSaveAs->SetValue( true );
51
53 m_replaceTableEntry->SetValue( true );
54
56 m_addGlobalTableEntry->SetValue( true );
57
59 m_addProjectTableEntry->SetValue( true );
60 }
61
73
75
76private:
78
79 wxFileDialogRadioButton* m_simpleSaveAs = nullptr;
80 wxFileDialogRadioButton* m_replaceTableEntry = nullptr;
81 wxFileDialogRadioButton* m_addGlobalTableEntry = nullptr;
82 wxFileDialogRadioButton* m_addProjectTableEntry = nullptr;
83
85};
86
87#endif
virtual void AddCustomControls(wxFileDialogCustomize &customizer) override
wxDECLARE_NO_COPY_CLASS(SYMBOL_LIBRARY_SAVE_AS_FILEDLG_HOOK)
#define _(s)
SYMBOL_SAVEAS_TYPE