KiCad PCB EDA Suite
FOOTPRINT_TREE_PANE Class Reference

Footprint Editor pane with footprint library tree. More...

#include <footprint_tree_pane.h>

Inheritance diagram for FOOTPRINT_TREE_PANE:

Public Member Functions

 FOOTPRINT_TREE_PANE (FOOTPRINT_EDIT_FRAME *aParent)
 
 ~FOOTPRINT_TREE_PANE ()
 
LIB_TREEGetLibTree () const
 

Protected Member Functions

void onComponentSelected (wxCommandEvent &aEvent)
 
void onUpdateUI (wxUpdateUIEvent &aEvent)
 

Protected Attributes

FOOTPRINT_EDIT_FRAMEm_frame
 
LIB_TREEm_tree
 component search tree widget More...
 

Detailed Description

Footprint Editor pane with footprint library tree.

Definition at line 39 of file footprint_tree_pane.h.

Constructor & Destructor Documentation

◆ FOOTPRINT_TREE_PANE()

FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE ( FOOTPRINT_EDIT_FRAME aParent)

Definition at line 30 of file footprint_tree_pane.cpp.

31  : wxPanel( aParent ),
32  m_frame( aParent ),
33  m_tree( nullptr )
34 {
35  // Create widgets
36  wxBoxSizer* boxSizer = new wxBoxSizer( wxVERTICAL );
38  boxSizer->Add( m_tree, 1, wxEXPAND, 5 );
39 
40  SetSizer( boxSizer ); // should remove the previous sizer according to wxWidgets docs
41  Layout();
42  boxSizer->Fit( this );
43 
44  m_frame->GetLibTreeAdapter()->FinishTreeInitialization();
45 
46  // Event handlers
47  Bind( SYMBOL_SELECTED, &FOOTPRINT_TREE_PANE::onComponentSelected, this );
48  m_tree->Bind( wxEVT_UPDATE_UI, &FOOTPRINT_TREE_PANE::onUpdateUI, this );
49 }
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > & GetLibTreeAdapter()
Return the adapter object that provides the stored data.
FP_LIB_TABLE GFootprintTable
!!!!!!!!!!!!!! This code is obsolete because of the merge into pcbnew, don't bother with it.
Definition: cvpcb.cpp:120
FOOTPRINT_EDIT_FRAME * m_frame
void onComponentSelected(wxCommandEvent &aEvent)
LIB_TREE * m_tree
component search tree widget
void onUpdateUI(wxUpdateUIEvent &aEvent)
Widget displaying a tree of symbols with optional search text control and description panel....
Definition: lib_tree.h:42

References FOOTPRINT_EDIT_FRAME::GetLibTreeAdapter(), GFootprintTable, m_frame, m_tree, onComponentSelected(), onUpdateUI(), and LIB_TREE::SEARCH.

◆ ~FOOTPRINT_TREE_PANE()

FOOTPRINT_TREE_PANE::~FOOTPRINT_TREE_PANE ( )

Definition at line 52 of file footprint_tree_pane.cpp.

53 {
54  m_tree->Destroy();
55 }
LIB_TREE * m_tree
component search tree widget

References m_tree.

Member Function Documentation

◆ GetLibTree()

◆ onComponentSelected()

void FOOTPRINT_TREE_PANE::onComponentSelected ( wxCommandEvent &  aEvent)
protected

Definition at line 58 of file footprint_tree_pane.cpp.

59 {
60  m_frame->LoadFootprintFromLibrary( GetLibTree()->GetSelectedLibId() );
61  // Make sure current-part highlighting doesn't get lost in seleciton highlighting
62  m_tree->Unselect();
63 }
void LoadFootprintFromLibrary(LIB_ID aFPID)
FOOTPRINT_EDIT_FRAME * m_frame
void Unselect()
Unselect currently selected item in wxDataViewCtrl.
Definition: lib_tree.cpp:191
LIB_TREE * GetLibTree() const
LIB_TREE * m_tree
component search tree widget

References GetLibTree(), FOOTPRINT_EDIT_FRAME::LoadFootprintFromLibrary(), m_frame, m_tree, and LIB_TREE::Unselect().

Referenced by FOOTPRINT_TREE_PANE().

◆ onUpdateUI()

void FOOTPRINT_TREE_PANE::onUpdateUI ( wxUpdateUIEvent &  aEvent)
protected

Definition at line 66 of file footprint_tree_pane.cpp.

67 {
68  if( m_frame->GetCanvas()->HasFocus() )
69  {
70  // Don't allow a selected item in the tree when the canvas has focus: it's too easy
71  // to confuse the selected-highlighting with the being-edited-on-canvas-highlighting.
72  m_tree->Unselect();
73  }
74 }
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
FOOTPRINT_EDIT_FRAME * m_frame
void Unselect()
Unselect currently selected item in wxDataViewCtrl.
Definition: lib_tree.cpp:191
LIB_TREE * m_tree
component search tree widget

References PCB_BASE_FRAME::GetCanvas(), m_frame, m_tree, and LIB_TREE::Unselect().

Referenced by FOOTPRINT_TREE_PANE().

Member Data Documentation

◆ m_frame

FOOTPRINT_EDIT_FRAME* FOOTPRINT_TREE_PANE::m_frame
protected

Definition at line 54 of file footprint_tree_pane.h.

Referenced by FOOTPRINT_TREE_PANE(), onComponentSelected(), and onUpdateUI().

◆ m_tree

LIB_TREE* FOOTPRINT_TREE_PANE::m_tree
protected

component search tree widget

Definition at line 55 of file footprint_tree_pane.h.

Referenced by FOOTPRINT_TREE_PANE(), GetLibTree(), onComponentSelected(), onUpdateUI(), and ~FOOTPRINT_TREE_PANE().


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