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
This commit is contained in:
parent
ca288f2afe
commit
3f77c76cc9
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user