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