]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/wupdlock.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxWindowUpdateLocker prevents window redrawing
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_WUPDLOCK_H_
12 #define _WX_WUPDLOCK_H_
14 #include "wx/window.h"
16 // ----------------------------------------------------------------------------
17 // wxWindowUpdateLocker prevents updates to the window during its lifetime
18 // ----------------------------------------------------------------------------
20 class wxWindowUpdateLocker
23 // create an object preventing updates of the given window (which must have
24 // a lifetime at least as great as ours)
25 wxWindowUpdateLocker(wxWindow
*win
) : m_win(win
) { win
->Freeze(); }
27 // dtor thaws the window to permit updates again
28 ~wxWindowUpdateLocker() { m_win
->Thaw(); }
33 DECLARE_NO_COPY_CLASS(wxWindowUpdateLocker
)
36 #endif // _WX_WUPDLOCK_H_