]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
fixed LastRead() after Read(wxOutputStream&) (patch 1658301)
[wxWidgets.git] / src / msw / treectrl.cpp
index b44bf35a7d289b2f7050e2acd03335760ed9f33f..f314a7a873d8563cdc05a3070225477b06684d26 100644 (file)
 // private functions
 // ----------------------------------------------------------------------------
 
-// wrapper for TreeView_HitTest
-static HTREEITEM GetItemFromPoint(HWND hwndTV, int x, int y)
-{
-    TV_HITTESTINFO tvht;
-    tvht.pt.x = x;
-    tvht.pt.y = y;
-
-    return (HTREEITEM)TreeView_HitTest(hwndTV, &tvht);
-}
-
 // wrappers for TreeView_GetItem/TreeView_SetItem
 static bool IsItemSelected(HWND hwndTV, HTREEITEM hItem)
 {
@@ -1175,7 +1165,7 @@ void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font)
     // Reset the item's text to ensure that the bounding rect will be adjusted
     // for the new font.
     SetItemText(item, GetItemText(item));
-    
+
     RefreshItem(item);
 }
 
@@ -2059,13 +2049,12 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
         // same meaning for all of them
         int x = GET_X_LPARAM(lParam),
             y = GET_Y_LPARAM(lParam);
-        HTREEITEM htItem = GetItemFromPoint(GetHwnd(), x, y);
 
         TV_HITTESTINFO tvht;
         tvht.pt.x = x;
         tvht.pt.y = y;
 
-        (void) TreeView_HitTest(GetHwnd(), &tvht);
+        HTREEITEM htItem = TreeView_HitTest(GetHwnd(), &tvht);
 
         switch ( nMsg )
         {
@@ -2235,6 +2224,8 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
 
                     // generate the drag end event
                     wxTreeEvent event(wxEVT_COMMAND_TREE_END_DRAG, this, htItem);
+                    event.m_pointDrag = wxPoint(x, y);
+
                     (void)GetEventHandler()->ProcessEvent(event);
 
                     // if we don't do it, the tree seems to think that 2 items