From: Václav Slavík Date: Mon, 28 Feb 2011 21:23:10 +0000 (+0000) Subject: Toggle checkboxes in generic wxDataViewCtrl with single click. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d2425a43ec49de87bf97403ca16fb41cdd8a0bc4 Toggle checkboxes in generic wxDataViewCtrl with single click. Both GTK+ and OS X native controls use single click to toggle checkboxes, instead of double-click activation used by the generic version. So does wxCheckListBox on Windows, so make wxDVC behave the same way. See #11185. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/dvrenderers.h b/include/wx/generic/dvrenderers.h index e94e518b87..dc1bc24f7f 100644 --- a/include/wx/generic/dvrenderers.h +++ b/include/wx/generic/dvrenderers.h @@ -121,10 +121,11 @@ public: wxSize GetSize() const; // Implementation only, don't use nor override - virtual bool WXOnActivate(wxRect cell, - wxDataViewModel *model, - const wxDataViewItem& item, - unsigned int col); + virtual bool WXOnLeftClick(wxPoint cursor, + wxRect cell, + wxDataViewModel *model, + const wxDataViewItem& item, + unsigned int col); private: bool m_toggle; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index ef97bb925d..eb1b741996 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -863,10 +863,11 @@ bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state return true; } -bool wxDataViewToggleRenderer::WXOnActivate(wxRect WXUNUSED(cell), - wxDataViewModel *model, - const wxDataViewItem& item, - unsigned int col) +bool wxDataViewToggleRenderer::WXOnLeftClick(wxPoint WXUNUSED(cursor), + wxRect WXUNUSED(cell), + wxDataViewModel *model, + const wxDataViewItem& item, + unsigned int col) { if (model->IsEnabled(item, col)) {