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