From: Václav Slavík Date: Mon, 5 Sep 2011 14:25:31 +0000 (+0000) Subject: wxDataViewCtrl: enable F2 editing with multiple selection too. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a027a36f2c15b98dd3e2c42de406f4c4593cca76 wxDataViewCtrl: enable F2 editing with multiple selection too. This matches the native (and thus expected) behavior of Windows Explorer: edit the first item in selection. It's also better than ignoring user's key presses. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 5850e4a00d..b7bcd11253 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3379,7 +3379,7 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event ) case WXK_F2: { - if(m_selection.size() == 1) + if( !m_selection.empty() ) { // TODO: we need to revise that when we have a concept for a 'current column' GetOwner()->StartEditor(GetItemByRow(m_selection[0]), 0);