]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/wupdlock.tex
unified wxFRAME_EX_CONTEXTHELP and wxDIALOG_EX_CONTEXTHELP in a single wxWS_EX_CONTEX...
[wxWidgets.git] / docs / latex / wx / wupdlock.tex
CommitLineData
9d3cb3f3
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: wupdlock.tex
3%% Purpose: wxWindowUpdateLocker documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 2006-03-06
7%% RCS-ID: $Id$
8%% Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxWindowUpdateLocker}}\label{wxwindowupdatelocker}
13
14This tiny class prevents redrawing of a \helpref{wxWindow}{wxwindow} during its
15lifetime by using \helpref{wxWindow::Freeze}{wxwindowfreeze} and
16\helpref{Thaw}{wxwindowthaw} methods. It is typically used for creating
17automatic objects to temporarily suppress window updates before a batch of
18operations is performed:
19{\small
20\begin{verbatim}
21 void MyFrame::Foo()
22 {
23 m_text = new wxTextCtrl(this, ...);
24
25 wxWindowUpdateLocker noUpdates(m_text);
26 m_text->AppendText();
27 ... many other operations with m_text...
28 m_text->WriteText();
29 }
30\end{verbatim}
31}
32
33Using this class is easier and safer than calling
34\helpref{Freeze}{wxwindowfreeze} and \helpref{Thaw}{wxwindowthaw} because you
35don't risk to forget calling the latter.
36
37\wxheading{Derived from}
38
39None.
40
41\wxheading{Include files}
42
43<wx/wupdlock.h>
44
45\latexignore{\rtfignore{\wxheading{Members}}}
46
47
48\membersection{wxWindowUpdateLocker::wxWindowUpdateLocker}\label{wxwindowupdatelockerctor}
49
50\func{}{wxWindowUpdateLocker}{\param{wxWindow *}{win}}
51
52Creates an object preventing the updates of the specified \arg{win}. The
53parameter must be non-\NULL and the window must exist for longer than
54wxWindowUpdateLocker object itself.
55
56
57\membersection{wxWindowUpdateLocker::\destruct{wxWindowUpdateLocker}}\label{wxwindowupdatelockerdtor}
58
59\func{}{\destruct{wxWindowUpdateLocker}}{\void}
60
61Destructor reenables updates for the window this object is associated with.
62