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

#include <panel_footprint_chooser.h>

Inheritance diagram for PANEL_FOOTPRINT_CHOOSER:

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_WIDGETGetViewerPanel () const
 

Public Attributes

wxPanel * m_RightPanel
 
wxBoxSizer * m_RightPanelSizer
 
const FOOTPRINTm_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_ADAPTERm_adapter
 
FOOTPRINT_PREVIEW_WIDGETm_preview_ctrl
 
LIB_TREEm_tree
 
HTML_WINDOWm_details
 
PCB_BASE_FRAMEm_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
 

Detailed Description

Definition at line 42 of file panel_footprint_chooser.h.

Constructor & Destructor Documentation

◆ PANEL_FOOTPRINT_CHOOSER()

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 
)

◆ ~PANEL_FOOTPRINT_CHOOSER()

Member Function Documentation

◆ FinishSetup()

◆ GetFiltersSizer()

wxSizer * PANEL_FOOTPRINT_CHOOSER::GetFiltersSizer ( ) const
inline

Definition at line 76 of file panel_footprint_chooser.h.

References LIB_TREE::GetFiltersSizer(), and m_tree.

Referenced by FOOTPRINT_CHOOSER_FRAME::KiwayMailIn().

◆ GetFocusTarget()

wxWindow * PANEL_FOOTPRINT_CHOOSER::GetFocusTarget ( ) const
inline

◆ GetItemCount()

int PANEL_FOOTPRINT_CHOOSER::GetItemCount ( ) const
inline

◆ GetSelectedLibId()

LIB_ID PANEL_FOOTPRINT_CHOOSER::GetSelectedLibId ( ) const

To be called after this dialog returns from ShowModal().

Returns
the LIB_ID of the symbol that has been selected.

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().

◆ GetViewerPanel()

◆ onCloseTimer()

void PANEL_FOOTPRINT_CHOOSER::onCloseTimer ( wxTimerEvent &  aEvent)
protected

◆ OnDetailsCharHook()

void PANEL_FOOTPRINT_CHOOSER::OnDetailsCharHook ( wxKeyEvent &  aEvt)
protected

Definition at line 376 of file panel_footprint_chooser.cpp.

References m_details.

Referenced by PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().

◆ onFootprintChosen()

void PANEL_FOOTPRINT_CHOOSER::onFootprintChosen ( wxCommandEvent &  aEvent)
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().

◆ onFootprintSelected()

◆ onOpenLibsTimer()

void PANEL_FOOTPRINT_CHOOSER::onOpenLibsTimer ( wxTimerEvent &  aEvent)
protected

Definition at line 324 of file panel_footprint_chooser.cpp.

References Kiface(), and m_adapter.

Referenced by PANEL_FOOTPRINT_CHOOSER().

◆ Regenerate()

void PANEL_FOOTPRINT_CHOOSER::Regenerate ( )
inline

Definition at line 78 of file panel_footprint_chooser.h.

References m_tree, and LIB_TREE::Regenerate().

Referenced by FOOTPRINT_CHOOSER_FRAME::KiwayMailIn().

◆ SetPreselect()

void PANEL_FOOTPRINT_CHOOSER::SetPreselect ( const LIB_ID aPreselect)

Member Data Documentation

◆ DblClickDelay

constexpr int PANEL_FOOTPRINT_CHOOSER::DblClickDelay = 100
staticconstexprprotected

Definition at line 83 of file panel_footprint_chooser.h.

Referenced by onCloseTimer(), and onFootprintChosen().

◆ m_acceptHandler

std::function<void()> PANEL_FOOTPRINT_CHOOSER::m_acceptHandler
protected

Definition at line 119 of file panel_footprint_chooser.h.

Referenced by onCloseTimer().

◆ m_adapter

wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> PANEL_FOOTPRINT_CHOOSER::m_adapter
protected

◆ m_CurrFootprint

◆ m_dbl_click_timer

wxTimer* PANEL_FOOTPRINT_CHOOSER::m_dbl_click_timer
protected

◆ m_details

HTML_WINDOW* PANEL_FOOTPRINT_CHOOSER::m_details
protected

◆ m_escapeHandler

std::function<void()> PANEL_FOOTPRINT_CHOOSER::m_escapeHandler
protected

Definition at line 120 of file panel_footprint_chooser.h.

Referenced by PANEL_FOOTPRINT_CHOOSER().

◆ m_filter

std::function<bool( LIB_TREE_NODE& )> PANEL_FOOTPRINT_CHOOSER::m_filter
protected

Definition at line 118 of file panel_footprint_chooser.h.

Referenced by PANEL_FOOTPRINT_CHOOSER().

◆ m_frame

PCB_BASE_FRAME* PANEL_FOOTPRINT_CHOOSER::m_frame
protected

Definition at line 117 of file panel_footprint_chooser.h.

Referenced by PANEL_FOOTPRINT_CHOOSER().

◆ m_hsplitter

wxSplitterWindow* PANEL_FOOTPRINT_CHOOSER::m_hsplitter
protected

◆ m_open_libs_timer

wxTimer* PANEL_FOOTPRINT_CHOOSER::m_open_libs_timer
protected

Definition at line 107 of file panel_footprint_chooser.h.

Referenced by PANEL_FOOTPRINT_CHOOSER(), and ~PANEL_FOOTPRINT_CHOOSER().

◆ m_preview_ctrl

FOOTPRINT_PREVIEW_WIDGET* PANEL_FOOTPRINT_CHOOSER::m_preview_ctrl
protected

◆ m_RightPanel

◆ m_RightPanelSizer

wxBoxSizer* PANEL_FOOTPRINT_CHOOSER::m_RightPanelSizer

◆ m_tree

◆ m_vsplitter

wxSplitterWindow* PANEL_FOOTPRINT_CHOOSER::m_vsplitter
protected

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