]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
Added samples.inc to DATAFILES in Makefile.in - is that enough?
[wxWidgets.git] / src / msw / treectrl.cpp
index c0eb3fd506e0f814e5ba2a618b66afd7747c13e8..f231242b85621d56d0bcb08d7b7a534d1f3d4285 100644 (file)
 // looks quite ugly.
 #define wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE 0
 
 // looks quite ugly.
 #define wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE 0
 
-// from msw/window.cpp
-extern bool wxIsShiftDown();
-extern bool wxIsCtrlDown();
-
 // ----------------------------------------------------------------------------
 // private functions
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // private functions
 // ----------------------------------------------------------------------------
@@ -101,7 +97,6 @@ static HTREEITEM GetItemFromPoint(HWND hwndTV, int x, int y)
     tvht.pt.x = x;
     tvht.pt.y = y;
 
     tvht.pt.x = x;
     tvht.pt.y = y;
 
-    // TreeView_HitTest() doesn't do the right cast in mingw32 headers
     return (HTREEITEM)TreeView_HitTest(hwndTV, &tvht);
 }
 
     return (HTREEITEM)TreeView_HitTest(hwndTV, &tvht);
 }
 
@@ -156,7 +151,7 @@ static void SelectRange(HWND hwndTV,
 {
     // find the first (or last) item and select it
     bool cont = TRUE;
 {
     // find the first (or last) item and select it
     bool cont = TRUE;
-    HTREEITEM htItem = TreeView_GetRoot(hwndTV);
+    HTREEITEM htItem = (HTREEITEM)TreeView_GetRoot(hwndTV);
     while ( htItem && cont )
     {
         if ( (htItem == htFirst) || (htItem == htLast) )
     while ( htItem && cont )
     {
         if ( (htItem == htFirst) || (htItem == htLast) )
@@ -176,7 +171,7 @@ static void SelectRange(HWND hwndTV,
             }
         }
 
             }
         }
 
-        htItem = TreeView_GetNextVisible(hwndTV, htItem);
+        htItem = (HTREEITEM)TreeView_GetNextVisible(hwndTV, htItem);
     }
 
     // select the items in range
     }
 
     // select the items in range
@@ -190,7 +185,7 @@ static void SelectRange(HWND hwndTV,
 
         cont = (htItem != htFirst) && (htItem != htLast);
 
 
         cont = (htItem != htFirst) && (htItem != htLast);
 
-        htItem = TreeView_GetNextVisible(hwndTV, htItem);
+        htItem = (HTREEITEM)TreeView_GetNextVisible(hwndTV, htItem);
     }
 
     // unselect the rest
     }
 
     // unselect the rest
@@ -203,7 +198,7 @@ static void SelectRange(HWND hwndTV,
                 UnselectItem(hwndTV, htItem);
             }
 
                 UnselectItem(hwndTV, htItem);
             }
 
-            htItem = TreeView_GetNextVisible(hwndTV, htItem);
+            htItem = (HTREEITEM)TreeView_GetNextVisible(hwndTV, htItem);
         }
     }
 
         }
     }
 
@@ -218,7 +213,7 @@ static void SelectRange(HWND hwndTV,
 static void SetFocus(HWND hwndTV, HTREEITEM htItem)
 {
     // the current focus
 static void SetFocus(HWND hwndTV, HTREEITEM htItem)
 {
     // the current focus
-    HTREEITEM htFocus = TreeView_GetSelection(hwndTV);
+    HTREEITEM htFocus = (HTREEITEM)TreeView_GetSelection(hwndTV);
 
     if ( htItem )
     {
 
     if ( htItem )
     {
@@ -1725,15 +1720,6 @@ long wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
             case WM_LBUTTONDOWN:
                 if ( htItem && isMultiple )
                 {
             case WM_LBUTTONDOWN:
                 if ( htItem && isMultiple )
                 {
-<<<<<<< treectrl.cpp
-                    int x = GET_X_LPARAM(lParam),
-                        y = GET_Y_LPARAM(lParam);
-
-                    m_dragImage->Move(wxPoint(x, y));
-
-                    HTREEITEM htiTarget = GetItemFromPoint(GetHwnd(), x, y);
-                    if ( htiTarget )
-=======
                     if ( wParam & MK_CONTROL )
                     {
                         SetFocus();
                     if ( wParam & MK_CONTROL )
                     {
                         SetFocus();
@@ -1787,7 +1773,7 @@ long wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
             case WM_MOUSEMOVE:
                 if ( m_dragImage )
                 {
             case WM_MOUSEMOVE:
                 if ( m_dragImage )
                 {
-                    m_dragImage->Move(wxPoint(x, y), this);
+                    m_dragImage->Move(wxPoint(x, y));
                     if ( htItem )
                     {
                         // highlight the item as target (hiding drag image is
                     if ( htItem )
                     {
                         // highlight the item as target (hiding drag image is
@@ -1851,7 +1837,7 @@ long wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
         // we handle.arrows and space, but not page up/down and home/end: the
         // latter should be easy, but not the former
 
         // we handle.arrows and space, but not page up/down and home/end: the
         // latter should be easy, but not the former
 
-        HTREEITEM htSel = TreeView_GetSelection(GetHwnd());
+        HTREEITEM htSel = (HTREEITEM)TreeView_GetSelection(GetHwnd());
         if ( !m_htSelStart )
         {
             m_htSelStart = (WXHTREEITEM)htSel;
         if ( !m_htSelStart )
         {
             m_htSelStart = (WXHTREEITEM)htSel;
@@ -1884,9 +1870,9 @@ long wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
             {
                 (void)wxControl::MSWWindowProc(nMsg, wParam, lParam);
 
             {
                 (void)wxControl::MSWWindowProc(nMsg, wParam, lParam);
 
-                HTREEITEM htNext =
-                    wParam == VK_UP ? TreeView_GetPrevVisible(GetHwnd(), htSel)
-                                    : TreeView_GetNextVisible(GetHwnd(), htSel);
+                HTREEITEM htNext = (HTREEITEM)(wParam == VK_UP
+                                    ? TreeView_GetPrevVisible(GetHwnd(), htSel)
+                                    : TreeView_GetNextVisible(GetHwnd(), htSel));
 
                 if ( !htNext )
                 {
 
                 if ( !htNext )
                 {