Don't disable wxStaticBox children at wx level when disabling it

Calling Enable() on all children from wxStaticBox::Enable() was wrong,
the actual status of the child, returned by wxWindow::IsThisEnabled(),
is not supposed to change just because its parent was disabled.

Call NotifyWindowOnEnableChange() to avoid this, while still disabling
the children visually.
This commit is contained in:
Vadim Zeitlin
2018-01-13 22:50:26 +01:00
parent 967b4cdc1f
commit 3c29b3d0ce
2 changed files with 10 additions and 6 deletions

View File

@@ -105,11 +105,15 @@ bool wxStaticBoxBase::Enable(bool enable)
++i )
{
if ( *i != m_labelWin )
(*i)->Enable(enable);
(*i)->NotifyWindowOnEnableChange(enable);
}
m_isEnabled = enable;
// Notice that we don't call DoEnable() on the box itself: under MSW it
// doesn't actually change anything and under GTK this would disable
// the label window.
return true;
}
#endif // wxHAS_WINDOW_LABEL_IN_STATIC_BOX