Added ogl to the module list
[wxWidgets.git] / utils / wxPython / src / events.i
CommitLineData
7bf85405
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: events.i
3// Purpose: SWIGgable Event classes for wxPython
4//
5// Author: Robin Dunn
6//
7// Created: 5/24/98
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13
03e9bead
RD
14%module events
15
16%{
7bf85405 17#include "helpers.h"
62bd0874 18#include <wx/spinbutt.h>
7bf85405
RD
19%}
20
21//----------------------------------------------------------------------
22
23%include typemaps.i
24%include my_typemaps.i
25
26// Import some definitions of other classes, etc.
27%import _defs.i
28%import misc.i
29
30//---------------------------------------------------------------------------
31
32class wxEvent {
33public:
34 wxObject* GetEventObject();
35 wxEventType GetEventType();
36 int GetId();
37 bool GetSkipped();
38 long GetTimestamp();
39 void SetEventObject(wxObject* object);
40 void SetEventType(wxEventType typ);
41 void SetId(int id);
42 void SetTimestamp(long timeStamp);
43 void Skip(bool skip = TRUE);
44};
45
46//---------------------------------------------------------------------------
47
48class wxSizeEvent : public wxEvent {
49public:
50 wxSize GetSize();
51};
52
53//---------------------------------------------------------------------------
54
55class wxCloseEvent : public wxEvent {
56public:
e980740a 57 void SetLoggingOff(bool loggingOff);
7bf85405
RD
58 bool GetLoggingOff();
59 void Veto(bool veto = TRUE);
e980740a 60 bool CanVeto();
7bf85405 61 bool GetVeto();
b8b8dda7 62 void SetCanVeto(bool canVeto);
7bf85405
RD
63};
64
65//---------------------------------------------------------------------------
66
67class wxCommandEvent : public wxEvent {
68public:
69 bool Checked();
70 long GetExtraLong();
71 int GetInt();
72 int GetSelection();
cf694132 73 wxString GetString();
7bf85405 74 bool IsSelection();
7bf85405
RD
75};
76
77
78//---------------------------------------------------------------------------
79
80class wxScrollEvent: public wxCommandEvent {
81public:
82 int GetOrientation();
83 int GetPosition();
84};
85
86//---------------------------------------------------------------------------
87
d426c97e
RD
88class wxScrollWinEvent: public wxEvent {
89public:
90 int GetOrientation();
91 int GetPosition();
92};
93
94//---------------------------------------------------------------------------
95
62bd0874
RD
96class wxSpinEvent : public wxScrollEvent {
97public:
98
99};
100
101//---------------------------------------------------------------------------
102
7bf85405
RD
103class wxMouseEvent: public wxEvent {
104public:
105 bool IsButton();
106 bool ButtonDown(int but = -1);
107 bool ButtonDClick(int but = -1);
108 bool ButtonUp(int but = -1);
109 bool Button(int but);
110 bool ButtonIsDown(int but);
111 bool ControlDown();
112 bool MetaDown();
113 bool AltDown();
114 bool ShiftDown();
115 bool LeftDown();
116 bool MiddleDown();
117 bool RightDown();
118 bool LeftUp();
119 bool MiddleUp();
120 bool RightUp();
121 bool LeftDClick();
122 bool MiddleDClick();
123 bool RightDClick();
124 bool LeftIsDown();
125 bool MiddleIsDown();
126 bool RightIsDown();
127 bool Dragging();
128 bool Moving();
129 bool Entering();
130 bool Leaving();
131 void Position(long *OUTPUT, long *OUTPUT);
132 wxPoint GetPosition();
133 wxPoint GetLogicalPosition(const wxDC& dc);
134 long GetX();
135 long GetY();
136};
137
138//---------------------------------------------------------------------------
139
140class wxKeyEvent: public wxEvent {
141public:
142 bool ControlDown();
143 bool MetaDown();
144 bool AltDown();
145 bool ShiftDown();
146 long KeyCode();
e980740a 147
7bf85405
RD
148};
149
150//---------------------------------------------------------------------------
151
152class wxMoveEvent: public wxEvent {
153public:
154 wxPoint GetPosition();
155};
156
157//---------------------------------------------------------------------------
158
159class wxPaintEvent: public wxEvent {
160public:
161
162};
163
164//---------------------------------------------------------------------------
165
166class wxEraseEvent: public wxEvent {
167public:
168 wxDC *GetDC();
169};
170
171//---------------------------------------------------------------------------
172
173class wxFocusEvent: public wxEvent {
174public:
175
176};
177
178//---------------------------------------------------------------------------
179
180class wxActivateEvent: public wxEvent{
181public:
182 bool GetActive();
183};
184
185//---------------------------------------------------------------------------
186
187class wxInitDialogEvent: public wxEvent {
188public:
189
190};
191
192//---------------------------------------------------------------------------
193
194class wxMenuEvent: public wxEvent {
195public:
196 int GetMenuId();
197};
198
199//---------------------------------------------------------------------------
200
201class wxShowEvent: public wxEvent {
202public:
203 void SetShow(bool show);
204 bool GetShow();
205};
206
207//---------------------------------------------------------------------------
208
209class wxIconizeEvent: public wxEvent {
210public:
211};
212
213//---------------------------------------------------------------------------
214
215class wxMaximizeEvent: public wxEvent {
216public:
217
218};
219
220//---------------------------------------------------------------------------
221
222class wxJoystickEvent: public wxEvent {
223public:
224 wxPoint GetPosition();
225 int GetZPosition();
226 int GetButtonState();
227 int GetButtonChange();
228 int GetJoystick();
229 void SetJoystick(int stick);
230 void SetButtonState(int state);
231 void SetButtonChange(int change);
232 void SetPosition(const wxPoint& pos);
233 void SetZPosition(int zPos);
234 bool IsButton();
235 bool IsMove();
236 bool IsZMove();
237 bool ButtonDown(int but = wxJOY_BUTTON_ANY);
238 bool ButtonUp(int but = wxJOY_BUTTON_ANY);
239 bool ButtonIsDown(int but = wxJOY_BUTTON_ANY);
240};
241
242//---------------------------------------------------------------------------
243
244class wxDropFilesEvent: public wxEvent {
245public:
246 wxPoint GetPosition();
247 int GetNumberOfFiles();
248
249 %addmethods {
250 PyObject* GetFiles() {
251 int count = self->GetNumberOfFiles();
252 wxString* files = self->GetFiles();
253 PyObject* list = PyList_New(count);
254
255 if (!list) {
256 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
257 return NULL;
258 }
259
260 for (int i=0; i<count; i++) {
261 PyList_SetItem(list, i, PyString_FromString((const char*)files[i]));
262 }
263 return list;
264 }
265 }
266};
267
268//---------------------------------------------------------------------------
269
270class wxIdleEvent: public wxEvent {
271public:
272 void RequestMore(bool needMore = TRUE);
273 bool MoreRequested();
274};
275
276//---------------------------------------------------------------------------
277
278class wxUpdateUIEvent: public wxEvent {
279public:
280 bool GetChecked();
281 bool GetEnabled();
282 wxString GetText();
283 bool GetSetText();
284 bool GetSetChecked();
285 bool GetSetEnabled();
286
287 void Check(bool check);
288 void Enable(bool enable);
289 void SetText(const wxString& text);
290};
291
292//---------------------------------------------------------------------------
293
294class wxSysColourChangedEvent: public wxEvent {
295public:
296
297};
298
299//---------------------------------------------------------------------------
300
cf694132
RD
301class wxPyEvent : public wxCommandEvent {
302public:
303 wxPyEvent(wxEventType commandType = wxEVT_NULL, PyObject* userData = Py_None);
304 ~wxPyEvent();
305
306 void SetUserData(PyObject* userData);
307 PyObject* GetUserData();
308};
309
7bf85405 310
cf694132
RD
311
312//---------------------------------------------------------------------------
bb0054cd
RD
313
314class wxNotifyEvent : public wxCommandEvent {
315public:
316 bool IsAllowed();
317 void Veto();
318};
319
320//---------------------------------------------------------------------------
321//---------------------------------------------------------------------------
7bf85405 322