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