KiCad PCB EDA Suite
SYMBOL_TREE_PANE Class Reference

Library Editor pane with component tree and symbol library table selector. More...

#include <symbol_tree_pane.h>

Inheritance diagram for SYMBOL_TREE_PANE:

Public Member Functions

 SYMBOL_TREE_PANE (LIB_EDIT_FRAME *aParent, LIB_MANAGER *aLibMgr)
 
 ~SYMBOL_TREE_PANE ()
 
LIB_TREEGetLibTree () const
 

Protected Member Functions

void onComponentSelected (wxCommandEvent &aEvent)
 

Protected Attributes

LIB_EDIT_FRAMEm_libEditFrame
 
LIB_TREEm_tree
 component search tree widget More...
 
LIB_MANAGERm_libMgr
 

Detailed Description

Library Editor pane with component tree and symbol library table selector.

Definition at line 40 of file symbol_tree_pane.h.

Constructor & Destructor Documentation

◆ SYMBOL_TREE_PANE()

SYMBOL_TREE_PANE::SYMBOL_TREE_PANE ( LIB_EDIT_FRAME aParent,
LIB_MANAGER aLibMgr 
)

Definition at line 33 of file symbol_tree_pane.cpp.

34  : wxPanel( aParent ),
35  m_libEditFrame( aParent ),
36  m_tree( nullptr ),
37  m_libMgr( aLibMgr )
38 {
39  // Create widgets
40  wxBoxSizer* boxSizer = new wxBoxSizer( wxVERTICAL );
43  boxSizer->Add( m_tree, 1, wxEXPAND, 5 );
44 
45  SetSizer( boxSizer ); // should remove the previous sizer according to wxWidgets docs
46  Layout();
47  boxSizer->Fit( this );
48 
49  // Event handlers
50  Bind( COMPONENT_SELECTED, &SYMBOL_TREE_PANE::onComponentSelected, this );
51 }
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
LIB_MANAGER * m_libMgr
LIB_EDIT_FRAME * m_libEditFrame
void onComponentSelected(wxCommandEvent &aEvent)
LIB_TREE * m_tree
component search tree widget
LIB_TREE_MODEL_ADAPTER::PTR & GetAdapter()
Returns the adapter object that provides the stored data.
Definition: lib_manager.h:271
Widget displaying a tree of components with optional search text control and description panel.
Definition: lib_tree.h:42

References LIB_MANAGER::GetAdapter(), SYMBOL_LIB_TABLE::GetGlobalLibTable(), m_libMgr, m_tree, onComponentSelected(), and LIB_TREE::SEARCH.

◆ ~SYMBOL_TREE_PANE()

SYMBOL_TREE_PANE::~SYMBOL_TREE_PANE ( )

Definition at line 54 of file symbol_tree_pane.cpp.

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

References m_tree.

Member Function Documentation

◆ GetLibTree()

◆ onComponentSelected()

void SYMBOL_TREE_PANE::onComponentSelected ( wxCommandEvent &  aEvent)
protected

Definition at line 60 of file symbol_tree_pane.cpp.

61 {
63 
64  // Make sure current-part highlighting doesn't get lost in selection highlighting
65  m_tree->Unselect();
66 
67  // Turn off any previous current-part highlighting
69 }
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:140
LIB_EDIT_FRAME * m_libEditFrame
static TOOL_ACTION editSymbol
Definition: ee_actions.h:166
LIB_TREE * m_tree
component search tree widget
void Unselect()
Unselect currently selected item in wxDataViewCtrl.
Definition: lib_tree.cpp:189
void RefreshLibTree()
Refreshes the tree (mainly to update highlighting and asterisking)
Definition: lib_tree.cpp:218
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74

References EE_ACTIONS::editSymbol, TOOLS_HOLDER::GetToolManager(), m_libEditFrame, m_tree, LIB_TREE::RefreshLibTree(), TOOL_MANAGER::RunAction(), and LIB_TREE::Unselect().

Referenced by SYMBOL_TREE_PANE().

Member Data Documentation

◆ m_libEditFrame

LIB_EDIT_FRAME* SYMBOL_TREE_PANE::m_libEditFrame
protected

Definition at line 54 of file symbol_tree_pane.h.

Referenced by onComponentSelected().

◆ m_libMgr

LIB_MANAGER* SYMBOL_TREE_PANE::m_libMgr
protected

Definition at line 56 of file symbol_tree_pane.h.

Referenced by SYMBOL_TREE_PANE().

◆ m_tree

LIB_TREE* SYMBOL_TREE_PANE::m_tree
protected

component search tree widget

Definition at line 55 of file symbol_tree_pane.h.

Referenced by GetLibTree(), onComponentSelected(), SYMBOL_TREE_PANE(), and ~SYMBOL_TREE_PANE().


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