made wxTreeCtrl::GetNextVisible() behave in the same way in Win32 as in the generic version and implemented GetPrevVisible() in the generic version

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-10-07 21:58:51 +00:00
parent f0eebb39bc
commit f73eddd2a5
6 changed files with 149 additions and 26 deletions

View File

@@ -225,6 +225,18 @@ public:
void OnToggleIcon(wxCommandEvent& event);
void OnShowFirstVisible(wxCommandEvent& WXUNUSED(event))
{ DoShowFirstOrLast(&wxTreeCtrl::GetFirstVisibleItem, "first visible"); }
#ifdef wxHAS_LAST_VISIBLE // we don't have it currently but may add later
void OnShowLastVisible(wxCommandEvent& WXUNUSED(event))
{ DoShowFirstOrLast(&wxTreeCtrl::GetLastVisibleItem, "last visible"); }
#endif // wxHAS_LAST_VISIBLE
void OnShowNextVisible(wxCommandEvent& WXUNUSED(event))
{ DoShowNextOrPrev(&wxTreeCtrl::GetNextVisible, "next visible"); }
void OnShowPrevVisible(wxCommandEvent& WXUNUSED(event))
{ DoShowNextOrPrev(&wxTreeCtrl::GetPrevVisible, "previous visible"); }
void OnIdle(wxIdleEvent& event);
void OnSize(wxSizeEvent& event);
@@ -238,6 +250,14 @@ private:
void CreateTreeWithDefStyle();
void CreateTree(long style);
// common parts of OnShowFirst/LastVisible() and OnShowNext/PrevVisible()
typedef wxTreeItemId (wxTreeCtrl::*TreeFunc0_t)() const;
void DoShowFirstOrLast(TreeFunc0_t pfn, const wxString& label);
typedef wxTreeItemId (wxTreeCtrl::*TreeFunc1_t)(const wxTreeItemId&) const;
void DoShowNextOrPrev(TreeFunc1_t pfn, const wxString& label);
wxPanel *m_panel;
MyTreeCtrl *m_treeCtrl;
#if wxUSE_LOG
@@ -297,5 +317,9 @@ enum
TreeTest_Select,
TreeTest_Unselect,
TreeTest_SelectRoot,
TreeTest_ShowFirstVisible,
TreeTest_ShowLastVisible,
TreeTest_ShowNextVisible,
TreeTest_ShowPrevVisible,
TreeTest_Ctrl = 1000
};