]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/events.i
Follow up for changes in wxWindows to various event classes
[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 char* GetString();
74 bool IsSelection();
75
76 };
77
78
79 //---------------------------------------------------------------------------
80
81 class wxScrollEvent: public wxCommandEvent {
82 public:
83 int GetOrientation();
84 int GetPosition();
85 };
86
87 //---------------------------------------------------------------------------
88
89 class wxSpinEvent : public wxScrollEvent {
90 public:
91
92 };
93
94 //---------------------------------------------------------------------------
95
96 class wxMouseEvent: public wxEvent {
97 public:
98 bool IsButton();
99 bool ButtonDown(int but = -1);
100 bool ButtonDClick(int but = -1);
101 bool ButtonUp(int but = -1);
102 bool Button(int but);
103 bool ButtonIsDown(int but);
104 bool ControlDown();
105 bool MetaDown();
106 bool AltDown();
107 bool ShiftDown();
108 bool LeftDown();
109 bool MiddleDown();
110 bool RightDown();
111 bool LeftUp();
112 bool MiddleUp();
113 bool RightUp();
114 bool LeftDClick();
115 bool MiddleDClick();
116 bool RightDClick();
117 bool LeftIsDown();
118 bool MiddleIsDown();
119 bool RightIsDown();
120 bool Dragging();
121 bool Moving();
122 bool Entering();
123 bool Leaving();
124 void Position(long *OUTPUT, long *OUTPUT);
125 wxPoint GetPosition();
126 wxPoint GetLogicalPosition(const wxDC& dc);
127 long GetX();
128 long GetY();
129 };
130
131 //---------------------------------------------------------------------------
132
133 class wxKeyEvent: public wxEvent {
134 public:
135 bool ControlDown();
136 bool MetaDown();
137 bool AltDown();
138 bool ShiftDown();
139 long KeyCode();
140
141 // void Position(float *OUTPUT, float *OUTPUT);
142 // float GetX();
143 // float GetY();
144 };
145
146 //---------------------------------------------------------------------------
147
148 class wxMoveEvent: public wxEvent {
149 public:
150 wxPoint GetPosition();
151 };
152
153 //---------------------------------------------------------------------------
154
155 class wxPaintEvent: public wxEvent {
156 public:
157
158 };
159
160 //---------------------------------------------------------------------------
161
162 class wxEraseEvent: public wxEvent {
163 public:
164 wxDC *GetDC();
165 };
166
167 //---------------------------------------------------------------------------
168
169 class wxFocusEvent: public wxEvent {
170 public:
171
172 };
173
174 //---------------------------------------------------------------------------
175
176 class wxActivateEvent: public wxEvent{
177 public:
178 bool GetActive();
179 };
180
181 //---------------------------------------------------------------------------
182
183 class wxInitDialogEvent: public wxEvent {
184 public:
185
186 };
187
188 //---------------------------------------------------------------------------
189
190 class wxMenuEvent: public wxEvent {
191 public:
192 int GetMenuId();
193 };
194
195 //---------------------------------------------------------------------------
196
197 class wxShowEvent: public wxEvent {
198 public:
199 void SetShow(bool show);
200 bool GetShow();
201 };
202
203 //---------------------------------------------------------------------------
204
205 class wxIconizeEvent: public wxEvent {
206 public:
207 };
208
209 //---------------------------------------------------------------------------
210
211 class wxMaximizeEvent: public wxEvent {
212 public:
213
214 };
215
216 //---------------------------------------------------------------------------
217
218 class wxJoystickEvent: public wxEvent {
219 public:
220 wxPoint GetPosition();
221 int GetZPosition();
222 int GetButtonState();
223 int GetButtonChange();
224 int GetJoystick();
225 void SetJoystick(int stick);
226 void SetButtonState(int state);
227 void SetButtonChange(int change);
228 void SetPosition(const wxPoint& pos);
229 void SetZPosition(int zPos);
230 bool IsButton();
231 bool IsMove();
232 bool IsZMove();
233 bool ButtonDown(int but = wxJOY_BUTTON_ANY);
234 bool ButtonUp(int but = wxJOY_BUTTON_ANY);
235 bool ButtonIsDown(int but = wxJOY_BUTTON_ANY);
236 };
237
238 //---------------------------------------------------------------------------
239
240 class wxDropFilesEvent: public wxEvent {
241 public:
242 wxPoint GetPosition();
243 int GetNumberOfFiles();
244
245 %addmethods {
246 PyObject* GetFiles() {
247 int count = self->GetNumberOfFiles();
248 wxString* files = self->GetFiles();
249 PyObject* list = PyList_New(count);
250
251 if (!list) {
252 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
253 return NULL;
254 }
255
256 for (int i=0; i<count; i++) {
257 PyList_SetItem(list, i, PyString_FromString((const char*)files[i]));
258 }
259 return list;
260 }
261 }
262 };
263
264 //---------------------------------------------------------------------------
265
266 class wxIdleEvent: public wxEvent {
267 public:
268 void RequestMore(bool needMore = TRUE);
269 bool MoreRequested();
270 };
271
272 //---------------------------------------------------------------------------
273
274 class wxUpdateUIEvent: public wxEvent {
275 public:
276 bool GetChecked();
277 bool GetEnabled();
278 wxString GetText();
279 bool GetSetText();
280 bool GetSetChecked();
281 bool GetSetEnabled();
282
283 void Check(bool check);
284 void Enable(bool enable);
285 void SetText(const wxString& text);
286 };
287
288 //---------------------------------------------------------------------------
289
290 class wxSysColourChangedEvent: public wxEvent {
291 public:
292
293 };
294
295 //---------------------------------------------------------------------------
296
297
298 /////////////////////////////////////////////////////////////////////////////
299 //
300 // $Log$
301 // Revision 1.6 1999/02/06 22:55:00 RD
302 // Follow up for changes in wxWindows to various event classes
303 //
304 // Revision 1.5 1998/12/15 20:41:17 RD
305 // Changed the import semantics from "from wxPython import *" to "from
306 // wxPython.wx import *" This is for people who are worried about
307 // namespace pollution, they can use "from wxPython import wx" and then
308 // prefix all the wxPython identifiers with "wx."
309 //
310 // Added wxTaskbarIcon for wxMSW.
311 //
312 // Made the events work for wxGrid.
313 //
314 // Added wxConfig.
315 //
316 // Added wxMiniFrame for wxGTK, (untested.)
317 //
318 // Changed many of the args and return values that were pointers to gdi
319 // objects to references to reflect changes in the wxWindows API.
320 //
321 // Other assorted fixes and additions.
322 //
323 // Revision 1.4 1998/11/16 00:00:55 RD
324 // Generic treectrl for wxPython/GTK compiles...
325 //
326 // Revision 1.3 1998/10/20 06:43:56 RD
327 // New wxTreeCtrl wrappers (untested)
328 // some changes in helpers
329 // etc.
330 //
331 // Revision 1.2 1998/08/15 07:36:33 RD
332 // - Moved the header in the .i files out of the code that gets put into
333 // the .cpp files. It caused CVS conflicts because of the RCS ID being
334 // different each time.
335 //
336 // - A few minor fixes.
337 //
338 // Revision 1.1 1998/08/09 08:25:50 RD
339 // Initial version
340 //
341 //
342