]> git.saurik.com Git - wxWidgets.git/commitdiff
Never enable wxSpinCtrlGenericBase window itself at underlying toolkit level.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 13 May 2010 15:31:35 +0000 (15:31 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 13 May 2010 15:31:35 +0000 (15:31 +0000)
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

index d0304875436f5884e4edb4f3ca3ca98d1a0dff02..e11a6e0a46ca52fe14d0a268f6bfc9acb8841711 100644 (file)
@@ -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);