]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/powerevt.tex
no changes, just come cleanup and more comments
[wxWidgets.git] / docs / latex / wx / powerevt.tex
... / ...
CommitLineData
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: powerevt.tex
3%% Purpose: wxPowerEvent documentation
4%% Author: Vadim Zeitlin
5%% Created: 2006-05-27
6%% RCS-ID: $Id$
7%% Copyright: (C) 2006 Vadim Zeitlin <vadim@wxwindows.org>
8%% License: wxWindows license
9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11\section{\class{wxPowerEvent}}\label{wxpowerevent}
12
13The power events are generated when the system power state changes, e.g. the
14system is suspended, hibernated, plugged into or unplugged from the wall socket
15and so on.
16
17Notice that currently only suspend and resume events are generated and only
18under MS Windows platform. To avoid the need to change the code using this
19event later when these events are implemented on the other platforms please use
20the test \texttt{#ifdef wxHAS\_POWER\_EVENTS} instead of directly testing for
21the platform in your code: this symbol will be defined for all platforms
22supporting the power events.
23
24\wxheading{Event table macros}
25
26To process power events, use these macros to handle them in
27member functions that take a wxPowerEvent argument.
28
29\twocolwidtha{9cm}
30\begin{twocollist}\itemsep=0pt
31\twocolitem{\textbf{EVT\_POWER\_SUSPENDING(func)}}{System is about to be suspended, this
32event can be vetoed to prevent suspend from taking place.}
33\twocolitem{\textbf{EVT\_POWER\_SUSPENDED(func)}}{System is about to suspend: normally the
34application should quickly (i.e. without user intervention) close all the open
35files and network connections here, possibly remembering them to reopen them
36later when the system is resumed.}
37\twocolitem{\textbf{EVT\_POWER\_SUSPEND\_CANCEL(func)}}{System suspension was cancelled
38because some application vetoed it.}
39\twocolitem{\textbf{EVT\_POWER\_RESUME(func)}}{System resumed from suspend:
40normally the application should restore the state in which it had been before
41the suspension.}
42\end{twocollist}%
43
44\wxheading{Derived from}
45
46\helpref{wxEvent}{wxevent}\\
47\helpref{wxObject}{wxobject}
48
49\wxheading{Include files}
50
51<wx/power.h>
52
53\wxheading{Library}
54
55\helpref{wxBase}{librarieslist}
56
57\wxheading{See also}
58
59\helpref{wxGetPowerType}{wxgetpowertype}, \helpref{wxGetBatteryState}{wxgetbatterystate}
60
61
62\latexignore{\rtfignore{\wxheading{Members}}}
63
64\membersection{wxPowerEvent::Veto}\label{wxpowereventveto}
65
66\func{void}{Veto}{\void}
67
68Call this to prevent suspend from taking place in
69\texttt{wxEVT\_POWER\_SUSPENDING} handler (it is ignored for all the others).
70
71