if ( wParam == VK_RETURN )
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
- InitCommandEvent(event);
+
+ const int sel = GetSelection();
+ event.SetInt(sel);
event.SetString(GetValue());
- event.SetInt(GetSelection());
+ InitCommandEventWithItems(event, sel);
+
if ( ProcessCommand(event) )
{
// don't let the event through to the native control
value = GetStringSelection();
{
wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId());
- event.SetEventObject(this);
event.SetInt(sel);
event.SetString(value);
+ InitCommandEventWithItems(event, sel);
+
ProcessCommand(event);
}
case CBN_EDITCHANGE:
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
- event.SetEventObject(this);
// if sel != -1, value was already initialized above
if ( sel == -1 )
}
event.SetString(value);
+ InitCommandEventWithItems(event, sel);
+
ProcessCommand(event);
}
break;