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);
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
void OnSelect(wxCommandEvent& event);
void OnUnselect(wxCommandEvent& event);
void OnToggleSel(wxCommandEvent& event);
+ void OnSelectChildren(wxCommandEvent& event);
#endif // NO_MULTIPLE_SELECTION
void OnSelectRoot(wxCommandEvent& event);
void OnDelete(wxCommandEvent& event);
void OnClearBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(false); }
void OnEnsureVisible(wxCommandEvent& event);
+ void OnSetFocus(wxCommandEvent& event);
void OnCount(wxCommandEvent& event);
void OnCountRec(wxCommandEvent& event);
#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);
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;
TreeTest_ToggleSel,
TreeTest_CollapseAndReset,
TreeTest_EnsureVisible,
+ TreeTest_SetFocus,
TreeTest_AddItem,
TreeTest_InsertItem,
TreeTest_IncIndent,
TreeTest_Select,
TreeTest_Unselect,
TreeTest_SelectRoot,
+ TreeTest_SelectChildren,
TreeTest_ShowFirstVisible,
TreeTest_ShowLastVisible,
TreeTest_ShowNextVisible,
TreeTest_ShowPrevVisible,
+ TreeTest_ShowParent,
+ TreeTest_ShowPrevSibling,
+ TreeTest_ShowNextSibling,
+ TreeTest_ScrollTo,
TreeTest_Ctrl = 1000
};