KiCad PCB EDA Suite
Loading...
Searching...
No Matches
filedlg_hook_new_library.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#pragma once
21
22#include <wx/wx.h>
23#include <wx/filedlgcustomize.h>
24
25
26class FILEDLG_HOOK_NEW_LIBRARY : public wxFileDialogCustomizeHook
27{
28public:
29 FILEDLG_HOOK_NEW_LIBRARY( bool aDefaultUseGlobalTable ) :
30 m_useGlobalTable( aDefaultUseGlobalTable )
31 {};
32
33 virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override
34 {
35 m_addGlobalTableEntry = customizer.AddRadioButton( _( "Add new library to global library table" ) );
36 customizer.AddStaticText( wxS( " " ) );
37 m_addProjectTableEntry = customizer.AddRadioButton( _( "Add new library to project library table" ) );
38
40 m_addGlobalTableEntry->SetValue( true );
41 else
42 m_addProjectTableEntry->SetValue( true );
43 }
44
45 virtual void TransferDataFromCustomControls() override
46 {
48 }
49
50 bool GetUseGlobalTable() const { return m_useGlobalTable; }
51
52private:
54
55 wxFileDialogRadioButton* m_addGlobalTableEntry = nullptr;
56 wxFileDialogRadioButton* m_addProjectTableEntry = nullptr;
57
59};
60
wxFileDialogRadioButton * m_addGlobalTableEntry
virtual void AddCustomControls(wxFileDialogCustomize &customizer) override
wxFileDialogRadioButton * m_addProjectTableEntry
FILEDLG_HOOK_NEW_LIBRARY(bool aDefaultUseGlobalTable)
wxDECLARE_NO_COPY_CLASS(FILEDLG_HOOK_NEW_LIBRARY)
virtual void TransferDataFromCustomControls() override
#define _(s)