KiCad PCB EDA Suite
HIERARCHY_TREE Class Reference

Handle hierarchy tree control. More...

#include <hierarch.h>

Inheritance diagram for HIERARCHY_TREE:

Public Member Functions

 HIERARCHY_TREE (HIERARCHY_NAVIG_DLG *parent)
 
void onChar (wxKeyEvent &event)
 

Private Attributes

HIERARCHY_NAVIG_DLGm_parent
 
wxImageList * imageList
 

Detailed Description

Handle hierarchy tree control.

Definition at line 45 of file hierarch.h.

Constructor & Destructor Documentation

◆ HIERARCHY_TREE()

HIERARCHY_TREE::HIERARCHY_TREE ( HIERARCHY_NAVIG_DLG parent)

Definition at line 67 of file hierarch.cpp.

67  :
68  wxTreeCtrl( (wxWindow*) parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
69  wxTR_HAS_BUTTONS, wxDefaultValidator, wxT( "HierachyTreeCtrl" ) )
70 {
71  m_parent = parent;
72 
73  // Make an image list containing small icons
74  // All icons are expected having the same size.
75  wxBitmap tree_nosel_bm( KiBitmap( tree_nosel_xpm ) );
76  imageList = new wxImageList( tree_nosel_bm.GetWidth(), tree_nosel_bm.GetHeight(), true, 2 );
77 
78  imageList->Add( tree_nosel_bm );
79  imageList->Add( KiBitmap( tree_sel_xpm ) );
80 
81  AssignImageList( imageList );
82 }
wxImageList * imageList
Definition: hierarch.h:49
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
const BITMAP_OPAQUE tree_sel_xpm[1]
Definition: tree_sel.cpp:57
const BITMAP_OPAQUE tree_nosel_xpm[1]
Definition: tree_nosel.cpp:56
HIERARCHY_NAVIG_DLG * m_parent
Definition: hierarch.h:48

References imageList, KiBitmap(), m_parent, tree_nosel_xpm, and tree_sel_xpm.

Member Function Documentation

◆ onChar()

void HIERARCHY_TREE::onChar ( wxKeyEvent &  event)

Definition at line 151 of file hierarch.cpp.

152 {
153  if( event.GetKeyCode() == WXK_ESCAPE )
154  m_parent->Close( true );
155  else
156  event.Skip();
157 }
HIERARCHY_NAVIG_DLG * m_parent
Definition: hierarch.h:48

References m_parent.

Referenced by HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG(), and HIERARCHY_NAVIG_DLG::~HIERARCHY_NAVIG_DLG().

Member Data Documentation

◆ imageList

wxImageList* HIERARCHY_TREE::imageList
private

Definition at line 49 of file hierarch.h.

Referenced by HIERARCHY_TREE().

◆ m_parent

HIERARCHY_NAVIG_DLG* HIERARCHY_TREE::m_parent
private

Definition at line 48 of file hierarch.h.

Referenced by HIERARCHY_TREE(), and onChar().


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