From: Vadim Zeitlin Date: Mon, 28 Apr 2008 11:31:09 +0000 (+0000) Subject: fix wxEVT_COMMAND_TEXT_ENTER generation in wxSpinCtrl; add a test for it to the widge... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/952ff7bc3ccf0b5dc8622cd3e851c9f85c163736?ds=sidebyside;hp=52bbab36a22011d4fcccdcd608fd4a0b933824ea fix wxEVT_COMMAND_TEXT_ENTER generation in wxSpinCtrl; add a test for it to the widgets sample git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53396 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index 0447d66d65..965b5e6377 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -100,6 +100,7 @@ protected: void OnSpinCtrl(wxSpinEvent& event); void OnSpinCtrlDouble(wxSpinDoubleEvent& event); void OnSpinText(wxCommandEvent& event); + void OnSpinTextEnter(wxCommandEvent& event); void OnUpdateUIValueButton(wxUpdateUIEvent& event); void OnUpdateUIMinMaxButton(wxUpdateUIEvent& event); @@ -167,6 +168,7 @@ BEGIN_EVENT_TABLE(SpinBtnWidgetsPage, WidgetsPage) EVT_SPINCTRL(SpinBtnPage_SpinCtrl, SpinBtnWidgetsPage::OnSpinCtrl) EVT_SPINCTRLDOUBLE(SpinBtnPage_SpinCtrlDouble, SpinBtnWidgetsPage::OnSpinCtrlDouble) EVT_TEXT(SpinBtnPage_SpinCtrl, SpinBtnWidgetsPage::OnSpinText) + EVT_TEXT_ENTER(SpinBtnPage_SpinCtrl, SpinBtnWidgetsPage::OnSpinTextEnter) EVT_TEXT(SpinBtnPage_SpinCtrlDouble, SpinBtnWidgetsPage::OnSpinText) EVT_CHECKBOX(wxID_ANY, SpinBtnWidgetsPage::OnCheckOrRadioBox) @@ -475,4 +477,10 @@ void SpinBtnWidgetsPage::OnSpinText(wxCommandEvent& event) event.GetString().c_str()); } +void SpinBtnWidgetsPage::OnSpinTextEnter(wxCommandEvent& event) +{ + wxLogMessage("\"Enter\" pressed in spin control, text is \"%s\"", + event.GetString()); +} + #endif // wxUSE_SPINBTN diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index e5a4577acf..a2a38c0437 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -178,7 +178,7 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd, case WM_GETDLGCODE: // we want to get WXK_RETURN in order to generate the event for it - return DLGC_WANTCHARS; + return DLGC_WANTALLKEYS; } return ::CallWindowProc(CASTWNDPROC spin->GetBuddyWndProc(),