wxWidgets/docs/latex/wx/evtblocker.tex
2007-02-04 00:12:50 +00:00

70 lines
1.9 KiB
TeX

\section{\class{wxEventBlocker}}\label{wxeventblocker}
This class is a special event handler which allows to discard
any event (or a set of event types) directed to a specific window.
Example:
\begin{verbatim}
{
// block all events directed to this window while
// we do the 1000 FuncWhichSendsEvents() calls
wxEventBlocker blocker(this);
for ( int i = 0; i < 1000; i++ )
FuncWhichSendsEvents(i);
} // ~wxEventBlocker called, old event handler is restored
// the event generated by this call will be processed
FuncWhichSendsEvents(0)
\end{verbatim}
\wxheading{Derived from}
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/event.h>
\wxheading{See also}
\overview{Event handling overview}{eventhandlingoverview},
\helpref{wxEvtHandler}{wxevthandler}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxEventBlocker::wxEventBlocker}\label{wxeventblockerctor}
\func{}{wxEventBlocker}{\param{wxWindow* }{win}, \param{wxEventType}{type = wxEVT\_ANY}}
Constructs the blocker for the given window and for the given event type.
If \arg{type} is \texttt{wxEVT\_ANY}, then all events for that window are
blocked. You can call \helpref{Block}{wxeventblockerblock} after creation to
add other event types to the list of events to block.
Note that the \arg{win} window \textbf{must} remain alive until the
wxEventBlocker object destruction.
\membersection{wxEventBlocker::\destruct{wxEventBlocker}}\label{wxeventblockerdtor}
\func{}{\destruct{wxEventBlocker}}{\void}
Destructor. The blocker will remove itself from the chain of event handlers for
the window provided in the constructor, thus restoring normal processing of
events.
\membersection{wxEventBlocker::Block}\label{wxeventblockerblock}
\func{void}{Block}{\param{wxEventType }{eventType}}
Adds to the list of event types which should be blocked the given \arg{eventType}.