]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/powerevt.tex
wxAnimationCtrl cleanup
[wxWidgets.git] / docs / latex / wx / powerevt.tex
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
13 The power events are generated when the system power state changes, e.g. the
14 system is suspended, hibernated, plugged into or unplugged from the wall socket
15 and so on.
16
17 Notice that currently only suspend and resume events are generated and only
18 under MS Windows platform. To avoid the need to change the code using this
19 event later when these events are implemented on the other platforms please use
20 the test \texttt{#ifdef wxHAS\_POWER\_EVENTS} instead of directly testing for
21 the platform in your code: this symbol will be defined for all platforms
22 supporting the power events.
23
24 \wxheading{Event table macros}
25
26 To process power events, use these macros to handle them in
27 member 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
32 event can be vetoed to prevent suspend from taking place.}
33 \twocolitem{\textbf{EVT\_POWER\_SUSPENDED(func)}}{System is about to suspend: normally the
34 application should quickly (i.e. without user intervention) close all the open
35 files and network connections here, possibly remembering them to reopen them
36 later when the system is resumed.}
37 \twocolitem{\textbf{EVT\_POWER\_SUSPEND\_CANCEL(func)}}{System suspension was cancelled
38 because some application vetoed it.}
39 \twocolitem{\textbf{EVT\_POWER\_RESUME(func)}}{System resumed from suspend:
40 normally the application should restore the state in which it had been before
41 the 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{See also}
54
55 \helpref{wxGetPowerType}{wxgetpowertype}, \helpref{wxGetBatteryState}{wxgetbatterystate}
56
57
58 \latexignore{\rtfignore{\wxheading{Members}}}
59
60 \membersection{wxPowerEvent::Veto}\label{wxpowereventveto}
61
62 \func{void}{Veto}{\void}
63
64 Call this to prevent suspend from taking place in
65 \texttt{wxEVT\_POWER\_SUSPENDING} handler (it is ignored for all the others).
66
67