]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_power.i
Don't steal VK_RETURN for wxEVT_COMMAND_LIST_ITEM_ACTIVATED if any of
[wxWidgets.git] / wxPython / src / _power.i
CommitLineData
d0e2ede0
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _power.i
3// Purpose: SWIG interface for wx poser events and functions
4//
5// Author: Robin Dunn
6//
7// Created: 28-May-2006
8// RCS-ID: $Id$
9// Copyright: (c) 2006 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15//---------------------------------------------------------------------------
16%newgroup
17
0fade4f1 18
d0e2ede0
RD
19%{
20#ifndef wxHAS_POWER_EVENTS
21// Dummy class and other definitions for platforms that don't have them
22
0fade4f1
RD
23// See wxPython_int.h for wxPowerEvent
24
d0e2ede0
RD
25enum {
26 wxEVT_POWER_SUSPENDING,
27 wxEVT_POWER_SUSPENDED,
28 wxEVT_POWER_SUSPEND_CANCEL,
29 wxEVT_POWER_RESUME,
30};
31
32wxPowerType wxGetPowerType() { return wxPOWER_UNKNOWN; }
33wxBatteryState wxGetBatteryState() { return wxBATTERY_UNKNOWN_STATE; }
34
35#endif
36%}
37
38
39
40enum wxPowerType
41{
42 wxPOWER_SOCKET,
43 wxPOWER_BATTERY,
44 wxPOWER_UNKNOWN
45};
46
47enum wxBatteryState
48{
49 wxBATTERY_NORMAL_STATE, // system is fully usable
50 wxBATTERY_LOW_STATE, // start to worry
51 wxBATTERY_CRITICAL_STATE, // save quickly
52 wxBATTERY_SHUTDOWN_STATE, // too late
53 wxBATTERY_UNKNOWN_STATE
54};
55
56
57DocStr(wxPowerEvent,
58"wx.PowerEvent is generated when the system online status changes.
59Currently this is only implemented for Windows.",
60"");
61class wxPowerEvent : public wxEvent
62{
63public:
64 wxPowerEvent(wxEventType evtType);
65
66 // Veto the operation (only makes sense with EVT_POWER_SUSPENDING)
67 void Veto();
68 bool IsVetoed() const;
69};
70
71
72%constant wxEventType wxEVT_POWER_SUSPENDING;
73%constant wxEventType wxEVT_POWER_SUSPENDED;
74%constant wxEventType wxEVT_POWER_SUSPEND_CANCEL;
75%constant wxEventType wxEVT_POWER_RESUME;
76
77%pythoncode {
78EVT_POWER_SUSPENDING = wx.PyEventBinder( wxEVT_POWER_SUSPENDING , 1 )
79EVT_POWER_SUSPENDED = wx.PyEventBinder( wxEVT_POWER_SUSPENDED , 1 )
80EVT_POWER_SUSPEND_CANCEL = wx.PyEventBinder( wxEVT_POWER_SUSPEND_CANCEL , 1 )
81EVT_POWER_RESUME = wx.PyEventBinder( wxEVT_POWER_RESUME , 1 )
82}
83
84
85DocDeclStr(
86 wxPowerType , wxGetPowerType(),
87 "return the current system power state: online or offline", "");
88
89
90DocDeclStr(
91 wxBatteryState , wxGetBatteryState(),
92 "return approximate battery state", "");
93
94
95//---------------------------------------------------------------------------