]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/events.i
Initial version
[wxWidgets.git] / utils / wxPython / src / events.i
1 %module events
2 %{
3 /////////////////////////////////////////////////////////////////////////////
4 // Name: events.i
5 // Purpose: SWIGgable Event classes for wxPython
6 //
7 // Author: Robin Dunn
8 //
9 // Created: 5/24/98
10 // RCS-ID: $Id$
11 // Copyright: (c) 1998 by Total Control Software
12 // Licence: wxWindows license
13 /////////////////////////////////////////////////////////////////////////////
14
15
16 #include "helpers.h"
17 %}
18
19 //----------------------------------------------------------------------
20
21 %include typemaps.i
22 %include my_typemaps.i
23
24 // Import some definitions of other classes, etc.
25 %import _defs.i
26 %import misc.i
27
28 //---------------------------------------------------------------------------
29
30 class wxEvent {
31 public:
32 wxObject* GetEventObject();
33 wxEventType GetEventType();
34 int GetId();
35 bool GetSkipped();
36 long GetTimestamp();
37 void SetEventObject(wxObject* object);
38 void SetEventType(wxEventType typ);
39 void SetId(int id);
40 void SetTimestamp(long timeStamp);
41 void Skip(bool skip = TRUE);
42 };
43
44 //---------------------------------------------------------------------------
45
46 class wxSizeEvent : public wxEvent {
47 public:
48 wxSize GetSize();
49 };
50
51 //---------------------------------------------------------------------------
52
53 class wxCloseEvent : public wxEvent {
54 public:
55 bool GetSessionEnding();
56 bool GetLoggingOff();
57 void Veto(bool veto = TRUE);
58 bool GetVeto();
59 void SetForce(bool force);
60 bool GetForce();
61 };
62
63 //---------------------------------------------------------------------------
64
65 class wxCommandEvent : public wxEvent {
66 public:
67 bool Checked();
68 long GetExtraLong();
69 int GetInt();
70 int GetSelection();
71 char* GetString();
72 bool IsSelection();
73
74 };
75
76
77 //---------------------------------------------------------------------------
78
79 class wxScrollEvent: public wxCommandEvent {
80 public:
81 int GetOrientation();
82 int GetPosition();
83 };
84
85 //---------------------------------------------------------------------------
86
87 class wxMouseEvent: public wxEvent {
88 public:
89 bool IsButton();
90 bool ButtonDown(int but = -1);
91 bool ButtonDClick(int but = -1);
92 bool ButtonUp(int but = -1);
93 bool Button(int but);
94 bool ButtonIsDown(int but);
95 bool ControlDown();
96 bool MetaDown();
97 bool AltDown();
98 bool ShiftDown();
99 bool LeftDown();
100 bool MiddleDown();
101 bool RightDown();
102 bool LeftUp();
103 bool MiddleUp();
104 bool RightUp();
105 bool LeftDClick();
106 bool MiddleDClick();
107 bool RightDClick();
108 bool LeftIsDown();
109 bool MiddleIsDown();
110 bool RightIsDown();
111 bool Dragging();
112 bool Moving();
113 bool Entering();
114 bool Leaving();
115 void Position(long *OUTPUT, long *OUTPUT);
116 wxPoint GetPosition();
117 wxPoint GetLogicalPosition(const wxDC& dc);
118 long GetX();
119 long GetY();
120 };
121
122 //---------------------------------------------------------------------------
123
124 class wxKeyEvent: public wxEvent {
125 public:
126 bool ControlDown();
127 bool MetaDown();
128 bool AltDown();
129 bool ShiftDown();
130 long KeyCode();
131 void Position(float *OUTPUT, float *OUTPUT);
132 float GetX();
133 float GetY();
134 };
135
136 //---------------------------------------------------------------------------
137
138 class wxMoveEvent: public wxEvent {
139 public:
140 wxPoint GetPosition();
141 };
142
143 //---------------------------------------------------------------------------
144
145 class wxPaintEvent: public wxEvent {
146 public:
147
148 };
149
150 //---------------------------------------------------------------------------
151
152 class wxEraseEvent: public wxEvent {
153 public:
154 wxDC *GetDC();
155 };
156
157 //---------------------------------------------------------------------------
158
159 class wxFocusEvent: public wxEvent {
160 public:
161
162 };
163
164 //---------------------------------------------------------------------------
165
166 class wxActivateEvent: public wxEvent{
167 public:
168 bool GetActive();
169 };
170
171 //---------------------------------------------------------------------------
172
173 class wxInitDialogEvent: public wxEvent {
174 public:
175
176 };
177
178 //---------------------------------------------------------------------------
179
180 class wxMenuEvent: public wxEvent {
181 public:
182 int GetMenuId();
183 };
184
185 //---------------------------------------------------------------------------
186
187 class wxShowEvent: public wxEvent {
188 public:
189 void SetShow(bool show);
190 bool GetShow();
191 };
192
193 //---------------------------------------------------------------------------
194
195 class wxIconizeEvent: public wxEvent {
196 public:
197 };
198
199 //---------------------------------------------------------------------------
200
201 class wxMaximizeEvent: public wxEvent {
202 public:
203
204 };
205
206 //---------------------------------------------------------------------------
207
208 class wxJoystickEvent: public wxEvent {
209 public:
210 wxPoint GetPosition();
211 int GetZPosition();
212 int GetButtonState();
213 int GetButtonChange();
214 int GetJoystick();
215 void SetJoystick(int stick);
216 void SetButtonState(int state);
217 void SetButtonChange(int change);
218 void SetPosition(const wxPoint& pos);
219 void SetZPosition(int zPos);
220 bool IsButton();
221 bool IsMove();
222 bool IsZMove();
223 bool ButtonDown(int but = wxJOY_BUTTON_ANY);
224 bool ButtonUp(int but = wxJOY_BUTTON_ANY);
225 bool ButtonIsDown(int but = wxJOY_BUTTON_ANY);
226 };
227
228 //---------------------------------------------------------------------------
229
230 class wxDropFilesEvent: public wxEvent {
231 public:
232 wxPoint GetPosition();
233 int GetNumberOfFiles();
234
235 %addmethods {
236 PyObject* GetFiles() {
237 int count = self->GetNumberOfFiles();
238 wxString* files = self->GetFiles();
239 PyObject* list = PyList_New(count);
240
241 if (!list) {
242 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
243 return NULL;
244 }
245
246 for (int i=0; i<count; i++) {
247 PyList_SetItem(list, i, PyString_FromString((const char*)files[i]));
248 }
249 return list;
250 }
251 }
252 };
253
254 //---------------------------------------------------------------------------
255
256 class wxIdleEvent: public wxEvent {
257 public:
258 void RequestMore(bool needMore = TRUE);
259 bool MoreRequested();
260 };
261
262 //---------------------------------------------------------------------------
263
264 class wxUpdateUIEvent: public wxEvent {
265 public:
266 bool GetChecked();
267 bool GetEnabled();
268 wxString GetText();
269 bool GetSetText();
270 bool GetSetChecked();
271 bool GetSetEnabled();
272
273 void Check(bool check);
274 void Enable(bool enable);
275 void SetText(const wxString& text);
276 };
277
278 //---------------------------------------------------------------------------
279
280 class wxSysColourChangedEvent: public wxEvent {
281 public:
282
283 };
284
285 //---------------------------------------------------------------------------
286
287
288 /////////////////////////////////////////////////////////////////////////////
289 //
290 // $Log$
291 // Revision 1.1 1998/08/09 08:25:50 RD
292 // Initial version
293 //
294 //
295