]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/events.i
Fixed wxImage GetData and SetData to properly use String objects for
[wxWidgets.git] / utils / wxPython / src / events.i
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
14 %module events
15
16 %{
17 #include "helpers.h"
18 #include <wx/spinbutt.h>
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
32 class wxEvent {
33 public:
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
48 class wxSizeEvent : public wxEvent {
49 public:
50 wxSize GetSize();
51 };
52
53 //---------------------------------------------------------------------------
54
55 class wxCloseEvent : public wxEvent {
56 public:
57 void SetLoggingOff(bool loggingOff);
58 bool GetLoggingOff();
59 void Veto(bool veto = TRUE);
60 bool CanVeto();
61 bool GetVeto();
62 void SetCanVeto(bool canVeto);
63 };
64
65 //---------------------------------------------------------------------------
66
67 class wxCommandEvent : public wxEvent {
68 public:
69 bool Checked();
70 long GetExtraLong();
71 int GetInt();
72 int GetSelection();
73 wxString GetString();
74 bool IsSelection();
75 };
76
77
78 //---------------------------------------------------------------------------
79
80 class wxScrollEvent: public wxCommandEvent {
81 public:
82 int GetOrientation();
83 int GetPosition();
84 };
85
86 //---------------------------------------------------------------------------
87
88 class wxSpinEvent : public wxScrollEvent {
89 public:
90
91 };
92
93 //---------------------------------------------------------------------------
94
95 class wxMouseEvent: public wxEvent {
96 public:
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
132 class wxKeyEvent: public wxEvent {
133 public:
134 bool ControlDown();
135 bool MetaDown();
136 bool AltDown();
137 bool ShiftDown();
138 long KeyCode();
139
140 };
141
142 //---------------------------------------------------------------------------
143
144 class wxMoveEvent: public wxEvent {
145 public:
146 wxPoint GetPosition();
147 };
148
149 //---------------------------------------------------------------------------
150
151 class wxPaintEvent: public wxEvent {
152 public:
153
154 };
155
156 //---------------------------------------------------------------------------
157
158 class wxEraseEvent: public wxEvent {
159 public:
160 wxDC *GetDC();
161 };
162
163 //---------------------------------------------------------------------------
164
165 class wxFocusEvent: public wxEvent {
166 public:
167
168 };
169
170 //---------------------------------------------------------------------------
171
172 class wxActivateEvent: public wxEvent{
173 public:
174 bool GetActive();
175 };
176
177 //---------------------------------------------------------------------------
178
179 class wxInitDialogEvent: public wxEvent {
180 public:
181
182 };
183
184 //---------------------------------------------------------------------------
185
186 class wxMenuEvent: public wxEvent {
187 public:
188 int GetMenuId();
189 };
190
191 //---------------------------------------------------------------------------
192
193 class wxShowEvent: public wxEvent {
194 public:
195 void SetShow(bool show);
196 bool GetShow();
197 };
198
199 //---------------------------------------------------------------------------
200
201 class wxIconizeEvent: public wxEvent {
202 public:
203 };
204
205 //---------------------------------------------------------------------------
206
207 class wxMaximizeEvent: public wxEvent {
208 public:
209
210 };
211
212 //---------------------------------------------------------------------------
213
214 class wxJoystickEvent: public wxEvent {
215 public:
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
236 class wxDropFilesEvent: public wxEvent {
237 public:
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
262 class wxIdleEvent: public wxEvent {
263 public:
264 void RequestMore(bool needMore = TRUE);
265 bool MoreRequested();
266 };
267
268 //---------------------------------------------------------------------------
269
270 class wxUpdateUIEvent: public wxEvent {
271 public:
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
286 class wxSysColourChangedEvent: public wxEvent {
287 public:
288
289 };
290
291 //---------------------------------------------------------------------------
292
293 class wxPyEvent : public wxCommandEvent {
294 public:
295 wxPyEvent(wxEventType commandType = wxEVT_NULL, PyObject* userData = Py_None);
296 ~wxPyEvent();
297
298 void SetUserData(PyObject* userData);
299 PyObject* GetUserData();
300 };
301
302
303
304 //---------------------------------------------------------------------------
305
306 class wxNotifyEvent : public wxCommandEvent {
307 public:
308 bool IsAllowed();
309 void Veto();
310 };
311
312 //---------------------------------------------------------------------------
313 //---------------------------------------------------------------------------
314