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
This commit is contained in:
Václav Slavík 2011-09-05 14:25:31 +00:00
parent d6397a9f35
commit a027a36f2c

View 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);