KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_design_block_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 SCH_DESIGN_BLOCK_PREVIEW_WIDGET_H
21#define SCH_DESIGN_BLOCK_PREVIEW_WIDGET_H
22
23#include <wx/panel.h>
25#include <kiway.h>
28
29
30class LIB_ID;
31class DESIGN_BLOCK;
32class SCHEMATIC;
33class SCH_SHEET;
34class wxStaticText;
35class wxSizer;
36
37
39{
40public:
46 SCH_DESIGN_BLOCK_PREVIEW_WIDGET( wxWindow* aParent, EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType, bool aIncludeStatus );
47
49
50 /*
51 * Return whether the widget initialized properly. This could return false if Kiway is
52 * not available. If this returns false, no other methods should be called.
53 */
54 bool IsInitialized() const override { return m_preview != nullptr; }
55
59 void SetStatusText( const wxString& aText ) override;
60
64 void DisplayDesignBlock( DESIGN_BLOCK* aDesignBlock ) override;
65
66protected:
67 void onSize( wxSizeEvent& aEvent );
68
69 void fitOnDrawArea(); // set the view scale to fit the item on screen and center
70
73
74 wxStaticText* m_status;
75 wxPanel* m_statusPanel;
76 wxSizer* m_statusSizer;
77 wxSizer* m_outerSizer;
78
80
83};
84
85
86#endif
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
DESIGN_BLOCK_PREVIEW_WIDGET(wxWindow *aParent)
Construct a design block preview widget.
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:49
Holds all the data relating to one schematic.
Definition schematic.h:89
void SetStatusText(const wxString &aText) override
Set the contents of the status label and display it.
void DisplayDesignBlock(DESIGN_BLOCK *aDesignBlock) override
Set the currently displayed symbol.
bool IsInitialized() const override
Return whether the widget initialized properly.
BOX2I m_itemBBox
The bounding box of the current item.
SCH_DESIGN_BLOCK_PREVIEW_WIDGET(wxWindow *aParent, EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType, bool aIncludeStatus)
Construct a schematic design block preview widget.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:48