]> git.saurik.com Git - wxWidgets.git/commitdiff
wxTreeCtrl::IsVisible() fix
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Nov 1999 22:14:31 +0000 (22:14 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Nov 1999 22:14:31 +0000 (22:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index aebe08ac3959d08b6d478bd7a7dd10abcd8f2bf9..332911d7676bddc4b37934616b209477508e95f3 100644 (file)
@@ -723,7 +723,13 @@ bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const
 {
     // Bug in Gnu-Win32 headers, so don't use the macro TreeView_GetItemRect
     RECT rect;
-    return SendMessage(GetHwnd(), TVM_GETITEMRECT, FALSE, (LPARAM)&rect) != 0;
+
+    // this ugliness comes directly from MSDN - it *is* the correct way to pass
+    // the HTREEITEM with TVM_GETITEMRECT
+    *(WXHTREEITEM *)&rect = (WXHTREEITEM)item;
+
+    // FALSE means get item rect for the whole item, not only text
+    return SendMessage(GetHwnd(), TVM_GETITEMRECT, FALSE, &rect) != 0;
 
 }