KiCad PCB EDA Suite
|
#include <symbol_preview_widget.h>
Public Member Functions | |
SYMBOL_PREVIEW_WIDGET (wxWindow *aParent, KIWAY *aKiway, bool aIncludeStatus, EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType) | |
Construct a symbol preview widget. | |
~SYMBOL_PREVIEW_WIDGET () override | |
void | SetStatusText (const wxString &aText) |
Set the contents of the status label and display it. | |
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) |
Protected Member Functions | |
void | onSize (wxSizeEvent &aEvent) |
void | fitOnDrawArea () |
Protected Attributes | |
KIWAY * | m_kiway |
GAL_DISPLAY_OPTIONS_IMPL | 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. | |
BOX2I | m_itemBBox |
The bounding box of the current item. | |
Definition at line 35 of file symbol_preview_widget.h.
SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET | ( | wxWindow * | aParent, |
KIWAY * | aKiway, | ||
bool | aIncludeStatus, | ||
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 38 of file symbol_preview_widget.cpp.
References EDA_DRAW_PANEL_GAL::GAL_FALLBACK, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, SETTINGS_MANAGER::GetAppSettings(), SETTINGS_MANAGER::GetColorSettings(), PGM_BASE::GetCommonSettings(), EDA_DRAW_PANEL_GAL::GetGAL(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), PGM_BASE::GetSettingsManager(), EDA_DRAW_PANEL_GAL::GetView(), LAYER_REFERENCEPART, SCH_RENDER_SETTINGS::LoadColors(), KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, m_galDisplayOptions, m_outerSizer, m_preview, m_status, m_statusPanel, m_statusSizer, onSize(), Pgm(), GAL_DISPLAY_OPTIONS_IMPL::ReadConfig(), KIGFX::GAL::SetAxesEnabled(), KIGFX::GAL::SetClearColor(), KIGFX::GAL::SetGridVisibility(), EDA_DRAW_PANEL_GAL::SetStealsFocus(), and KIGFX::COLOR4D::ToColour().
|
override |
Definition at line 134 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 | aBodyStyle = 0 |
||
) |
Definition at line 267 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::HasAlternateBodyStyle(), LIB_SYMBOL::IsMulti(), m_itemBBox, m_preview, m_previewItem, SCH_RENDER_SETTINGS::m_ShowUnit, m_statusPanel, and KIGFX::VIEW::Remove().
Referenced by DIALOG_RESCUE_EACH::displayItemsInConflict().
void SYMBOL_PREVIEW_WIDGET::DisplaySymbol | ( | const LIB_ID & | aSymbolID, |
int | aUnit, | ||
int | aBodyStyle = 0 |
||
) |
Set the currently displayed symbol.
Definition at line 190 of file symbol_preview_widget.cpp.
References _, KIGFX::VIEW::Add(), fitOnDrawArea(), LIB_SYMBOL::Flatten(), EDA_DRAW_PANEL_GAL::ForceRefresh(), LIB_SYMBOL::GetFields(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), LIB_SYMBOL::GetUnitBoundingBox(), EDA_DRAW_PANEL_GAL::GetView(), LIB_SYMBOL::HasAlternateBodyStyle(), LIB_SYMBOL::IsMulti(), SYMBOL_LIB_TABLE::LoadSymbol(), m_itemBBox, m_kiway, m_preview, m_previewItem, m_statusPanel, KIWAY::Prj(), KIGFX::VIEW::Remove(), PROJECT_SCH::SchSymbolLibTable(), IO_ERROR::What(), and UTF8::wx_str().
Referenced by PANEL_SYMBOL_CHOOSER::onSymbolSelected(), and SYMBOL_TREE_SYNCHRONIZING_ADAPTER::ShowPreview().
|
protected |
Definition at line 166 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(), ToVECTOR2D(), KIGFX::VIEW::ToWorld(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by SYMBOL_DIFF_WIDGET::DisplayDiff(), DisplayPart(), DisplaySymbol(), and onSize().
|
protected |
Definition at line 154 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 143 of file symbol_preview_widget.cpp.
References m_preview, m_status, and m_statusPanel.
Referenced by PANEL_SYMBOL_CHOOSER::onSymbolSelected().
|
protected |
Definition at line 70 of file symbol_preview_widget.h.
Referenced by SYMBOL_PREVIEW_WIDGET().
|
protected |
The bounding box of the current item.
Definition at line 84 of file symbol_preview_widget.h.
Referenced by SYMBOL_DIFF_WIDGET::DisplayDiff(), DisplayPart(), DisplaySymbol(), and fitOnDrawArea().
|
protected |
Definition at line 68 of file symbol_preview_widget.h.
Referenced by DisplaySymbol().
|
protected |
Definition at line 76 of file symbol_preview_widget.h.
Referenced by SYMBOL_DIFF_WIDGET::SYMBOL_DIFF_WIDGET(), and SYMBOL_PREVIEW_WIDGET().
|
protected |
Definition at line 71 of file symbol_preview_widget.h.
Referenced by SYMBOL_DIFF_WIDGET::DisplayDiff(), DisplayPart(), DisplaySymbol(), fitOnDrawArea(), onSize(), SYMBOL_DIFF_WIDGET::onSlider(), SetStatusText(), SYMBOL_PREVIEW_WIDGET(), and ~SYMBOL_PREVIEW_WIDGET().
|
protected |
A local copy of the LIB_SYMBOL to display on the canvas.
Definition at line 81 of file symbol_preview_widget.h.
Referenced by SYMBOL_DIFF_WIDGET::DisplayDiff(), DisplayPart(), DisplaySymbol(), fitOnDrawArea(), onSize(), SYMBOL_DIFF_WIDGET::onSlider(), and ~SYMBOL_PREVIEW_WIDGET().
|
protected |
Definition at line 73 of file symbol_preview_widget.h.
Referenced by SetStatusText(), and SYMBOL_PREVIEW_WIDGET().
|
protected |
Definition at line 74 of file symbol_preview_widget.h.
Referenced by DisplayPart(), DisplaySymbol(), SetStatusText(), and SYMBOL_PREVIEW_WIDGET().
|
protected |
Definition at line 75 of file symbol_preview_widget.h.
Referenced by SYMBOL_PREVIEW_WIDGET().