From: Vadim Zeitlin Date: Sun, 29 Jul 2001 21:22:12 +0000 (+0000) Subject: added Freeze/Thaw implementation for Windows X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a0e449ff41f55b4d82f108f72638f852c962da2d added Freeze/Thaw implementation for Windows git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 6bdc49db2a..25abce27c7 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -90,6 +90,8 @@ public: const wxRect *rect = (const wxRect *) NULL ); virtual void Update(); virtual void Clear(); + virtual void Freeze(); + virtual void Thaw(); virtual bool SetCursor( const wxCursor &cursor ); virtual bool SetFont( const wxFont &font ); diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 49f54984e1..7bbf3ce5cd 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1194,6 +1194,21 @@ void wxWindowMSW::Clear() dc.Clear(); } +static inline void SendSetRedraw(HWND hwnd, bool on) +{ + ::SendMessage(hwnd, WM_SETREDRAW, (WPARAM)on, 0); +} + +void wxWindowMSW::Freeze() +{ + SendSetRedraw(FALSE); +} + +void wxWindowMSW::Thaw() +{ + SendSetRedraw(TRUE); +} + void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect) { HWND hWnd = GetHwnd();