m_text->Create(owner, wxID_ANY, m_startValue,
wxPoint(rectLabel.x-4,rectLabel.y-4),
wxSize(rectLabel.width+11,rectLabel.height+8));
+ m_text->SetFocus();
+
m_text->PushEventHandler(this);
}
m_text->RemoveEventHandler(this);
m_owner->FinishEditing(m_text);
- delete this;
+ wxPendingDelete.Append( this );
}
}
break;
case WXK_ESCAPE:
- Finish();
m_owner->OnRenameCancelled( m_itemEdited );
+ Finish();
break;
default:
{
if ( !m_finished && !m_aboutToFinish )
{
- // We must finish regardless of success, otherwise we'll get
- // focus problems:
- Finish();
-
if ( !AcceptChanges() )
m_owner->OnRenameCancelled( m_itemEdited );
+
+ Finish();
}
- // We must let the native text control handle focus, too, otherwise
- // it could have problems with the cursor (e.g., in wxGTK).
+ // We must let the native text control handle focus
event.Skip();
}