]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/treectrl/treetest.h
Correct drawing of check marks for owner-drawn items without bitmaps.
[wxWidgets.git] / samples / treectrl / treetest.h
index e2908c0c449c60e0ec6f2da6b79aa67213871f4b..90bbebb0da2cb874b59a1198f7f01bb71b32eab9 100644 (file)
@@ -123,6 +123,13 @@ public:
     void SetAlternateStates(bool show) { m_alternateStates = show; }
     bool AlternateStates() const { return m_alternateStates; }
 
+    void ResetBrokenStateImages()
+    {
+        const size_t count = GetStateImageList()->GetImageCount();
+        int state = count > 0 ? count - 1 : wxTREE_ITEMSTATE_NONE;
+        DoResetBrokenStateImages(GetRootItem(), 0, state);
+    }
+
 protected:
     virtual int OnCompareItems(const wxTreeItemId& i1, const wxTreeItemId& i2);
 
@@ -139,6 +146,9 @@ private:
                              size_t depth,
                              size_t folder);
 
+    void DoResetBrokenStateImages(const wxTreeItemId& idParent,
+                                  wxTreeItemIdValue cookie, int state);
+
     void LogEvent(const wxChar *name, const wxTreeEvent& event);
 
     int          m_imageSize;               // current size of images
@@ -218,6 +228,7 @@ public:
     void OnClearBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(false); }
 
     void OnEnsureVisible(wxCommandEvent& event);
+    void OnSetFocus(wxCommandEvent& event);
 
     void OnCount(wxCommandEvent& event);
     void OnCountRec(wxCommandEvent& event);
@@ -246,9 +257,18 @@ public:
 #endif // wxHAS_LAST_VISIBLE
 
     void OnShowNextVisible(wxCommandEvent& WXUNUSED(event))
-        { DoShowNextOrPrev(&wxTreeCtrl::GetNextVisible, "next visible"); }
+        { DoShowRelativeItem(&wxTreeCtrl::GetNextVisible, "next visible"); }
     void OnShowPrevVisible(wxCommandEvent& WXUNUSED(event))
-        { DoShowNextOrPrev(&wxTreeCtrl::GetPrevVisible, "previous visible"); }
+        { DoShowRelativeItem(&wxTreeCtrl::GetPrevVisible, "previous visible"); }
+
+    void OnShowParent(wxCommandEvent& WXUNUSED(event))
+        { DoShowRelativeItem(&wxTreeCtrl::GetItemParent, "parent"); }
+    void OnShowPrevSibling(wxCommandEvent& WXUNUSED(event))
+        { DoShowRelativeItem(&wxTreeCtrl::GetPrevSibling, "previous sibling"); }
+    void OnShowNextSibling(wxCommandEvent& WXUNUSED(event))
+        { DoShowRelativeItem(&wxTreeCtrl::GetNextSibling, "next sibling"); }
+
+    void OnScrollTo(wxCommandEvent& event);
 
     void OnIdle(wxIdleEvent& event);
     void OnSize(wxSizeEvent& event);
@@ -268,7 +288,7 @@ private:
     void DoShowFirstOrLast(TreeFunc0_t pfn, const wxString& label);
 
     typedef wxTreeItemId (wxTreeCtrl::*TreeFunc1_t)(const wxTreeItemId&) const;
-    void DoShowNextOrPrev(TreeFunc1_t pfn, const wxString& label);
+    void DoShowRelativeItem(TreeFunc1_t pfn, const wxString& label);
 
 
     wxPanel *m_panel;
@@ -322,6 +342,7 @@ enum
     TreeTest_ToggleSel,
     TreeTest_CollapseAndReset,
     TreeTest_EnsureVisible,
+    TreeTest_SetFocus,
     TreeTest_AddItem,
     TreeTest_InsertItem,
     TreeTest_IncIndent,
@@ -337,5 +358,9 @@ enum
     TreeTest_ShowLastVisible,
     TreeTest_ShowNextVisible,
     TreeTest_ShowPrevVisible,
+    TreeTest_ShowParent,
+    TreeTest_ShowPrevSibling,
+    TreeTest_ShowNextSibling,
+    TreeTest_ScrollTo,
     TreeTest_Ctrl = 1000
 };