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
28#include <widgets/html_window.h>
29#include <widgets/wx_panel.h>
30#include <wx/checkbox.h>
31#include <wx/filedlgcustomize.h>
32#include <eda_draw_frame.h>
33
34
35class DESIGN_BLOCK;
37
38
40{
41public:
42 DESIGN_BLOCK_PANE( EDA_DRAW_FRAME* aParent, const LIB_ID* aPreselect, std::vector<LIB_ID>& aHistoryList );
43
44 ~DESIGN_BLOCK_PANE() override;
45
46 void SaveSettings();
47
48 LIB_ID GetSelectedLibId( int* aUnit = nullptr ) const;
49 void SelectLibId( const LIB_ID& aLibId );
50
60 DESIGN_BLOCK* GetDesignBlock( const LIB_ID& aLibId, bool aUseCacheLib, bool aShowErrorMsg );
61 DESIGN_BLOCK* GetSelectedDesignBlock( bool aUseCacheLib, bool aShowErrorMsg );
62
63 void RefreshLibs();
64
71 wxString CreateNewDesignBlockLibrary( const wxString& aDialogTitle );
72
79 bool AddDesignBlockLibrary( const wxString& aDialogTitle, const wxString& aFilename,
80 LIBRARY_TABLE_SCOPE aScope );
81
82 bool DeleteDesignBlockLibrary( const wxString& aLibName, bool aConfirm );
83
84 bool DeleteDesignBlockFromLibrary( const LIB_ID& aLibId, bool aConfirm );
85
86 bool EditDesignBlockProperties( const LIB_ID& aLibId );
87
89
90protected:
91 virtual void setLabelsAndTooltips() = 0;
92
93 virtual void OnLanguageChanged( wxCommandEvent& aEvent );
94 void OnClosed( wxAuiManagerEvent& aEvent );
95
98
99private:
100 bool checkOverwrite( wxWindow* aFrame, wxString& libname, wxString& newName );
101
102 wxString createNewDesignBlockLibrary( const wxString& aDialogTitle );
103};
104#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)
void SelectLibId(const LIB_ID &aLibId)
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
DESIGN_BLOCK_PANE(EDA_DRAW_FRAME *aParent, const LIB_ID *aPreselect, std::vector< LIB_ID > &aHistoryList)
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
DESIGN_BLOCK * GetSelectedDesignBlock(bool aUseCacheLib, bool aShowErrorMsg)
void OnClosed(wxAuiManagerEvent &aEvent)
bool AddDesignBlockLibrary(const wxString &aDialogTitle, const wxString &aFilename, LIBRARY_TABLE_SCOPE aScope)
Add an existing library to a library table (presumed to be either the global or project design block ...
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
WX_PANEL(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
Definition wx_panel.cpp:28
LIBRARY_TABLE_SCOPE