![]() |
KiCad PCB EDA Suite
|
#include <symbol_preview_widget.h>
Public Member Functions | |
SYMBOL_PREVIEW_WIDGET (wxWindow *aParent, KIWAY &aKiway, EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType) | |
Construct a symbol preview widget. More... | |
~SYMBOL_PREVIEW_WIDGET () override | |
void | SetStatusText (const wxString &aText) |
Set the contents of the status label and display it. More... | |
void | DisplaySymbol (const LIB_ID &aSymbolID, int aUnit, int aConvert=0) |
Set the currently displayed symbol. More... | |
void | DisplayPart (LIB_SYMBOL *aSymbol, int aUnit, int aConvert=0) |
Private Member Functions | |
void | onSize (wxSizeEvent &aEvent) |
void | fitOnDrawArea () |
Private Attributes | |
KIWAY & | m_kiway |
KIGFX::GAL_DISPLAY_OPTIONS | m_galDisplayOptions |
EDA_DRAW_PANEL_GAL * | m_preview |
wxStaticText * | m_status |
wxPanel * | m_statusPanel |
wxSizer * | m_statusSizer |
wxSizer * | m_outerSizer |
LIB_SYMBOL * | m_previewItem |
A local copy of the LIB_SYMBOL to display on the canvas. More... | |
BOX2I | m_itemBBox |
The bounding box of the current item. More... | |
Definition at line 35 of file symbol_preview_widget.h.
SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET | ( | wxWindow * | aParent, |
KIWAY & | aKiway, | ||
EDA_DRAW_PANEL_GAL::GAL_TYPE | aCanvasType | ||
) |
Construct a symbol preview widget.
aParent | - parent window |
aKiway | - an active Kiway instance |
aCanvasType | = the type of canvas (GAL_TYPE_OPENGL or GAL_TYPE_CAIRO only) |
Definition at line 34 of file symbol_preview_widget.cpp.
References EDA_DRAW_PANEL_GAL::GAL_FALLBACK, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, EDA_DRAW_PANEL_GAL::GetGAL(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), EDA_DRAW_PANEL_GAL::GetView(), LAYER_REFERENCEPART, KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, m_galDisplayOptions, m_outerSizer, m_preview, m_status, m_statusPanel, m_statusSizer, onSize(), Pgm(), KIGFX::GAL_DISPLAY_OPTIONS::ReadConfig(), KIGFX::GAL::SetAxesEnabled(), KIGFX::GAL::SetClearColor(), KIGFX::GAL::SetGridVisibility(), and EDA_DRAW_PANEL_GAL::SetStealsFocus().
|
override |
Definition at line 112 of file symbol_preview_widget.cpp.
References EDA_DRAW_PANEL_GAL::GetView(), m_preview, m_previewItem, and KIGFX::VIEW::Remove().
void SYMBOL_PREVIEW_WIDGET::DisplayPart | ( | LIB_SYMBOL * | aSymbol, |
int | aUnit, | ||
int | aConvert = 0 |
||
) |
Definition at line 228 of file symbol_preview_widget.cpp.
References KIGFX::VIEW::Add(), fitOnDrawArea(), EDA_DRAW_PANEL_GAL::ForceRefresh(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), LIB_SYMBOL::GetUnitBoundingBox(), EDA_DRAW_PANEL_GAL::GetView(), LIB_SYMBOL::HasConversion(), LIB_SYMBOL::IsMulti(), m_itemBBox, m_preview, m_previewItem, m_statusPanel, and KIGFX::VIEW::Remove().
Referenced by DIALOG_RESCUE_EACH::displayItemsInConflict().
void SYMBOL_PREVIEW_WIDGET::DisplaySymbol | ( | const LIB_ID & | aSymbolID, |
int | aUnit, | ||
int | aConvert = 0 |
||
) |
Set the currently displayed symbol.
Definition at line 166 of file symbol_preview_widget.cpp.
References _, KIGFX::VIEW::Add(), fitOnDrawArea(), LIB_SYMBOL::Flatten(), EDA_DRAW_PANEL_GAL::ForceRefresh(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), LIB_SYMBOL::GetUnitBoundingBox(), EDA_DRAW_PANEL_GAL::GetView(), LIB_SYMBOL::HasConversion(), LIB_SYMBOL::IsMulti(), m_itemBBox, m_kiway, m_preview, m_previewItem, m_statusPanel, KIWAY::Prj(), KIGFX::VIEW::Remove(), IO_ERROR::What(), and UTF8::wx_str().
Referenced by DIALOG_CHOOSE_SYMBOL::OnComponentPreselected().
|
private |
Definition at line 142 of file symbol_preview_widget.cpp.
References BOX2< Vec >::Centre(), BOX2< Vec >::GetHeight(), EDA_DRAW_PANEL_GAL::GetView(), BOX2< Vec >::GetWidth(), m_itemBBox, m_preview, m_previewItem, scale, KIGFX::VIEW::SetCenter(), KIGFX::VIEW::SetScale(), KIGFX::VIEW::ToWorld(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DisplayPart(), DisplaySymbol(), and onSize().
|
private |
Definition at line 130 of file symbol_preview_widget.cpp.
References fitOnDrawArea(), EDA_DRAW_PANEL_GAL::ForceRefresh(), m_preview, and m_previewItem.
Referenced by SYMBOL_PREVIEW_WIDGET().
void SYMBOL_PREVIEW_WIDGET::SetStatusText | ( | const wxString & | aText | ) |
Set the contents of the status label and display it.
Definition at line 121 of file symbol_preview_widget.cpp.
References m_preview, m_status, and m_statusPanel.
Referenced by DIALOG_CHOOSE_SYMBOL::OnComponentPreselected().
|
private |
Definition at line 70 of file symbol_preview_widget.h.
Referenced by SYMBOL_PREVIEW_WIDGET().
|
private |
The bounding box of the current item.
Definition at line 84 of file symbol_preview_widget.h.
Referenced by DisplayPart(), DisplaySymbol(), and fitOnDrawArea().
|
private |
Definition at line 68 of file symbol_preview_widget.h.
Referenced by DisplaySymbol().
|
private |
Definition at line 76 of file symbol_preview_widget.h.
Referenced by SYMBOL_PREVIEW_WIDGET().
|
private |
Definition at line 71 of file symbol_preview_widget.h.
Referenced by DisplayPart(), DisplaySymbol(), fitOnDrawArea(), onSize(), SetStatusText(), SYMBOL_PREVIEW_WIDGET(), and ~SYMBOL_PREVIEW_WIDGET().
|
private |
A local copy of the LIB_SYMBOL to display on the canvas.
Definition at line 81 of file symbol_preview_widget.h.
Referenced by DisplayPart(), DisplaySymbol(), fitOnDrawArea(), onSize(), and ~SYMBOL_PREVIEW_WIDGET().
|
private |
Definition at line 73 of file symbol_preview_widget.h.
Referenced by SetStatusText(), and SYMBOL_PREVIEW_WIDGET().
|
private |
Definition at line 74 of file symbol_preview_widget.h.
Referenced by DisplayPart(), DisplaySymbol(), SetStatusText(), and SYMBOL_PREVIEW_WIDGET().
|
private |
Definition at line 75 of file symbol_preview_widget.h.
Referenced by SYMBOL_PREVIEW_WIDGET().