X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6244848856584171db8cd74a7ff227250e46cc54..4dba84be231243149a45a286a651d02be8487423:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 929193aa7d..f174a3d021 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -28,17 +28,19 @@ #endif #ifndef WX_PRECOMP - #include "wx.h" + #include "wx/wx.h" #endif #if defined(__WIN95__) #include "wx/log.h" +#include "wx/dynarray.h" #include "wx/imaglist.h" +#include "wx/msw/treectrl.h" #include "wx/msw/private.h" -#ifndef __GNUWIN32__ +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) #include #endif @@ -54,7 +56,9 @@ #undef GetNextSibling #endif -#include "wx/msw/treectrl.h" +#ifdef GetClassInfo +#undef GetClassInfo +#endif // Bug in headers, sometimes #ifndef TVIS_FOCUSED @@ -453,6 +457,22 @@ wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& WXUNUSED(item), return l; } +wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const +{ + // can this be done more efficiently? + long cookie; + + wxTreeItemId childLast, + child = GetFirstChild(item, cookie); + while ( child.IsOk() ) + { + childLast = child; + child = GetNextChild(item, cookie); + } + + return childLast; +} + wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const { return wxTreeItemId((WXHTREEITEM) TreeView_GetNextSibling(wxhWnd, (HTREEITEM) (WXHTREEITEM) item));