]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/wupdlock.h
generate a size event from ShowWithEffect() for consistency with Show()
[wxWidgets.git] / interface / wx / wupdlock.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: wupdlock.h
e54c96f1 3// Purpose: interface of wxWindowUpdateLocker
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxWindowUpdateLocker
7c913512 11
23324ae1 12 This tiny class prevents redrawing of a wxWindow during its
7c913512 13 lifetime by using wxWindow::Freeze and
23324ae1
FM
14 wxWindow::Thaw methods. It is typically used for creating
15 automatic objects to temporarily suppress window updates before a batch of
16 operations is performed:
7c913512 17
23324ae1
FM
18 @code
19 void MyFrame::Foo()
20 {
21 m_text = new wxTextCtrl(this, ...);
7c913512 22
23324ae1
FM
23 wxWindowUpdateLocker noUpdates(m_text);
24 m_text-AppendText();
25 ... many other operations with m_text...
26 m_text-WriteText();
27 }
28 @endcode
7c913512
FM
29
30 Using this class is easier and safer than calling
23324ae1
FM
31 wxWindow::Freeze and wxWindow::Thaw because you
32 don't risk to forget calling the latter.
7c913512 33
23324ae1
FM
34 @library{wxbase}
35 @category{FIXME}
36*/
7c913512 37class wxWindowUpdateLocker
23324ae1
FM
38{
39public:
40 /**
41 Creates an object preventing the updates of the specified @e win. The
42 parameter must be non-@NULL and the window must exist for longer than
43 wxWindowUpdateLocker object itself.
44 */
4cc4bfaf 45 wxWindowUpdateLocker(wxWindow* win);
23324ae1
FM
46
47 /**
48 Destructor reenables updates for the window this object is associated with.
49 */
50 ~wxWindowUpdateLocker();
51};
e54c96f1 52