KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DB_LIB_PREVIEW_PANEL Class Reference

Shows symbols that are not in any library table the way the symbol chooser does: a searchable library tree, symbol and footprint previews, and the details pane. More...

#include <db_lib_preview_panel.h>

Inheritance diagram for DB_LIB_PREVIEW_PANEL:

Public Member Functions

 DB_LIB_PREVIEW_PANEL (wxWindow *aParent, EDA_BASE_FRAME *aFrame, KIWAY *aKiway, EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
 
 ~DB_LIB_PREVIEW_PANEL () override
 
void SetSymbols (const wxString &aLibNickname, std::vector< std::unique_ptr< LIB_SYMBOL > > aSymbols)
 Replaces the previewed library, keeping the selected symbol when it still exists.
 
void SetStatus (const wxString &aText)
 Shows a one-line status below the library tree.
 
void SelectSymbol (const wxString &aSymbolName)
 

Private Member Functions

void onSymbolSelected (wxCommandEvent &aEvent)
 
void onFootprintSelected (wxCommandEvent &aEvent)
 
void showSymbol (const LIB_SYMBOL *aSymbol, int aUnit)
 
void showFootprint (const wxString &aFootprint)
 
const LIB_SYMBOL * findSymbol (const LIB_ID &aLibId) const
 

Private Attributes

APP_SETTINGS_BASE::LIB_TREE m_treeSettings
 
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > m_adapter
 
LIB_TREE * m_tree
 
SYMBOL_PREVIEW_WIDGET * m_symbolPreview
 
wxChoice * m_footprintChoice
 
FOOTPRINT_PREVIEW_WIDGET * m_footprintPreview
 
wxStaticText * m_status
 
KIWAY * m_kiway
 
WX_DEBOUNCED_ACTION m_footprintLoadRetry
 Polls the footprint library load, which DisplayFootprint() needs finished.
 
wxString m_nickname
 
std::map< wxString, std::unique_ptr< LIB_SYMBOL > > m_symbols
 

Detailed Description

Shows symbols that are not in any library table the way the symbol chooser does: a searchable library tree, symbol and footprint previews, and the details pane.

Used to preview a database library while its settings are being edited.

Definition at line 49 of file db_lib_preview_panel.h.

Constructor & Destructor Documentation

◆ DB_LIB_PREVIEW_PANEL()

DB_LIB_PREVIEW_PANEL::DB_LIB_PREVIEW_PANEL ( wxWindow * aParent,
EDA_BASE_FRAME * aFrame,
KIWAY * aKiway,
EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
Parameters
aFrameowns the tree's tool dispatcher; may be null
aKiwayenables the footprint preview; may be null

Definition at line 79 of file db_lib_preview_panel.cpp.

References m_footprintChoice, m_footprintLoadRetry, m_footprintPreview, m_kiway, and showFootprint().

◆ ~DB_LIB_PREVIEW_PANEL()

DB_LIB_PREVIEW_PANEL::~DB_LIB_PREVIEW_PANEL ( )
override

Member Function Documentation

◆ findSymbol()

const LIB_SYMBOL * DB_LIB_PREVIEW_PANEL::findSymbol ( const LIB_ID & aLibId) const
private

Definition at line 225 of file db_lib_preview_panel.cpp.

References LIB_ID::GetLibItemName(), m_symbols, and UTF8::wx_str().

Referenced by onSymbolSelected().

◆ onFootprintSelected()

void DB_LIB_PREVIEW_PANEL::onFootprintSelected ( wxCommandEvent & aEvent)
private

Definition at line 293 of file db_lib_preview_panel.cpp.

References m_footprintChoice, and showFootprint().

Referenced by ~DB_LIB_PREVIEW_PANEL().

◆ onSymbolSelected()

void DB_LIB_PREVIEW_PANEL::onSymbolSelected ( wxCommandEvent & aEvent)
private

Definition at line 232 of file db_lib_preview_panel.cpp.

References findSymbol(), m_tree, and showSymbol().

Referenced by ~DB_LIB_PREVIEW_PANEL().

◆ SelectSymbol()

void DB_LIB_PREVIEW_PANEL::SelectSymbol ( const wxString & aSymbolName)

Definition at line 213 of file db_lib_preview_panel.cpp.

References m_nickname, m_symbols, and m_tree.

◆ SetStatus()

void DB_LIB_PREVIEW_PANEL::SetStatus ( const wxString & aText)

Shows a one-line status below the library tree.

Definition at line 203 of file db_lib_preview_panel.cpp.

References m_status.

◆ SetSymbols()

void DB_LIB_PREVIEW_PANEL::SetSymbols ( const wxString & aLibNickname,
std::vector< std::unique_ptr< LIB_SYMBOL > > aSymbols )

Replaces the previewed library, keeping the selected symbol when it still exists.

Every symbol's LIB_ID nickname is set to aLibNickname so tree lookups resolve.

Definition at line 156 of file db_lib_preview_panel.cpp.

References LIB_ID::GetLibItemName(), LIB_ID::IsValid(), m_adapter, m_nickname, m_symbols, m_tree, name, LIB_ID::SetLibNickname(), DB_LIB_PREVIEW_TREE_ADAPTER::SetLibrary(), and UTF8::wx_str().

◆ showFootprint()

void DB_LIB_PREVIEW_PANEL::showFootprint ( const wxString & aFootprint)
private

◆ showSymbol()

void DB_LIB_PREVIEW_PANEL::showSymbol ( const LIB_SYMBOL * aSymbol,
int aUnit )
private

Member Data Documentation

◆ m_adapter

wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> DB_LIB_PREVIEW_PANEL::m_adapter
private

Definition at line 82 of file db_lib_preview_panel.h.

Referenced by SetSymbols().

◆ m_footprintChoice

wxChoice* DB_LIB_PREVIEW_PANEL::m_footprintChoice
private

◆ m_footprintLoadRetry

WX_DEBOUNCED_ACTION DB_LIB_PREVIEW_PANEL::m_footprintLoadRetry
private

Polls the footprint library load, which DisplayFootprint() needs finished.

Definition at line 91 of file db_lib_preview_panel.h.

Referenced by DB_LIB_PREVIEW_PANEL(), showFootprint(), and ~DB_LIB_PREVIEW_PANEL().

◆ m_footprintPreview

FOOTPRINT_PREVIEW_WIDGET* DB_LIB_PREVIEW_PANEL::m_footprintPreview
private

Definition at line 86 of file db_lib_preview_panel.h.

Referenced by DB_LIB_PREVIEW_PANEL(), and showFootprint().

◆ m_kiway

KIWAY* DB_LIB_PREVIEW_PANEL::m_kiway
private

Definition at line 88 of file db_lib_preview_panel.h.

Referenced by DB_LIB_PREVIEW_PANEL(), and showFootprint().

◆ m_nickname

wxString DB_LIB_PREVIEW_PANEL::m_nickname
private

Definition at line 93 of file db_lib_preview_panel.h.

Referenced by SelectSymbol(), and SetSymbols().

◆ m_status

wxStaticText* DB_LIB_PREVIEW_PANEL::m_status
private

Definition at line 87 of file db_lib_preview_panel.h.

Referenced by SetStatus().

◆ m_symbolPreview

SYMBOL_PREVIEW_WIDGET* DB_LIB_PREVIEW_PANEL::m_symbolPreview
private

Definition at line 84 of file db_lib_preview_panel.h.

Referenced by showSymbol().

◆ m_symbols

std::map<wxString, std::unique_ptr<LIB_SYMBOL> > DB_LIB_PREVIEW_PANEL::m_symbols
private

Definition at line 94 of file db_lib_preview_panel.h.

Referenced by findSymbol(), SelectSymbol(), and SetSymbols().

◆ m_tree

LIB_TREE* DB_LIB_PREVIEW_PANEL::m_tree
private

Definition at line 83 of file db_lib_preview_panel.h.

Referenced by onSymbolSelected(), SelectSymbol(), and SetSymbols().

◆ m_treeSettings

APP_SETTINGS_BASE::LIB_TREE DB_LIB_PREVIEW_PANEL::m_treeSettings
private

Definition at line 81 of file db_lib_preview_panel.h.


The documentation for this class was generated from the following files: