KiCad PCB EDA Suite
Loading...
Searching...
No Matches
symbol_preview_widget.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_PREVIEW_WIDGET_H
21#define SYMBOL_PREVIEW_WIDGET_H
22
23#include <wx/panel.h>
24#include <kiway.h>
27
28
29class LIB_ID;
30class LIB_SYMBOL;
31class wxStaticText;
32class wxSizer;
34
35
36class SYMBOL_PREVIEW_WIDGET: public wxPanel
37{
38public:
39
47 SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY* aKiway, bool aIncludeStatus,
48 EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
49
50 ~SYMBOL_PREVIEW_WIDGET() override;
51
55 void SetStatusText( const wxString& aText );
56
60 void DisplaySymbol( const LIB_ID& aSymbolID, int aUnit, int aBodyStyle = 0 );
61
62 void DisplayPart( LIB_SYMBOL* aSymbol, int aUnit, int aBodyStyle = 0 );
63
65
67
68protected:
69 void onSize( wxSizeEvent& aEvent );
70
71 void fitOnDrawArea(); // set the view scale to fit the item on screen and center
72
74
77
78 wxStaticText* m_status;
79 wxPanel* m_statusPanel;
80 wxSizer* m_statusSizer;
81 wxSizer* m_outerSizer;
82
88
91};
92
93
94#endif // SYMBOL_PREVIEW_WIDGET_H
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:286
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:49
Define a library symbol object.
Definition lib_symbol.h:85
LIB_SYMBOL * m_previewItem
A local copy of the LIB_SYMBOL to display on the canvas.
SYMBOL_PREVIEW_WIDGET(wxWindow *aParent, KIWAY *aKiway, bool aIncludeStatus, EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Construct a symbol preview widget.
EDA_DRAW_PANEL_GAL * GetCanvas() const
void SetStatusText(const wxString &aText)
Set the contents of the status label and display it.
EDA_DRAW_PANEL_GAL * m_preview
void onSize(wxSizeEvent &aEvent)
BOX2I m_itemBBox
The bounding box of the current item.
GAL_DISPLAY_OPTIONS_IMPL m_galDisplayOptions
SCH_RENDER_SETTINGS * m_renderSettings
SCH_RENDER_SETTINGS * GetRenderSettings()
void DisplaySymbol(const LIB_ID &aSymbolID, int aUnit, int aBodyStyle=0)
Set the currently displayed symbol.
void DisplayPart(LIB_SYMBOL *aSymbol, int aUnit, int aBodyStyle=0)