]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/events.i
Added more makefiles
[wxWidgets.git] / utils / wxPython / src / events.i
CommitLineData
7bf85405
RD
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
03e9bead
RD
14%module events
15
16%{
7bf85405 17#include "helpers.h"
62bd0874 18#include <wx/spinbutt.h>
7bf85405
RD
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
32class wxEvent {
33public:
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
48class wxSizeEvent : public wxEvent {
49public:
50 wxSize GetSize();
51};
52
53//---------------------------------------------------------------------------
54
55class wxCloseEvent : public wxEvent {
56public:
e980740a 57 void SetLoggingOff(bool loggingOff);
7bf85405
RD
58 bool GetLoggingOff();
59 void Veto(bool veto = TRUE);
e980740a 60 bool CanVeto();
7bf85405 61 bool GetVeto();
b8b8dda7 62 void SetCanVeto(bool canVeto);
7bf85405
RD
63};
64
65//---------------------------------------------------------------------------
66
67class wxCommandEvent : public wxEvent {
68public:
69 bool Checked();
70 long GetExtraLong();
71 int GetInt();
72 int GetSelection();
73 char* GetString();
74 bool IsSelection();
75
76};
77
78
79//---------------------------------------------------------------------------
80
81class wxScrollEvent: public wxCommandEvent {
82public:
83 int GetOrientation();
84 int GetPosition();
85};
86
87//---------------------------------------------------------------------------
88
62bd0874
RD
89class wxSpinEvent : public wxScrollEvent {
90public:
91
92};
93
94//---------------------------------------------------------------------------
95
7bf85405
RD
96class wxMouseEvent: public wxEvent {
97public:
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
133class wxKeyEvent: public wxEvent {
134public:
135 bool ControlDown();
136 bool MetaDown();
137 bool AltDown();
138 bool ShiftDown();
139 long KeyCode();
e980740a
RD
140
141// void Position(float *OUTPUT, float *OUTPUT);
142// float GetX();
143// float GetY();
7bf85405
RD
144};
145
146//---------------------------------------------------------------------------
147
148class wxMoveEvent: public wxEvent {
149public:
150 wxPoint GetPosition();
151};
152
153//---------------------------------------------------------------------------
154
155class wxPaintEvent: public wxEvent {
156public:
157
158};
159
160//---------------------------------------------------------------------------
161
162class wxEraseEvent: public wxEvent {
163public:
164 wxDC *GetDC();
165};
166
167//---------------------------------------------------------------------------
168
169class wxFocusEvent: public wxEvent {
170public:
171
172};
173
174//---------------------------------------------------------------------------
175
176class wxActivateEvent: public wxEvent{
177public:
178 bool GetActive();
179};
180
181//---------------------------------------------------------------------------
182
183class wxInitDialogEvent: public wxEvent {
184public:
185
186};
187
188//---------------------------------------------------------------------------
189
190class wxMenuEvent: public wxEvent {
191public:
192 int GetMenuId();
193};
194
195//---------------------------------------------------------------------------
196
197class wxShowEvent: public wxEvent {
198public:
199 void SetShow(bool show);
200 bool GetShow();
201};
202
203//---------------------------------------------------------------------------
204
205class wxIconizeEvent: public wxEvent {
206public:
207};
208
209//---------------------------------------------------------------------------
210
211class wxMaximizeEvent: public wxEvent {
212public:
213
214};
215
216//---------------------------------------------------------------------------
217
218class wxJoystickEvent: public wxEvent {
219public:
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
240class wxDropFilesEvent: public wxEvent {
241public:
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
266class wxIdleEvent: public wxEvent {
267public:
268 void RequestMore(bool needMore = TRUE);
269 bool MoreRequested();
270};
271
272//---------------------------------------------------------------------------
273
274class wxUpdateUIEvent: public wxEvent {
275public:
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
290class wxSysColourChangedEvent: public wxEvent {
291public:
292
293};
294
295//---------------------------------------------------------------------------
296
297
298/////////////////////////////////////////////////////////////////////////////
299//
300// $Log$
e980740a
RD
301// Revision 1.6 1999/02/06 22:55:00 RD
302// Follow up for changes in wxWindows to various event classes
303//
b8b8dda7
RD
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//
62bd0874
RD
323// Revision 1.4 1998/11/16 00:00:55 RD
324// Generic treectrl for wxPython/GTK compiles...
325//
d5c9047a
RD
326// Revision 1.3 1998/10/20 06:43:56 RD
327// New wxTreeCtrl wrappers (untested)
328// some changes in helpers
329// etc.
330//
03e9bead
RD
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//
7bf85405
RD
338// Revision 1.1 1998/08/09 08:25:50 RD
339// Initial version
340//
341//
342