]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/events.i
Prep for wxPython 2.1b3 release
[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
62bd0874
RD
88class wxSpinEvent : public wxScrollEvent {
89public:
90
91};
92
93//---------------------------------------------------------------------------
94
7bf85405
RD
95class wxMouseEvent: public wxEvent {
96public:
97 bool IsButton();
98 bool ButtonDown(int but = -1);
99 bool ButtonDClick(int but = -1);
100 bool ButtonUp(int but = -1);
101 bool Button(int but);
102 bool ButtonIsDown(int but);
103 bool ControlDown();
104 bool MetaDown();
105 bool AltDown();
106 bool ShiftDown();
107 bool LeftDown();
108 bool MiddleDown();
109 bool RightDown();
110 bool LeftUp();
111 bool MiddleUp();
112 bool RightUp();
113 bool LeftDClick();
114 bool MiddleDClick();
115 bool RightDClick();
116 bool LeftIsDown();
117 bool MiddleIsDown();
118 bool RightIsDown();
119 bool Dragging();
120 bool Moving();
121 bool Entering();
122 bool Leaving();
123 void Position(long *OUTPUT, long *OUTPUT);
124 wxPoint GetPosition();
125 wxPoint GetLogicalPosition(const wxDC& dc);
126 long GetX();
127 long GetY();
128};
129
130//---------------------------------------------------------------------------
131
132class wxKeyEvent: public wxEvent {
133public:
134 bool ControlDown();
135 bool MetaDown();
136 bool AltDown();
137 bool ShiftDown();
138 long KeyCode();
e980740a 139
7bf85405
RD
140};
141
142//---------------------------------------------------------------------------
143
144class wxMoveEvent: public wxEvent {
145public:
146 wxPoint GetPosition();
147};
148
149//---------------------------------------------------------------------------
150
151class wxPaintEvent: public wxEvent {
152public:
153
154};
155
156//---------------------------------------------------------------------------
157
158class wxEraseEvent: public wxEvent {
159public:
160 wxDC *GetDC();
161};
162
163//---------------------------------------------------------------------------
164
165class wxFocusEvent: public wxEvent {
166public:
167
168};
169
170//---------------------------------------------------------------------------
171
172class wxActivateEvent: public wxEvent{
173public:
174 bool GetActive();
175};
176
177//---------------------------------------------------------------------------
178
179class wxInitDialogEvent: public wxEvent {
180public:
181
182};
183
184//---------------------------------------------------------------------------
185
186class wxMenuEvent: public wxEvent {
187public:
188 int GetMenuId();
189};
190
191//---------------------------------------------------------------------------
192
193class wxShowEvent: public wxEvent {
194public:
195 void SetShow(bool show);
196 bool GetShow();
197};
198
199//---------------------------------------------------------------------------
200
201class wxIconizeEvent: public wxEvent {
202public:
203};
204
205//---------------------------------------------------------------------------
206
207class wxMaximizeEvent: public wxEvent {
208public:
209
210};
211
212//---------------------------------------------------------------------------
213
214class wxJoystickEvent: public wxEvent {
215public:
216 wxPoint GetPosition();
217 int GetZPosition();
218 int GetButtonState();
219 int GetButtonChange();
220 int GetJoystick();
221 void SetJoystick(int stick);
222 void SetButtonState(int state);
223 void SetButtonChange(int change);
224 void SetPosition(const wxPoint& pos);
225 void SetZPosition(int zPos);
226 bool IsButton();
227 bool IsMove();
228 bool IsZMove();
229 bool ButtonDown(int but = wxJOY_BUTTON_ANY);
230 bool ButtonUp(int but = wxJOY_BUTTON_ANY);
231 bool ButtonIsDown(int but = wxJOY_BUTTON_ANY);
232};
233
234//---------------------------------------------------------------------------
235
236class wxDropFilesEvent: public wxEvent {
237public:
238 wxPoint GetPosition();
239 int GetNumberOfFiles();
240
241 %addmethods {
242 PyObject* GetFiles() {
243 int count = self->GetNumberOfFiles();
244 wxString* files = self->GetFiles();
245 PyObject* list = PyList_New(count);
246
247 if (!list) {
248 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
249 return NULL;
250 }
251
252 for (int i=0; i<count; i++) {
253 PyList_SetItem(list, i, PyString_FromString((const char*)files[i]));
254 }
255 return list;
256 }
257 }
258};
259
260//---------------------------------------------------------------------------
261
262class wxIdleEvent: public wxEvent {
263public:
264 void RequestMore(bool needMore = TRUE);
265 bool MoreRequested();
266};
267
268//---------------------------------------------------------------------------
269
270class wxUpdateUIEvent: public wxEvent {
271public:
272 bool GetChecked();
273 bool GetEnabled();
274 wxString GetText();
275 bool GetSetText();
276 bool GetSetChecked();
277 bool GetSetEnabled();
278
279 void Check(bool check);
280 void Enable(bool enable);
281 void SetText(const wxString& text);
282};
283
284//---------------------------------------------------------------------------
285
286class wxSysColourChangedEvent: public wxEvent {
287public:
288
289};
290
291//---------------------------------------------------------------------------
292
cf694132
RD
293class wxPyEvent : public wxCommandEvent {
294public:
295 wxPyEvent(wxEventType commandType = wxEVT_NULL, PyObject* userData = Py_None);
296 ~wxPyEvent();
297
298 void SetUserData(PyObject* userData);
299 PyObject* GetUserData();
300};
301
7bf85405 302
cf694132
RD
303
304//---------------------------------------------------------------------------
bb0054cd
RD
305
306class wxNotifyEvent : public wxCommandEvent {
307public:
308 bool IsAllowed();
309 void Veto();
310};
311
312//---------------------------------------------------------------------------
313//---------------------------------------------------------------------------
7bf85405 314