Don't disable wxStaticBox window label when disabling the box
This behaviour might be not completely intuitive, but it makes it much simpler to handle the box state using a checkbox as the label control (which is by far the most common case of using box window labels). Notice that while we could add a separate EnableWithoutLabel() method to wxStaticBox to make it possible to set the state of the box directly relatively easily, it wouldn't help with using wxEVT_UPDATE_UI for managing the box state indirectly as it relies on calling Enable() only. And this solution does allow wxEVT_UPDATE_UI handlers for the box itself to work (provided the handler takes care to check for the event object being the box itself, as otherwise it would still disable the child checkbox when its wxEVT_UPDATE_UI bubbles up to the box).
This commit is contained in:
@@ -31,6 +31,7 @@ public:
|
||||
|
||||
// overridden base class virtuals
|
||||
virtual bool HasTransparentBackground() wxOVERRIDE { return true; }
|
||||
virtual bool Enable(bool enable = true) wxOVERRIDE;
|
||||
|
||||
// implementation only: this is used by wxStaticBoxSizer to account for the
|
||||
// need for extra space taken by the static box
|
||||
|
Reference in New Issue
Block a user