X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/936bb82ec51c308dbf630b30d7dd18c794f5b0d6..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 7e0c56855d..53d7313f36 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -716,6 +716,16 @@ bool wxWindowMSW::Show(bool show) ::ShowWindow(hWnd, show ? SW_SHOW : SW_HIDE); } + if ( IsFrozen() ) + { + // DoFreeze/DoThaw don't do anything if the window is not shown, so + // we have to call them from here now + if ( show ) + DoFreeze(); + else + DoThaw(); + } + return true; } @@ -725,6 +735,9 @@ wxWindowMSW::MSWShowWithEffect(bool show, unsigned timeout, wxDirection dir) { + if ( !wxWindowBase::Show(show) ) + return false; + typedef BOOL (WINAPI *AnimateWindow_t)(HWND, DWORD, DWORD); static AnimateWindow_t s_pfnAnimateWindow = NULL; @@ -1612,20 +1625,22 @@ static inline void SendSetRedraw(HWND hwnd, bool on) void wxWindowMSW::DoFreeze() { - if ( IsShown() ) - SendSetRedraw(GetHwnd(), false); + if ( !IsShown() ) + return; // no point in freezing hidden window + + SendSetRedraw(GetHwnd(), false); } void wxWindowMSW::DoThaw() { - if ( IsShown() ) - { - SendSetRedraw(GetHwnd(), true); + if ( !IsShown() ) + return; // hidden windows aren't frozen by DoFreeze - // we need to refresh everything or otherwise the invalidated area - // is not going to be repainted - Refresh(); - } + SendSetRedraw(GetHwnd(), true); + + // we need to refresh everything or otherwise the invalidated area + // is not going to be repainted + Refresh(); } void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect) @@ -3421,7 +3436,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l rect = (RECT *)lParam; } - wxUxThemeHandle hTheme((wxWindow *)this, L"EDIT"); + wxUxThemeHandle hTheme((const wxWindow *)this, L"EDIT"); RECT rcClient = { 0, 0, 0, 0 }; wxClientDC dc((wxWindow *)this); wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl(); @@ -3453,7 +3468,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l rc.result = MSWDefWindowProc(message, wParam, lParam); processed = true; - wxUxThemeHandle hTheme((wxWindow *)this, L"EDIT"); + wxUxThemeHandle hTheme((const wxWindow *)this, L"EDIT"); wxWindowDC dc((wxWindow *)this); wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl(); @@ -4205,9 +4220,6 @@ bool wxWindowMSW::HandlePower(WXWPARAM WXUNUSED_IN_WINCE(wParam), break; case PBT_APMRESUMESUSPEND: -#ifdef PBT_APMRESUMEAUTOMATIC - case PBT_APMRESUMEAUTOMATIC: -#endif evtType = wxEVT_POWER_RESUME; break; @@ -4224,6 +4236,9 @@ bool wxWindowMSW::HandlePower(WXWPARAM WXUNUSED_IN_WINCE(wParam), case PBT_APMPOWERSTATUSCHANGE: case PBT_APMOEMEVENT: case PBT_APMRESUMECRITICAL: +#ifdef PBT_APMRESUMEAUTOMATIC + case PBT_APMRESUMEAUTOMATIC: +#endif evtType = wxEVT_NULL; break; }