From: Robert Roebling Date: Mon, 1 Mar 2004 23:28:50 +0000 (+0000) Subject: Spin control now emits TEXT_ENTER commands. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4a11cca24d9781e45bfffc402e1b26d1e69f169f Spin control now emits TEXT_ENTER commands. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index b1d33df231..44d10c8a73 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -290,6 +290,16 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) } } + if ((event.GetKeyCode() == WXK_RETURN)) + { + wxCommandEvent evt( wxEVT_COMMAND_TEXT_ENTER, m_windowId ); + evt.SetEventObject(this); + GtkSpinButton *gsb = GTK_SPIN_BUTTON(m_widget); + wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) ); + evt.SetString( val ); + if (GetEventHandler()->ProcessEvent(evt)) return; + } + event.Skip(); } diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index b1d33df231..44d10c8a73 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -290,6 +290,16 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) } } + if ((event.GetKeyCode() == WXK_RETURN)) + { + wxCommandEvent evt( wxEVT_COMMAND_TEXT_ENTER, m_windowId ); + evt.SetEventObject(this); + GtkSpinButton *gsb = GTK_SPIN_BUTTON(m_widget); + wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) ); + evt.SetString( val ); + if (GetEventHandler()->ProcessEvent(evt)) return; + } + event.Skip(); }