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:
@@ -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__
|
||||
|
Reference in New Issue
Block a user