]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/events.i
Generic treectrl for wxPython/GTK compiles...
[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 // ??? it's in the docs ??? bool GetSessionEnding();
58 bool GetLoggingOff();
59 void Veto(bool veto = TRUE);
60 bool GetVeto();
61 void SetForce(bool force);
62 bool GetForce();
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 void Position(float *OUTPUT, float *OUTPUT);
141 float GetX();
142 float GetY();
143 };
144
145 //---------------------------------------------------------------------------
146
147 class wxMoveEvent: public wxEvent {
148 public:
149 wxPoint GetPosition();
150 };
151
152 //---------------------------------------------------------------------------
153
154 class wxPaintEvent: public wxEvent {
155 public:
156
157 };
158
159 //---------------------------------------------------------------------------
160
161 class wxEraseEvent: public wxEvent {
162 public:
163 wxDC *GetDC();
164 };
165
166 //---------------------------------------------------------------------------
167
168 class wxFocusEvent: public wxEvent {
169 public:
170
171 };
172
173 //---------------------------------------------------------------------------
174
175 class wxActivateEvent: public wxEvent{
176 public:
177 bool GetActive();
178 };
179
180 //---------------------------------------------------------------------------
181
182 class wxInitDialogEvent: public wxEvent {
183 public:
184
185 };
186
187 //---------------------------------------------------------------------------
188
189 class wxMenuEvent: public wxEvent {
190 public:
191 int GetMenuId();
192 };
193
194 //---------------------------------------------------------------------------
195
196 class wxShowEvent: public wxEvent {
197 public:
198 void SetShow(bool show);
199 bool GetShow();
200 };
201
202 //---------------------------------------------------------------------------
203
204 class wxIconizeEvent: public wxEvent {
205 public:
206 };
207
208 //---------------------------------------------------------------------------
209
210 class wxMaximizeEvent: public wxEvent {
211 public:
212
213 };
214
215 //---------------------------------------------------------------------------
216
217 class wxJoystickEvent: public wxEvent {
218 public:
219 wxPoint GetPosition();
220 int GetZPosition();
221 int GetButtonState();
222 int GetButtonChange();
223 int GetJoystick();
224 void SetJoystick(int stick);
225 void SetButtonState(int state);
226 void SetButtonChange(int change);
227 void SetPosition(const wxPoint& pos);
228 void SetZPosition(int zPos);
229 bool IsButton();
230 bool IsMove();
231 bool IsZMove();
232 bool ButtonDown(int but = wxJOY_BUTTON_ANY);
233 bool ButtonUp(int but = wxJOY_BUTTON_ANY);
234 bool ButtonIsDown(int but = wxJOY_BUTTON_ANY);
235 };
236
237 //---------------------------------------------------------------------------
238
239 class wxDropFilesEvent: public wxEvent {
240 public:
241 wxPoint GetPosition();
242 int GetNumberOfFiles();
243
244 %addmethods {
245 PyObject* GetFiles() {
246 int count = self->GetNumberOfFiles();
247 wxString* files = self->GetFiles();
248 PyObject* list = PyList_New(count);
249
250 if (!list) {
251 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
252 return NULL;
253 }
254
255 for (int i=0; i<count; i++) {
256 PyList_SetItem(list, i, PyString_FromString((const char*)files[i]));
257 }
258 return list;
259 }
260 }
261 };
262
263 //---------------------------------------------------------------------------
264
265 class wxIdleEvent: public wxEvent {
266 public:
267 void RequestMore(bool needMore = TRUE);
268 bool MoreRequested();
269 };
270
271 //---------------------------------------------------------------------------
272
273 class wxUpdateUIEvent: public wxEvent {
274 public:
275 bool GetChecked();
276 bool GetEnabled();
277 wxString GetText();
278 bool GetSetText();
279 bool GetSetChecked();
280 bool GetSetEnabled();
281
282 void Check(bool check);
283 void Enable(bool enable);
284 void SetText(const wxString& text);
285 };
286
287 //---------------------------------------------------------------------------
288
289 class wxSysColourChangedEvent: public wxEvent {
290 public:
291
292 };
293
294 //---------------------------------------------------------------------------
295
296
297 /////////////////////////////////////////////////////////////////////////////
298 //
299 // $Log$
300 // Revision 1.4 1998/11/16 00:00:55 RD
301 // Generic treectrl for wxPython/GTK compiles...
302 //
303 // Revision 1.3 1998/10/20 06:43:56 RD
304 // New wxTreeCtrl wrappers (untested)
305 // some changes in helpers
306 // etc.
307 //
308 // Revision 1.2 1998/08/15 07:36:33 RD
309 // - Moved the header in the .i files out of the code that gets put into
310 // the .cpp files. It caused CVS conflicts because of the RCS ID being
311 // different each time.
312 //
313 // - A few minor fixes.
314 //
315 // Revision 1.1 1998/08/09 08:25:50 RD
316 // Initial version
317 //
318 //
319