Add wxControlWithItems::SendSelectionChangedEvent() helper.

Reuse the same event generation code for wxChoice in wxMSW, wxGTK and wxOSX
and also wxComboBox in wxMSW and wxGTK instead of duplicating it (incompletely
and so partially incorrectly in wxOSX case).

This is just a refactoring so no changes in behaviour.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-12-02 23:48:59 +00:00
parent 4d3845c073
commit 7bc740719c
6 changed files with 26 additions and 57 deletions

View File

@@ -101,22 +101,6 @@ wxChoice::~wxChoice()
delete m_strings;
}
void wxChoice::SendSelectionChangedEvent(wxEventType evt_type)
{
if (GetSelection() == -1)
return;
wxCommandEvent event( evt_type, GetId() );
int n = GetSelection();
event.SetInt( n );
event.SetString( GetStringSelection() );
event.SetEventObject( this );
InitCommandEventWithItems( event, n );
HandleWindowEvent( event );
}
void wxChoice::GTKInsertComboBoxTextItem( unsigned int n, const wxString& text )
{
#ifdef __WXGTK3__