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  // Event handlers
45  Bind( COMPONENT_SELECTED, &FOOTPRINT_TREE_PANE::onComponentSelected, this );
46  m_tree->Bind( wxEVT_UPDATE_UI, &FOOTPRINT_TREE_PANE::onUpdateUI, this );
47 }
LIB_TREE_MODEL_ADAPTER::PTR & GetLibTreeAdapter()
Returns 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.
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 components 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 50 of file footprint_tree_pane.cpp.

51 {
52  m_tree->Destroy();
53 }
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 56 of file footprint_tree_pane.cpp.

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

References GetLibTree(), FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary(), 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 64 of file footprint_tree_pane.cpp.

65 {
66  if( m_frame->GetCanvas()->HasFocus() )
67  {
68  // Don't allow a selected item in the tree when the canvas has focus: it's too easy
69  // to confuse the selected-highlighting with the being-edited-on-canvas-highlighting.
70  m_tree->Unselect();
71  }
72 }
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:189
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: