// accessors: set/get the item associated with this node
void SetId(const wxTreeItemId& id) { m_itemId = id; }
- const wxTreeItemId& GetId() const { return m_itemId; }
+ const wxTreeItemId& GetId() const { return (wxTreeItemId&) m_itemId; }
};
// ----------------------------------------------------------------------------
// is this item currently selected (the same as has focus)?
bool IsSelected(const wxTreeItemId& item) const;
+ // number of children
+ // ------------------
+
+ // if 'recursively' is FALSE, only immediate children count, otherwise
+ // the returned number is the number of all items in this branch
+ size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE);
+
// navigation
// ----------
// implementation
// --------------
void Command(wxCommandEvent& event) { ProcessCommand(event); };
- bool MSWCommand(WXUINT param, WXWORD id);
- bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
+ virtual bool MSWCommand(WXUINT param, WXWORD id);
+ virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
protected:
// SetImageList helper
// NB: note that not all accessors make sense for all events, see the event
// descriptions below
// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxTreeEvent : public wxCommandEvent
+class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent
{
friend wxTreeCtrl;
public:
// keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only)
int GetCode() const { return m_code; }
- // set return code for wxEVT_COMMAND_TREE_ITEM_{EXPAND|COLLAPS}ING events
- // call this to forbid the change in item status
- void Veto() { m_code = TRUE; }
-
private:
// @@ we could save some space by using union here
int m_code;