]> git.saurik.com Git - wxWidgets.git/blame - include/wx/wupdlock.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / wupdlock.h
CommitLineData
9d3cb3f3
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/wupdlock.h
3// Purpose: wxWindowUpdateLocker prevents window redrawing
4// Author: Vadim Zeitlin
5// Created: 2006-03-06
9d3cb3f3
VZ
6// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
7// Licence: wxWindows licence
8///////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_WUPDLOCK_H_
11#define _WX_WUPDLOCK_H_
12
13#include "wx/window.h"
14
15// ----------------------------------------------------------------------------
16// wxWindowUpdateLocker prevents updates to the window during its lifetime
17// ----------------------------------------------------------------------------
18
19class wxWindowUpdateLocker
20{
21public:
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(); }
25
26 // dtor thaws the window to permit updates again
27 ~wxWindowUpdateLocker() { m_win->Thaw(); }
28
29private:
30 wxWindow *m_win;
31
c0c133e1 32 wxDECLARE_NO_COPY_CLASS(wxWindowUpdateLocker);
9d3cb3f3
VZ
33};
34
35#endif // _WX_WUPDLOCK_H_
36