Make disabling the window before creating it actually work
Disabling a window before actually creating it ought to work, similarly to hiding a window before creating it which can be used to avoid showing the window on screen at all, even briefly. However it didn't under MSW where the window was disabled from wxWidgets point of view, but not at the MSW level. Fix this by accounting for the enabled state in MSWGetStyle(). Closes #16385.
This commit is contained in:
@@ -1518,6 +1518,9 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
|
||||
// wxTopLevelWindow) should remove WS_CHILD in their MSWGetStyle()
|
||||
WXDWORD style = WS_CHILD;
|
||||
|
||||
if ( !IsThisEnabled() )
|
||||
style |= WS_DISABLED;
|
||||
|
||||
// using this flag results in very significant reduction in flicker,
|
||||
// especially with controls inside the static boxes (as the interior of the
|
||||
// box is not redrawn twice), but sometimes results in redraw problems, so
|
||||
|
Reference in New Issue
Block a user