]> git.saurik.com Git - wxWidgets.git/commitdiff
Use the new wxDataViewRenderer activation API in wxTreeListCtrl.
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 21 Oct 2011 16:34:35 +0000 (16:34 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 21 Oct 2011 16:34:35 +0000 (16:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treelist.cpp

index 8672b6e61177835677334a45dc6e228100ba536c..a82a2a9237426f87c737de2579e0a0506926669f 100644 (file)
@@ -549,23 +549,17 @@ public:
     }
 
     // Event handlers toggling the items checkbox if it was clicked.
-    virtual bool Activate(const wxRect& WXUNUSED(cell),
-                          wxDataViewModel* model,
-                          const wxDataViewItem& item,
-                          unsigned int WXUNUSED(col))
+    virtual bool ActivateCell(const wxRect& WXUNUSED(cell),
+                              wxDataViewModel *model,
+                              const wxDataViewItem & item,
+                              unsigned int WXUNUSED(col),
+                              const wxMouseEvent *mouseEvent)
     {
-        static_cast<wxTreeListModel*>(model)->ToggleItem(item);
-        return true;
-    }
-
-    virtual bool LeftClick(const wxPoint& pos,
-                           const wxRect& WXUNUSED(cell),
-                           wxDataViewModel* model,
-                           const wxDataViewItem& item,
-                           unsigned int WXUNUSED(col))
-    {
-        if ( !wxRect(GetCheckSize()).Contains(pos) )
-            return false;
+        if ( mouseEvent )
+        {
+            if ( !wxRect(GetCheckSize()).Contains(mouseEvent->GetPosition()) )
+                return false;
+        }
 
         static_cast<wxTreeListModel*>(model)->ToggleItem(item);
         return true;