KiCad PCB EDA Suite
|
#include <panel_footprint_chooser.h>
Public Member Functions | |
PANEL_FOOTPRINT_CHOOSER (PCB_BASE_FRAME *aFrame, wxTopLevelWindow *aParent, const wxArrayString &aFootprintHistoryList, std::function< bool(LIB_TREE_NODE &)> aFilter, std::function< void()> aAcceptHandler, std::function< void()> aEscapeHandler) | |
Create dialog to choose component. | |
~PANEL_FOOTPRINT_CHOOSER () | |
void | FinishSetup () |
void | SetPreselect (const LIB_ID &aPreselect) |
LIB_ID | GetSelectedLibId () const |
To be called after this dialog returns from ShowModal(). | |
int | GetItemCount () const |
wxWindow * | GetFocusTarget () const |
wxSizer * | GetFiltersSizer () const |
void | Regenerate () |
FOOTPRINT_PREVIEW_WIDGET * | GetViewerPanel () const |
Public Attributes | |
wxPanel * | m_RightPanel |
wxBoxSizer * | m_RightPanelSizer |
const FOOTPRINT * | m_CurrFootprint |
Protected Member Functions | |
void | OnDetailsCharHook (wxKeyEvent &aEvt) |
void | onCloseTimer (wxTimerEvent &aEvent) |
void | onOpenLibsTimer (wxTimerEvent &aEvent) |
void | onFootprintSelected (wxCommandEvent &aEvent) |
void | onFootprintChosen (wxCommandEvent &aEvent) |
Handle the selection of an item. | |
Protected Attributes | |
wxTimer * | m_dbl_click_timer |
wxTimer * | m_open_libs_timer |
wxSplitterWindow * | m_hsplitter |
wxSplitterWindow * | m_vsplitter |
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > | m_adapter |
FOOTPRINT_PREVIEW_WIDGET * | m_preview_ctrl |
LIB_TREE * | m_tree |
HTML_WINDOW * | m_details |
PCB_BASE_FRAME * | m_frame |
std::function< bool(LIB_TREE_NODE &)> | m_filter |
std::function< void()> | m_acceptHandler |
std::function< void()> | m_escapeHandler |
Static Protected Attributes | |
static constexpr int | DblClickDelay = 100 |
Definition at line 42 of file panel_footprint_chooser.h.
PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER | ( | PCB_BASE_FRAME * | aFrame, |
wxTopLevelWindow * | aParent, | ||
const wxArrayString & | aFootprintHistoryList, | ||
std::function< bool(LIB_TREE_NODE &)> | aFilter, | ||
std::function< void()> | aAcceptHandler, | ||
std::function< void()> | aEscapeHandler | ||
) |
Create dialog to choose component.
aFrame | the parent frame (usually a PCB_EDIT_FRAME or FOOTPRINT_CHOOSER_FRAME) |
aParent | the parent window (usually a DIALOG_SHIM or FOOTPRINT_CHOOSER_FRAME) |
aAcceptHandler | a handler to be called on double-click of a footprint |
aEscapeHandler | a handler to be called on <ESC> |
Definition at line 51 of file panel_footprint_chooser.cpp.
References _, FP_TREE_MODEL_ADAPTER::AddLibraries(), LIB_TREE::ALL_WIDGETS, FP_TREE_MODEL_ADAPTER::Create(), FOOTPRINT_LIST::DisplayErrors(), LIB_TREE_MODEL_ADAPTER::DoAddLibrary(), FOOTPRINT_LIST::GetErrorCount(), FOOTPRINT_LIST::GetFootprintInfo(), UNITS_PROVIDER::GetUserUnits(), GFootprintList, KIWAY_HOLDER::Kiway(), m_adapter, m_CurrFootprint, m_dbl_click_timer, m_details, m_escapeHandler, m_filter, m_frame, m_hsplitter, m_open_libs_timer, m_preview_ctrl, m_RightPanel, m_RightPanelSizer, m_tree, m_vsplitter, onCloseTimer(), OnDetailsCharHook(), onFootprintChosen(), onFootprintSelected(), onOpenLibsTimer(), PROJECT_PCB::PcbFootprintLibs(), KIWAY_HOLDER::Prj(), FOOTPRINT_LIST_IMPL::ReadFootprintFiles(), LIB_TREE_MODEL_ADAPTER::SetFilter(), LIB_TREE_MODEL_ADAPTER::SetPreselectNode(), and FOOTPRINT_PREVIEW_WIDGET::SetUserUnits().
PANEL_FOOTPRINT_CHOOSER::~PANEL_FOOTPRINT_CHOOSER | ( | ) |
Definition at line 212 of file panel_footprint_chooser.cpp.
References SETTINGS_MANAGER::GetAppSettings(), PGM_BASE::GetSettingsManager(), LIB_TREE::GetSortMode(), PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::height, m_adapter, m_dbl_click_timer, m_details, PCBNEW_SETTINGS::m_FootprintChooser, m_hsplitter, m_open_libs_timer, m_tree, m_vsplitter, onCloseTimer(), OnDetailsCharHook(), onFootprintChosen(), onFootprintSelected(), Pgm(), PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::sash_h, PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::sash_v, PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::sort_mode, and PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::width.
void PANEL_FOOTPRINT_CHOOSER::FinishSetup | ( | ) |
Definition at line 255 of file panel_footprint_chooser.cpp.
References GetSettingsManager(), PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::height, m_adapter, m_hsplitter, m_vsplitter, Pgm(), PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::sash_h, PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::sash_v, PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::sort_mode, and PCBNEW_SETTINGS::FOOTPRINT_CHOOSER::width.
Referenced by DIALOG_FOOTPRINT_CHOOSER::DIALOG_FOOTPRINT_CHOOSER(), and FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME().
|
inline |
Definition at line 76 of file panel_footprint_chooser.h.
References LIB_TREE::GetFiltersSizer(), and m_tree.
Referenced by FOOTPRINT_CHOOSER_FRAME::KiwayMailIn().
|
inline |
Definition at line 74 of file panel_footprint_chooser.h.
References LIB_TREE::GetFocusTarget(), and m_tree.
Referenced by DIALOG_FOOTPRINT_CHOOSER::DIALOG_FOOTPRINT_CHOOSER(), and FOOTPRINT_CHOOSER_FRAME::OnPaint().
|
inline |
Definition at line 72 of file panel_footprint_chooser.h.
References m_adapter.
Referenced by DIALOG_FOOTPRINT_CHOOSER::DIALOG_FOOTPRINT_CHOOSER(), and FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME().
LIB_ID PANEL_FOOTPRINT_CHOOSER::GetSelectedLibId | ( | ) | const |
To be called after this dialog returns from ShowModal().
Definition at line 298 of file panel_footprint_chooser.cpp.
References LIB_TREE::GetSelectedLibId(), and m_tree.
Referenced by DIALOG_FOOTPRINT_CHOOSER::GetSelectedLibId(), FOOTPRINT_CHOOSER_FRAME::OnOK(), and FOOTPRINT_CHOOSER_FRAME::Update3DView().
|
inline |
Definition at line 80 of file panel_footprint_chooser.h.
References m_preview_ctrl.
Referenced by DIALOG_FOOTPRINT_CHOOSER::DIALOG_FOOTPRINT_CHOOSER(), FOOTPRINT_CHOOSER_FRAME::KiwayMailIn(), DIALOG_FOOTPRINT_CHOOSER::on3DviewReq(), DIALOG_FOOTPRINT_CHOOSER::onFpChanged(), DIALOG_FOOTPRINT_CHOOSER::onFpViewReq(), and FOOTPRINT_CHOOSER_FRAME::updatePanelsVisibility().
|
protected |
Definition at line 304 of file panel_footprint_chooser.cpp.
References DblClickDelay, m_acceptHandler, and m_dbl_click_timer.
Referenced by PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 376 of file panel_footprint_chooser.cpp.
References m_details.
Referenced by PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Handle the selection of an item.
This is called when either the search box or the tree receive an Enter, or the tree receives a double click. If the item selected is a category, it is expanded or collapsed; if it is a component, the component is picked.
Definition at line 358 of file panel_footprint_chooser.cpp.
References DblClickDelay, LIB_TREE::GetSelectedLibId(), LIB_ID::IsValid(), m_dbl_click_timer, and m_tree.
Referenced by PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 331 of file panel_footprint_chooser.cpp.
References _, FOOTPRINT_PREVIEW_WIDGET::ClearStatus(), FOOTPRINT_PREVIEW_WIDGET::DisplayFootprint(), FOOTPRINT_PREVIEW_WIDGET::GetPreviewPanel(), LIB_TREE::GetSelectedLibId(), FOOTPRINT_PREVIEW_WIDGET::IsInitialized(), LIB_ID::IsValid(), m_CurrFootprint, m_preview_ctrl, m_tree, and FOOTPRINT_PREVIEW_WIDGET::SetStatusText().
Referenced by PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 324 of file panel_footprint_chooser.cpp.
References Kiface(), and m_adapter.
Referenced by PANEL_FOOTPRINT_CHOOSER().
|
inline |
Definition at line 78 of file panel_footprint_chooser.h.
References m_tree, and LIB_TREE::Regenerate().
Referenced by FOOTPRINT_CHOOSER_FRAME::KiwayMailIn().
void PANEL_FOOTPRINT_CHOOSER::SetPreselect | ( | const LIB_ID & | aPreselect | ) |
Definition at line 292 of file panel_footprint_chooser.cpp.
References m_adapter.
Referenced by DIALOG_FOOTPRINT_CHOOSER::DIALOG_FOOTPRINT_CHOOSER(), and FOOTPRINT_CHOOSER_FRAME::ShowModal().
|
staticconstexprprotected |
Definition at line 83 of file panel_footprint_chooser.h.
Referenced by onCloseTimer(), and onFootprintChosen().
|
protected |
Definition at line 119 of file panel_footprint_chooser.h.
Referenced by onCloseTimer().
|
protected |
Definition at line 111 of file panel_footprint_chooser.h.
Referenced by FinishSetup(), GetItemCount(), onOpenLibsTimer(), PANEL_FOOTPRINT_CHOOSER(), SetPreselect(), and ~PANEL_FOOTPRINT_CHOOSER().
const FOOTPRINT* PANEL_FOOTPRINT_CHOOSER::m_CurrFootprint |
Definition at line 103 of file panel_footprint_chooser.h.
Referenced by DIALOG_FOOTPRINT_CHOOSER::on3DviewReq(), onFootprintSelected(), PANEL_FOOTPRINT_CHOOSER(), and FOOTPRINT_CHOOSER_FRAME::updateViews().
|
protected |
Definition at line 106 of file panel_footprint_chooser.h.
Referenced by onCloseTimer(), onFootprintChosen(), PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 115 of file panel_footprint_chooser.h.
Referenced by OnDetailsCharHook(), PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 120 of file panel_footprint_chooser.h.
Referenced by PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 118 of file panel_footprint_chooser.h.
Referenced by PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 117 of file panel_footprint_chooser.h.
Referenced by PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 108 of file panel_footprint_chooser.h.
Referenced by FinishSetup(), PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 107 of file panel_footprint_chooser.h.
Referenced by PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 113 of file panel_footprint_chooser.h.
Referenced by GetViewerPanel(), onFootprintSelected(), and PANEL_FOOTPRINT_CHOOSER().
wxPanel* PANEL_FOOTPRINT_CHOOSER::m_RightPanel |
Definition at line 100 of file panel_footprint_chooser.h.
Referenced by DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), FOOTPRINT_CHOOSER_FRAME::build3DCanvas(), DIALOG_FOOTPRINT_CHOOSER::on3DviewReq(), DIALOG_FOOTPRINT_CHOOSER::onFpViewReq(), PANEL_FOOTPRINT_CHOOSER(), and FOOTPRINT_CHOOSER_FRAME::updateViews().
wxBoxSizer* PANEL_FOOTPRINT_CHOOSER::m_RightPanelSizer |
Definition at line 101 of file panel_footprint_chooser.h.
Referenced by DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), FOOTPRINT_CHOOSER_FRAME::build3DCanvas(), and PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 114 of file panel_footprint_chooser.h.
Referenced by GetFiltersSizer(), GetFocusTarget(), GetSelectedLibId(), onFootprintChosen(), onFootprintSelected(), PANEL_FOOTPRINT_CHOOSER(), Regenerate(), and ~PANEL_FOOTPRINT_CHOOSER().
|
protected |
Definition at line 109 of file panel_footprint_chooser.h.
Referenced by FinishSetup(), PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().