X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b07664068bc48173d08e3146ca05dceac275aa6a..a582395301f296706dc9e59d0346cddd165eacd8:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 2438d11b72..22ee0816c9 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -40,7 +40,7 @@ #include "wx/spinctrl.h" #include "wx/msw/private.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) +#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10__)) #include #endif @@ -98,7 +98,12 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd, if (!(::IsWindow(hwnd) && ((wxSpinCtrl *)::GetWindowLong(hwnd, GWL_USERDATA)) == spin)) return 0; break; + + case WM_GETDLGCODE: + // we want to get WXK_RETURN in order to generate the event for it + return DLGC_WANTCHARS; } + return ::CallWindowProc(CASTWNDPROC spin->GetBuddyWndProc(), hwnd, message, wParam, lParam); } @@ -248,7 +253,6 @@ bool wxSpinCtrl::Create(wxWindow *parent, if ( style & wxCLIP_SIBLINGS ) msStyle |= WS_CLIPSIBLINGS; - // create the text window m_hwndBuddy = (WXHWND)::CreateWindowEx ( @@ -313,6 +317,10 @@ wxSpinCtrl::~wxSpinCtrl() { ms_allSpins.Remove(this); + // This removes spurious memory leak reporting + if (ms_allSpins.GetCount() == 0) + ms_allSpins.Clear(); + // destroy the buddy window because this pointer which wxBuddyTextWndProc // uses will not soon be valid any more ::DestroyWindow(GetBuddyHwnd());