]> git.saurik.com Git - wxWidgets.git/commitdiff
wxDataViewCtrl: enable F2 editing with multiple selection too.
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 5 Sep 2011 14:25:31 +0000 (14:25 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 5 Sep 2011 14:25:31 +0000 (14:25 +0000)
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

src/generic/datavgen.cpp

index 5850e4a00d00377d939913d42b551345f3e33763..b7bcd11253211cf5294c2078ea9987d73e24d0de 100644 (file)
@@ -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);