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