KiCad PCB EDA Suite
Loading...
Searching...
No Matches
design_block_pane.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
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23#ifndef DESIGN_BLOCK_PANE_H
24#define DESIGN_BLOCK_PANE_H
25
27#include <widgets/html_window.h>
28#include <widgets/wx_panel.h>
29#include <wx/checkbox.h>
30#include <wx/filedlgcustomize.h>
31#include <eda_draw_frame.h>
32
33
34class DESIGN_BLOCK;
36
37
39{
40public:
41 DESIGN_BLOCK_PANE( EDA_DRAW_FRAME* aParent, const LIB_ID* aPreselect, std::vector<LIB_ID>& aHistoryList );
42
43 ~DESIGN_BLOCK_PANE() override;
44
45 void SaveSettings();
46
47 LIB_ID GetSelectedLibId( int* aUnit = nullptr ) const;
48 void SelectLibId( const LIB_ID& aLibId );
49
59 DESIGN_BLOCK* GetDesignBlock( const LIB_ID& aLibId, bool aUseCacheLib, bool aShowErrorMsg );
60 DESIGN_BLOCK* GetSelectedDesignBlock( bool aUseCacheLib, bool aShowErrorMsg );
61
62 void RefreshLibs();
63
70 wxString CreateNewDesignBlockLibrary( const wxString& aDialogTitle );
71
78 bool AddDesignBlockLibrary( const wxString& aDialogTitle, const wxString& aFilename,
79 DESIGN_BLOCK_LIB_TABLE* aTable );
80
81 bool DeleteDesignBlockLibrary( const wxString& aLibName, bool aConfirm );
82
83 bool DeleteDesignBlockFromLibrary( const LIB_ID& aLibId, bool aConfirm );
84
85 bool EditDesignBlockProperties( const LIB_ID& aLibId );
86
88
89protected:
90 virtual void setLabelsAndTooltips() = 0;
91
92 virtual void OnLanguageChanged( wxCommandEvent& aEvent );
93 void OnClosed( wxAuiManagerEvent& aEvent );
94
97
98private:
99 bool checkOverwrite( wxWindow* aFrame, wxString& libname, wxString& newName );
100
101 wxString createNewDesignBlockLibrary( const wxString& aDialogTitle );
102};
103#endif
bool DeleteDesignBlockLibrary(const wxString &aLibName, bool aConfirm)
PANEL_DESIGN_BLOCK_CHOOSER * GetDesignBlockPanel() const
bool checkOverwrite(wxWindow *aFrame, wxString &libname, wxString &newName)
bool DeleteDesignBlockFromLibrary(const LIB_ID &aLibId, bool aConfirm)
~DESIGN_BLOCK_PANE() override
void SelectLibId(const LIB_ID &aLibId)
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
DESIGN_BLOCK * GetDesignBlock(const LIB_ID &aLibId, bool aUseCacheLib, bool aShowErrorMsg)
Load design block from design block library table.
wxString createNewDesignBlockLibrary(const wxString &aDialogTitle)
PANEL_DESIGN_BLOCK_CHOOSER * m_chooserPanel
bool EditDesignBlockProperties(const LIB_ID &aLibId)
virtual void setLabelsAndTooltips()=0
wxString CreateNewDesignBlockLibrary(const wxString &aDialogTitle)
Creates a new design block library.
virtual void OnLanguageChanged(wxCommandEvent &aEvent)
EDA_DRAW_FRAME * m_frame
bool AddDesignBlockLibrary(const wxString &aDialogTitle, const wxString &aFilename, DESIGN_BLOCK_LIB_TABLE *aTable)
Add an existing library to a library table (presumed to be either the global or project design block ...
DESIGN_BLOCK * GetSelectedDesignBlock(bool aUseCacheLib, bool aShowErrorMsg)
void OnClosed(wxAuiManagerEvent &aEvent)
The base class for create windows for drawing purpose.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49