]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/treectlg.h
added wxStaticCast, moved wxConstCast from wx/object.h to wx/defs.h for consistency
[wxWidgets.git] / include / wx / generic / treectlg.h
index e257190faf656fac52d70823ba943dde5fb4bf8c..17ccfc6d4f6275083076982dd190c4aa7c3f00ef 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef _GENERIC_TREECTRL_H_
 #define _GENERIC_TREECTRL_H_
 
-#if defined(__GNUG__) && !defined(__APPLE__)
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma interface "treectlg.h"
 #endif
 
@@ -301,9 +301,18 @@ public:
 
         // 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);
@@ -361,6 +370,7 @@ public:
                               long& cookie) const;
 #endif // WXWIN_COMPATIBILITY_2_4
 
+    virtual bool ShouldInheritColours() const { return false; }
 
     // implementation only from now on
 
@@ -431,6 +441,10 @@ protected:
     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,