From 77b555c2a46fe089a8f59253e39f3b29505db5cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 29 Aug 2011 17:25:38 +0000 Subject: [PATCH] Send wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED if WXOnActivate() returned false too. This is consistent with wxGTK implementation and generally makes sense: when the renderer cannot handle activation, whole-item activation should be tried next. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datavgen.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 07415d15f6..f4f3b1f80b 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3339,6 +3339,8 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event ) } } + bool activated = false; + if ( activatableCol ) { const unsigned colIdx = activatableCol->GetModelColumn(); @@ -3346,9 +3348,10 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event ) wxDataViewRenderer *cell = activatableCol->GetRenderer(); cell->PrepareForItem(GetModel(), item, colIdx); - cell->WXOnActivate(cell_rect, GetModel(), item, colIdx); + activated = cell->WXOnActivate(cell_rect, GetModel(), item, colIdx); } - else + + if ( !activated ) { wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, parent->GetId()); @@ -3642,6 +3645,8 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) } else if ( current == m_lineLastClicked ) { + bool activated = false; + if ((!ignore_other_columns) && (cell->GetMode() == wxDATAVIEW_CELL_ACTIVATABLE)) { const unsigned colIdx = col->GetModelColumn(); @@ -3650,9 +3655,10 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) wxRect cell_rect( xpos, GetLineStart( current ), col->GetWidth(), GetLineHeight( current ) ); - cell->WXOnActivate( cell_rect, model, item, colIdx ); + activated = cell->WXOnActivate( cell_rect, model, item, colIdx ); } - else + + if ( !activated ) { wxWindow *parent = GetParent(); wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, parent->GetId()); -- 2.47.2