]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/gupdlock.tex
many wxItemContainer-related changes:
[wxWidgets.git] / docs / latex / wx / gupdlock.tex
CommitLineData
b62f94ff
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: gupdlock.tex
3%% Purpose: wxGridUpdateLocker documentation
4%% Author: Evgeniy Tarassov
5%% Created: 2007-03-15
6%% RCS-ID: $Id$
7%% Copyright: (c) 2007 TT-Solutions SARL
8%% License: wxWindows license
9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11\section{\class{wxGridUpdateLocker}}\label{wxgridupdatelocker}
12
13This small class can be used to prevent \helpref{wxGrid}{wxgrid} from redrawing
14during its lifetime by calling \helpref{wxGrid::BeginBatch}{wxgridbeginbatch}
15in its constructor and \helpref{wxGrid::EndBatch}{wxgridendbatch} in its
16destructor. It is typically used in a function performing several operations
17with a grid which would otherwise result in flicker. For example:
18
19{\small
20\begin{verbatim}
21 void MyFrame::Foo()
22 {
23 m_grid = new wxGrid(this, ...);
24
25 wxGridUpdateLocker noUpdates(m_grid);
26 m_grid->AppendColumn();
27 ... many other operations with m_grid...
28 m_grid->AppendRow();
29
30 // destructor called, grid refreshed
31 }
32\end{verbatim}
33}
34
35Using this class is easier and safer than calling
36\helpref{BeginBatch}{wxgridbeginbatch} and \helpref{EndBatch}{wxgridendbatch}
37because you don't risk not to call the latter (due to an exception for example).
38
39\wxheading{Derived from}
40
41None.
42
43\wxheading{Include files}
44
45<wx/grid.h>
46
47
48\latexignore{\rtfignore{\wxheading{Members}}}
49
50
51\membersection{wxGridUpdateLocker::wxGridUpdateLocker}\label{wxgridupdatelockerctor}
52
53\func{}{wxGridUpdateLocker}{\param{wxGrid *}{grid = \NULL}}
54
55Creates an object preventing the updates of the specified \arg{grid}. The
56parameter could be \NULL in which case nothing is done. If \arg{grid} is
57non-\NULL then the grid must exist for longer than wxGridUpdateLocker object
58itself.
59
60The default constructor could be followed by a call to
61\helpref{wxGridUpdateLocker::Create}{wxgridupdatelockercreate} to set the
62grid object later.
63
64
65
66\membersection{wxGridUpdateLocker::\destruct{wxGridUpdateLocker}}\label{wxgridupdatelockerdtor}
67
68\func{}{\destruct{wxGridUpdateLocker}}{\void}
69
70Destructor reenables updates for the grid this object is associated with.
71
72
73
74\membersection{wxGridUpdateLocker::Create}\label{wxgridupdatelockercreate}
75
76\func{void}{Create}{\param{wxGrid* }{grid}}
77
78This method can be called if the object had been constructed using the default
79constructor. It must not be called more than once.
80
81