]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
Applied patch [ 1374215 ] Bug fix to wxSpinCtrl for Windows
[wxWidgets.git] / src / msw / treectrl.cpp
index ffa8a9a15a808e0ece43e7adf13a137e581c560d..1a0cf91a8837453752022aed081e4d0233ca5540 100644 (file)
@@ -42,7 +42,7 @@
 #include "wx/dynarray.h"
 #include "wx/imaglist.h"
 #include "wx/settings.h"
 #include "wx/dynarray.h"
 #include "wx/imaglist.h"
 #include "wx/settings.h"
-#include "wx/msw/treectrl.h"
+#include "wx/treectrl.h"
 #include "wx/msw/dragimag.h"
 
 // macros to hide the cast ugliness
 #include "wx/msw/dragimag.h"
 
 // macros to hide the cast ugliness
@@ -311,6 +311,11 @@ public:
         m_tree = tree;
     }
 
         m_tree = tree;
     }
 
+    // give it a virtual dtor: not really needed as the class is never used
+    // polymorphically and not even allocated on heap at all, but this is safer
+    // (in case it ever is) and silences the compiler warnings for now
+    virtual ~wxTreeTraversal() { }
+
     // do traverse the tree: visit all items (recursively by default) under the
     // given one; return true if all items were traversed or false if the
     // traversal was aborted because OnVisit returned false
     // do traverse the tree: visit all items (recursively by default) under the
     // given one; return true if all items were traversed or false if the
     // traversal was aborted because OnVisit returned false
@@ -830,9 +835,9 @@ void wxTreeCtrl::SetIndent(unsigned int indent)
 void wxTreeCtrl::SetAnyImageList(wxImageList *imageList, int which)
 {
     // no error return
 void wxTreeCtrl::SetAnyImageList(wxImageList *imageList, int which)
 {
     // no error return
-    TreeView_SetImageList(GetHwnd(),
-                          imageList ? imageList->GetHIMAGELIST() : 0,
-                          which);
+    (void) TreeView_SetImageList(GetHwnd(),
+                                 imageList ? imageList->GetHIMAGELIST() : 0,
+                                 which);
 }
 
 void wxTreeCtrl::SetImageList(wxImageList *imageList)
 }
 
 void wxTreeCtrl::SetImageList(wxImageList *imageList)
@@ -1678,24 +1683,6 @@ wxTreeItemId wxTreeCtrl::DoInsertAfter(const wxTreeItemId& parent,
 // for compatibility only
 #if WXWIN_COMPATIBILITY_2_4
 
 // for compatibility only
 #if WXWIN_COMPATIBILITY_2_4
 
-wxTreeItemId wxTreeCtrl::InsertItem(const wxTreeItemId& parent,
-                                    const wxString& text,
-                                    int image, int selImage,
-                                    long insertAfter)
-{
-    return DoInsertAfter(parent,
-                         wxTreeItemId(wxUIntToPtr(insertAfter)),
-                         text,
-                         image,
-                         selImage,
-                         NULL);
-}
-
-wxImageList *wxTreeCtrl::GetImageList(int) const
-{
-    return GetImageList();
-}
-
 void wxTreeCtrl::SetImageList(wxImageList *imageList, int)
 {
     SetImageList(imageList);
 void wxTreeCtrl::SetImageList(wxImageList *imageList, int)
 {
     SetImageList(imageList);
@@ -1955,16 +1942,6 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select)
     }
 }
 
     }
 }
 
-void wxTreeCtrl::UnselectItem(const wxTreeItemId& item)
-{
-    SelectItem(item, false);
-}
-
-void wxTreeCtrl::ToggleItemSelection(const wxTreeItemId& item)
-{
-    SelectItem(item, !IsSelected(item));
-}
-
 void wxTreeCtrl::EnsureVisible(const wxTreeItemId& item)
 {
     // no error return
 void wxTreeCtrl::EnsureVisible(const wxTreeItemId& item)
 {
     // no error return
@@ -2037,13 +2014,13 @@ void wxTreeCtrl::DoEndEditLabel(bool discardChanges)
     DeleteTextCtrl();
 }
 
     DeleteTextCtrl();
 }
 
-wxTreeItemId wxTreeCtrl::DoHitTest(const wxPoint& point, int& flags)
+wxTreeItemId wxTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags)
 {
     TV_HITTESTINFO hitTestInfo;
     hitTestInfo.pt.x = (int)point.x;
     hitTestInfo.pt.y = (int)point.y;
 
 {
     TV_HITTESTINFO hitTestInfo;
     hitTestInfo.pt.x = (int)point.x;
     hitTestInfo.pt.y = (int)point.y;
 
-    TreeView_HitTest(GetHwnd(), &hitTestInfo);
+    (void) TreeView_HitTest(GetHwnd(), &hitTestInfo);
 
     flags = 0;
 
 
     flags = 0;
 
@@ -2131,12 +2108,6 @@ int CALLBACK wxTreeSortHelper::Compare(LPARAM pItem1,
                                 GetIdFromData(tree, pItem2));
 }
 
                                 GetIdFromData(tree, pItem2));
 }
 
-int wxTreeCtrl::OnCompareItems(const wxTreeItemId& item1,
-                               const wxTreeItemId& item2)
-{
-    return wxStrcmp(GetItemText(item1), GetItemText(item2));
-}
-
 void wxTreeCtrl::SortChildren(const wxTreeItemId& item)
 {
     wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
 void wxTreeCtrl::SortChildren(const wxTreeItemId& item)
 {
     wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
@@ -2239,12 +2210,12 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
         int x = GET_X_LPARAM(lParam),
             y = GET_Y_LPARAM(lParam);
         HTREEITEM htItem = GetItemFromPoint(GetHwnd(), x, y);
         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;
         TV_HITTESTINFO tvht;
         tvht.pt.x = x;
         tvht.pt.y = y;
-    
-        TreeView_HitTest(GetHwnd(), &tvht);
+
+        (void) TreeView_HitTest(GetHwnd(), &tvht);
 
         switch ( nMsg )
         {
 
         switch ( nMsg )
         {
@@ -2269,7 +2240,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
                 {
                     m_htClickedItem = (WXHTREEITEM) htItem;
                     m_ptClick = wxPoint(x, y);
                 {
                     m_htClickedItem = (WXHTREEITEM) htItem;
                     m_ptClick = wxPoint(x, y);
-                    
+
                     if ( wParam & MK_CONTROL )
                     {
                         SetFocus();
                     if ( wParam & MK_CONTROL )
                     {
                         SetFocus();
@@ -2309,7 +2280,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
                     {
                         // avoid doing anything if we click on the only
                         // currently selected item
                     {
                         // avoid doing anything if we click on the only
                         // currently selected item
-                        
+
                         SetFocus();
 
                         wxArrayTreeItemIds selections;
                         SetFocus();
 
                         wxArrayTreeItemIds selections;
@@ -2363,29 +2334,29 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
                             tv.hdr.hwndFrom = GetHwnd();
                             tv.hdr.idFrom = ::GetWindowLong( GetHwnd(), GWL_ID );
                             tv.hdr.code = TVN_BEGINDRAG;
                             tv.hdr.hwndFrom = GetHwnd();
                             tv.hdr.idFrom = ::GetWindowLong( GetHwnd(), GWL_ID );
                             tv.hdr.code = TVN_BEGINDRAG;
-            
+
                             tv.itemNew.hItem = HITEM(m_htClickedItem);
                             tv.itemNew.hItem = HITEM(m_htClickedItem);
-                            
+
                             TVITEM tviAux;
                             ZeroMemory(&tviAux, sizeof(tviAux));
                             tviAux.hItem = HITEM(m_htClickedItem);
                             tviAux.mask = TVIF_STATE | TVIF_PARAM;
                             tviAux.stateMask = 0xffffffff;
                             TreeView_GetItem( GetHwnd(), &tviAux );
                             TVITEM tviAux;
                             ZeroMemory(&tviAux, sizeof(tviAux));
                             tviAux.hItem = HITEM(m_htClickedItem);
                             tviAux.mask = TVIF_STATE | TVIF_PARAM;
                             tviAux.stateMask = 0xffffffff;
                             TreeView_GetItem( GetHwnd(), &tviAux );
-                            
+
                             tv.itemNew.state = tviAux.state;
                             tv.itemNew.lParam = tviAux.lParam;
                             tv.itemNew.state = tviAux.state;
                             tv.itemNew.lParam = tviAux.lParam;
-            
+
                             tv.ptDrag.x = x;
                             tv.ptDrag.y = y;
                             tv.ptDrag.x = x;
                             tv.ptDrag.y = y;
-            
+
                             ::SendMessage( pWnd, WM_NOTIFY, tv.hdr.idFrom, (LPARAM)&tv );
                         }
                         m_htClickedItem.Unset();
                     }
                 }
 #endif // __WXWINCE__
                             ::SendMessage( pWnd, WM_NOTIFY, tv.hdr.idFrom, (LPARAM)&tv );
                         }
                         m_htClickedItem.Unset();
                     }
                 }
 #endif // __WXWINCE__
-                
+
                 if ( m_dragImage )
                 {
                     m_dragImage->Move(wxPoint(x, y));
                 if ( m_dragImage )
                 {
                     m_dragImage->Move(wxPoint(x, y));
@@ -3181,4 +3152,3 @@ int wxTreeCtrl::GetState(const wxTreeItemId& node)
 }
 
 #endif // wxUSE_TREECTRL
 }
 
 #endif // wxUSE_TREECTRL
-