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
 
void Regenerate ()
 

Updates the component tree

More...
 

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:269
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 67 of file symbol_tree_pane.cpp.

68 {
70  // Make sure current-part highlighting doesn't get lost in selection highlighting
71  m_tree->Unselect();
72 }
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
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:175

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

Referenced by SYMBOL_TREE_PANE().

◆ Regenerate()

void SYMBOL_TREE_PANE::Regenerate ( )

Updates the component tree

Definition at line 60 of file symbol_tree_pane.cpp.

61 {
62  if( m_tree )
63  m_tree->Regenerate( true );
64 }
LIB_TREE * m_tree
component search tree widget
void Regenerate(bool aKeepState)
Regenerates the tree.
Definition: lib_tree.cpp:186

References m_tree, and LIB_TREE::Regenerate().

Referenced by LIB_EDIT_FRAME::SyncLibraries().

Member Data Documentation

◆ m_libEditFrame

LIB_EDIT_FRAME* SYMBOL_TREE_PANE::m_libEditFrame
protected

Definition at line 57 of file symbol_tree_pane.h.

Referenced by onComponentSelected().

◆ m_libMgr

LIB_MANAGER* SYMBOL_TREE_PANE::m_libMgr
protected

Definition at line 59 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 58 of file symbol_tree_pane.h.

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


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