// 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);
+ size_t GetChildrenCount(const wxTreeItemId& item,
+ bool recursively = TRUE) const;
// navigation
// ----------
// remove the selection from currently selected item (if any)
void Unselect();
+ // or from the given one (multiselect mode only)
+ void UnselectItem(const wxTreeItemId& item) { SelectItem(item, false); }
+ // or from all
void UnselectAll();
// select this item
- void SelectItem(const wxTreeItemId& item, bool unselect_others=TRUE, bool extended_select=FALSE);
+ void SelectItem(const wxTreeItemId& item, bool select = true);
+ // toggle the item selection
+ void ToggleItemSelection(const wxTreeItemId& item)
+ {
+ SelectItem(item, !IsSelected(item));
+ }
+
// make sure this item is visible (expanding the parent item and/or
// scrolling to this item if necessary)
void EnsureVisible(const wxTreeItemId& item);
virtual bool SetBackgroundColour(const wxColour& colour);
virtual bool SetForegroundColour(const wxColour& colour);
+ virtual void Freeze();
+ virtual void Thaw();
+
// callbacks
void OnPaint( wxPaintEvent &event );
void OnSetFocus( wxFocusEvent &event );
void OnKillFocus( wxFocusEvent &event );
void OnChar( wxKeyEvent &event );
void OnMouse( wxMouseEvent &event );
+ void OnGetToolTip( wxTreeEvent &event );
void OnInternalIdle( );
+ virtual wxVisualAttributes GetDefaultAttributes() const
+ {
+ return GetClassDefaultAttributes(GetWindowVariant());
+ }
+
+ static wxVisualAttributes
+ GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
+
// implementation helpers
protected:
friend class wxGenericTreeItem;
*m_imageListState,
*m_imageListButtons;
+ int m_freezeCount;
int m_dragCount;
wxPoint m_dragStart;
wxGenericTreeItem *m_dropTarget;
wxCursor m_oldCursor; // cursor is changed while dragging
wxGenericTreeItem *m_oldSelection;
+ wxGenericTreeItem *m_underMouse; // for visual effects
wxTreeTextCtrl *m_textCtrl;
wxTimer *m_renameTimer;
void DrawLine(const wxTreeItemId& item, bool below);
void DrawDropEffect(wxGenericTreeItem *item);
+ void DoSelectItem(const wxTreeItemId& id,
+ bool unselect_others = TRUE,
+ bool extended_select = FALSE);
+
wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
size_t previous,
const wxString& text,
DECLARE_NO_COPY_CLASS(wxGenericTreeCtrl)
};
-#if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__)
+#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
/*
* wxTreeCtrl has to be a real class or we have problems with
* the run-time information.
{
}
};
-#endif // !__WXMSW__ || __WIN16__ || __WXUNIVERSAL__
+#endif // !__WXMSW__ || __WXUNIVERSAL__
#endif // wxUSE_TREECTRL