From 60d6c7fd37c9fbe3b3ebd1f440a1473abc3f8568 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 21 Oct 2011 16:34:35 +0000 Subject: [PATCH] Use the new wxDataViewRenderer activation API in wxTreeListCtrl. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treelist.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index 8672b6e611..a82a2a9237 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -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(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(model)->ToggleItem(item); return true; -- 2.45.2