From 4a11cca24d9781e45bfffc402e1b26d1e69f169f Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 1 Mar 2004 23:28:50 +0000 Subject: [PATCH] Spin control now emits TEXT_ENTER commands. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/spinctrl.cpp | 10 ++++++++++ src/gtk1/spinctrl.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) 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(); }