KiCad PCB EDA Suite
symbol_legacyfiledlg_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_LEGACYFILEDLG_SAVE_AS_
21#define SYMBOL_LEGACYFILEDLG_SAVE_AS_
22
24
25#include <wx/panel.h>
26#include <wx/radiobut.h>
27#include <wx/sizer.h>
28
32class SYMBOL_LEGACYFILEDLG_SAVE_AS : public wxPanel
33{
34public:
35 SYMBOL_LEGACYFILEDLG_SAVE_AS( wxWindow* aParent ) : wxPanel( aParent )
36 {
37 m_simpleSaveAs = new wxRadioButton( this, wxID_ANY, _( "Do not update library tables" ),
38 wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
39 m_simpleSaveAs->SetToolTip( _( "Do not perform any additional operations after saving "
40 "library." ) );
42 new wxRadioButton( this, wxID_ANY, _( "Update existing library table entry" ) );
43 m_replaceTableEntry->SetToolTip( _( "Update symbol library table entry to point to new "
44 "library.\n\n"
45 "The original library will no longer be available "
46 "for use." ) );
48 new wxRadioButton( this, wxID_ANY, _( "Add new global library table entry" ) );
49 m_addGlobalTableEntry->SetToolTip( _( "Add new entry to the global symbol library table."
50 "\n\nThe symbol library table nickname is suffixed "
51 "with\nan integer to prevent duplicate table "
52 "entries." ) );
54 new wxRadioButton( this, wxID_ANY, _( "Add new project library table entry" ) );
55 m_addProjectTableEntry->SetToolTip( _( "Add new entry to the project symbol library table."
56 "\n\nThe symbol library table nickname is suffixed "
57 "with\nan integer to prevent duplicate table "
58 "entries." ) );
59
60 wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
61 sizer->Add( m_simpleSaveAs, 0, wxLEFT | wxRIGHT | wxTOP, 5 );
62 sizer->Add( m_replaceTableEntry, 0, wxLEFT | wxRIGHT | wxTOP, 5 );
63 sizer->Add( m_addGlobalTableEntry, 0, wxLEFT | wxRIGHT | wxTOP, 5 );
64 sizer->Add( m_addProjectTableEntry, 0, wxLEFT | wxRIGHT | wxTOP | wxBOTTOM, 5 );
65
66 SetSizerAndFit( sizer );
67
69 }
70
72
74 {
79 }
80
82 {
83 if( m_replaceTableEntry->GetValue() )
85 else if( m_addGlobalTableEntry->GetValue() )
87 else if( m_addProjectTableEntry->GetValue() )
89 else
91 }
92
101 static wxWindow* Create( wxWindow* aParent )
102 {
103 wxCHECK( aParent, nullptr );
104
105 return new SYMBOL_LEGACYFILEDLG_SAVE_AS( aParent );
106 }
107
108private:
110
111 wxRadioButton* m_simpleSaveAs;
112 wxRadioButton* m_replaceTableEntry;
113 wxRadioButton* m_addGlobalTableEntry;
115};
116
117#endif
Helper control to inquire user what to do on library save as operation.
void SetOption(SYMBOL_SAVEAS_TYPE aOption)
SYMBOL_SAVEAS_TYPE GetOption() const
static wxWindow * Create(wxWindow *aParent)
Create a new panel to add to a wxFileDialog object.
#define _(s)
SYMBOL_SAVEAS_TYPE