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 (C) 2018-2021 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;
33
34
35class SYMBOL_PREVIEW_WIDGET: public wxPanel
36{
37public:
38
46 SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY* aKiway, bool aIncludeStatus,
47 EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
48
49 ~SYMBOL_PREVIEW_WIDGET() override;
50
54 void SetStatusText( const wxString& aText );
55
59 void DisplaySymbol( const LIB_ID& aSymbolID, int aUnit, int aBodyStyle = 0 );
60
61 void DisplayPart( LIB_SYMBOL* aSymbol, int aUnit, int aBodyStyle = 0 );
62
63protected:
64 void onSize( wxSizeEvent& aEvent );
65
66 void fitOnDrawArea(); // set the view scale to fit the item on screen and center
67
69
72
73 wxStaticText* m_status;
74 wxPanel* m_statusPanel;
75 wxSizer* m_statusSizer;
76 wxSizer* m_outerSizer;
77
82
85};
86
87
88#endif // SYMBOL_PREVIEW_WIDGET_H
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:279
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:77
LIB_SYMBOL * m_previewItem
A local copy of the LIB_SYMBOL to display on the canvas.
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
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)