- // structure describing a registry key/value
- class TreeNode : public wxTreeItemData
- {
- WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
- public:
- RegTreeCtrl *m_pTree; // must be !NULL
- TreeNode *m_pParent; // NULL only for the root node
- long m_id; // the id of the tree control item
- wxString m_strName; // name of the key/value
- TreeChildren m_aChildren; // array of subkeys/values
- bool m_bKey; // key or value?
- wxRegKey *m_pKey; // only may be !NULL if m_bKey == true
-
- // trivial accessors
- long Id() const { return m_id; }
- bool IsRoot() const { return m_pParent == NULL; }
- bool IsKey() const { return m_bKey; }
- TreeNode *Parent() const { return m_pParent; }
-
- // notifications
- bool OnExpand();
- void OnCollapse();
-
- // operations
- void Refresh();
- bool DeleteChild(TreeNode *child);
- void DestroyChildren();
- const char *FullName() const;
-
- // get the associated key: make sure the pointer is !NULL
- wxRegKey& Key() { if ( !m_pKey ) OnExpand(); return *m_pKey; }
-
- // dtor deletes all children
- ~TreeNode();
- };
-
- wxImageList *m_imageList;
- wxMenu *m_pMenuPopup;
-
- TreeNode *m_pRoot;
-
- TreeNode *m_draggedItem; // the item being dragged
- bool m_copyOnDrop; // if FALSE, then move
-
- bool m_restoreStatus; // after OnItemExpanding()
-
- TreeNode *GetNode(const wxTreeEvent& event)
- { return (TreeNode *)GetItemData((WXHTREEITEM)event.GetItem()); }
+ // structure describing a registry key/value
+ class TreeNode : public wxTreeItemData
+ {
+ WX_DEFINE_ARRAY_PTR(TreeNode *, TreeChildren);
+ public:
+ RegTreeCtrl *m_pTree; // must be !NULL
+ TreeNode *m_pParent; // NULL only for the root node
+ wxTreeItemId m_id; // the id of the tree control item
+ wxString m_strName; // name of the key/value
+ TreeChildren m_aChildren; // array of subkeys/values
+ bool m_bKey; // key or value?
+ wxRegKey *m_pKey; // only may be !NULL if m_bKey == true
+
+ // trivial accessors
+ wxTreeItemId Id() const { return m_id; }
+ bool IsRoot() const { return m_pParent == NULL; }
+ bool IsKey() const { return m_bKey; }
+ TreeNode *Parent() const { return m_pParent; }
+
+ // notifications
+ bool OnExpand();
+ void OnCollapse();
+
+ // operations
+ void Refresh();
+ bool DeleteChild(TreeNode *child);
+ void DestroyChildren();
+ const wxChar *FullName() const;
+
+ // get the associated key: make sure the pointer is !NULL
+ wxRegKey& Key() { if ( !m_pKey ) OnExpand(); return *m_pKey; }
+
+ // dtor deletes all children
+ ~TreeNode();
+ };
+
+ wxImageList *m_imageList;
+ wxMenu *m_pMenuPopup;
+
+ TreeNode *m_pRoot;
+
+ TreeNode *m_draggedItem; // the item being dragged
+ bool m_copyOnDrop; // if false, then move
+
+ bool m_restoreStatus; // after OnItemExpanding()
+
+ wxString m_nameOld; // the initial value of item being renamed
+
+ TreeNode *GetNode(const wxTreeEvent& event)
+ { return (TreeNode *)GetItemData(event.GetItem()); }