fixed sending 2 events (normal and bogus cancel one) when ending to edit a tree ctrl item (same thing as patch 978403 for treectlg.cpp)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28516 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2004-07-27 08:53:10 +00:00
parent b082b52407
commit 768276f6ed

View File

@ -2074,12 +2074,14 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event )
switch ( event.m_keyCode )
{
case WXK_RETURN:
if ( !AcceptChanges() )
if ( AcceptChanges() )
{
// vetoed by the user code
break;
// Close the text control, changes were accepted
Finish();
}
//else: fall through
// else do nothing, do not accept and do not close
break;
case WXK_ESCAPE:
Finish();