From 7f6cf37004ce42bba674e577b8a39b853aa08254 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 12 Mar 2012 11:42:49 +0000 Subject: [PATCH 1/1] Removed redundant DoEnable git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/toplevel.h | 2 -- src/msw/toplevel.cpp | 26 -------------------------- 2 files changed, 28 deletions(-) diff --git a/include/wx/msw/toplevel.h b/include/wx/msw/toplevel.h index fdc62eba5e..04d5b08947 100644 --- a/include/wx/msw/toplevel.h +++ b/include/wx/msw/toplevel.h @@ -152,8 +152,6 @@ protected: virtual void DoFreeze(); virtual void DoThaw(); - virtual void DoEnable(bool enable); - // helper of SetIcons(): calls gets the icon with the size specified by the // given system metrics (SM_C{X|Y}[SM]ICON) from the bundle and sets it // using WM_SETICON with the specified wParam (ICOM_SMALL or ICON_BIG); diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 85c221a45b..315d02dea9 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -1335,32 +1335,6 @@ bool wxTopLevelWindowMSW::CanSetTransparent() return (os_type == wxOS_WINDOWS_NT && ver_major >= 5); } -void wxTopLevelWindowMSW::DoEnable(bool enable) -{ - wxTopLevelWindowBase::DoEnable(enable); - - // Enabling or disabling a window may change its appearance. Unfortunately, - // in at least some situation, toplevel windows don't repaint themselves, - // so we have to issue explicit refresh to avoid rendering artifacts. - // - // TODO: find out just what exactly is wrong here - //Refresh(); - - // JS: From observing other application behaviour, such as VS 2010, controls such - // as text fields and comboboxes do not indicate a disabled state when the parent - // is disabled due to a modal dialog being shown. Therefore I have changed these - // controls' behaviour to only indicate a disabled state when IsThisEnabled returns false, - // i.e. the application has specifically disabled each control. Since the colour - // no longer changes when the top-level window is disabled, this means we can avoid - // doing a refresh that causes a distracting flicker in some controls. - // Windows should probably be sending a paint event to each child control just in - // case the state change requires a refresh, but this would cause flicker so perhaps - // it's as well that it doesn't. - // The result of this change is to remove the flicker and also remove the distraction - // of individual controls greying-out due to a dialog being shown, which I think was - // the wrong behaviour. -} - void wxTopLevelWindowMSW::DoFreeze() { // do nothing: freezing toplevel window causes paint and mouse events -- 2.45.2