]>
git.saurik.com Git - wxWidgets.git/blob - utils/configtool/src/configtree.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxWidgets Configuration Tool tree class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _CT_CONFIGTREE_H_
14 #define _CT_CONFIGTREE_H_
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "configtree.cpp"
21 #include "wx/treectrl.h"
23 #include "configitem.h"
28 * Holds the ctConfigItem for each tree item.
31 class ctTreeItemData
: public wxTreeItemData
34 ctTreeItemData(ctConfigItem
* item
) : m_configItem(item
) { }
37 ctConfigItem
*GetConfigItem() const { return m_configItem
; }
38 void SetConfigItem(ctConfigItem
*item
) { m_configItem
= item
; }
41 ctConfigItem
* m_configItem
;
47 * The options hierarchy viewer.
50 class ctConfigTreeCtrl
: public wxTreeCtrl
52 DECLARE_CLASS(ctConfigTreeCtrl
)
54 ctConfigTreeCtrl(wxWindow
* parent
, wxWindowID id
, const wxPoint
& pt
= wxDefaultPosition
,
55 const wxSize
& sz
= wxDefaultSize
, long style
= wxTR_HAS_BUTTONS
);
59 void OnMouseEvent(wxMouseEvent
& event
);
60 void OnSelChanged(wxTreeEvent
& event
);
61 void OnHelp(wxHelpEvent
& event
);
62 void OnKeyDown(wxKeyEvent
& event
);
66 /// Get the table of icons
67 wxIconTable
& GetIconTable() { return m_iconTable
; }
69 /// Get the context menu
70 wxMenu
* GetMenu() { return m_contextMenu
; }
72 /// Get the item associated with the context menu events
73 ctConfigItem
* GetContextItem() { return m_contextItem
; }
81 wxImageList
* m_imageList
;
82 wxIconTable m_iconTable
;
83 wxMenu
* m_contextMenu
;
84 // The item associated with the context menu events
85 ctConfigItem
* m_contextItem
;