1/////////////////////////////////////////////////////////////////////////////// 2// Name: wx/wupdlock.h 3// Purpose: wxWindowUpdateLocker prevents window redrawing 4// Author: Vadim Zeitlin 5// Created: 2006-03-06 6// RCS-ID: $Id: wupdlock.h 37842 2006-03-07 01:50:21Z VZ $ 7// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org> 8// Licence: wxWindows licence 9/////////////////////////////////////////////////////////////////////////////// 10 11#ifndef _WX_WUPDLOCK_H_ 12#define _WX_WUPDLOCK_H_ 13 14#include "wx/window.h" 15 16// ---------------------------------------------------------------------------- 17// wxWindowUpdateLocker prevents updates to the window during its lifetime 18// ---------------------------------------------------------------------------- 19 20class wxWindowUpdateLocker 21{ 22public: 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(); } 26 27 // dtor thaws the window to permit updates again 28 ~wxWindowUpdateLocker() { m_win->Thaw(); } 29 30private: 31 wxWindow *m_win; 32 33 DECLARE_NO_COPY_CLASS(wxWindowUpdateLocker) 34}; 35 36#endif // _WX_WUPDLOCK_H_ 37 38