From 3f77c76cc9b0c59a8dd7f3117cf80343ad3be206 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 May 2010 15:31:35 +0000 Subject: [PATCH] Never enable wxSpinCtrlGenericBase window itself at underlying toolkit level. We create wxSpinCtrlGenericBase window disabled at underlying toolkit level (but enabled at the level of wxWidgets API, of course), but calling Disable() and Enable() on it re-enabled it resulting in loss of mouse events under Windows. Don't re-enable it (again, at the low-level toolkit level only) in its Enable() any more but keep this window itself always disabled. Closes #12045. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/spinctlg.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index d030487543..e11a6e0a46 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -282,9 +282,14 @@ void wxSpinCtrlGenericBase::DoMoveWindow(int x, int y, int width, int height) bool wxSpinCtrlGenericBase::Enable(bool enable) { - if ( !wxControl::Enable(enable) ) + // Notice that we never enable this control itself, it must stay disabled + // to avoid interfering with the siblings event handling (see e.g. #12045 + // for the kind of problems which arise otherwise). + if ( enable == m_isEnabled ) return false; + m_isEnabled = enable; + m_spinButton->Enable(enable); m_textCtrl->Enable(enable); -- 2.45.2