]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/events.i
Removed some unnecessary bitmaps; other minor changes
[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:
b8b8dda7
RD
57 bool CanVeto();
58// **** bool GetSessionEnding();
7bf85405
RD
59 bool GetLoggingOff();
60 void Veto(bool veto = TRUE);
61 bool GetVeto();
62 void SetForce(bool force);
b8b8dda7
RD
63 void SetCanVeto(bool canVeto);
64 void SetLoggingOff(bool loggingOff);
7bf85405
RD
65 bool GetForce();
66};
67
68//---------------------------------------------------------------------------
69
70class wxCommandEvent : public wxEvent {
71public:
72 bool Checked();
73 long GetExtraLong();
74 int GetInt();
75 int GetSelection();
76 char* GetString();
77 bool IsSelection();
78
79};
80
81
82//---------------------------------------------------------------------------
83
84class wxScrollEvent: public wxCommandEvent {
85public:
86 int GetOrientation();
87 int GetPosition();
88};
89
90//---------------------------------------------------------------------------
91
62bd0874
RD
92class wxSpinEvent : public wxScrollEvent {
93public:
94
95};
96
97//---------------------------------------------------------------------------
98
7bf85405
RD
99class wxMouseEvent: public wxEvent {
100public:
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
136class wxKeyEvent: public wxEvent {
137public:
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
150class wxMoveEvent: public wxEvent {
151public:
152 wxPoint GetPosition();
153};
154
155//---------------------------------------------------------------------------
156
157class wxPaintEvent: public wxEvent {
158public:
159
160};
161
162//---------------------------------------------------------------------------
163
164class wxEraseEvent: public wxEvent {
165public:
166 wxDC *GetDC();
167};
168
169//---------------------------------------------------------------------------
170
171class wxFocusEvent: public wxEvent {
172public:
173
174};
175
176//---------------------------------------------------------------------------
177
178class wxActivateEvent: public wxEvent{
179public:
180 bool GetActive();
181};
182
183//---------------------------------------------------------------------------
184
185class wxInitDialogEvent: public wxEvent {
186public:
187
188};
189
190//---------------------------------------------------------------------------
191
192class wxMenuEvent: public wxEvent {
193public:
194 int GetMenuId();
195};
196
197//---------------------------------------------------------------------------
198
199class wxShowEvent: public wxEvent {
200public:
201 void SetShow(bool show);
202 bool GetShow();
203};
204
205//---------------------------------------------------------------------------
206
207class wxIconizeEvent: public wxEvent {
208public:
209};
210
211//---------------------------------------------------------------------------
212
213class wxMaximizeEvent: public wxEvent {
214public:
215
216};
217
218//---------------------------------------------------------------------------
219
220class wxJoystickEvent: public wxEvent {
221public:
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
242class wxDropFilesEvent: public wxEvent {
243public:
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
268class wxIdleEvent: public wxEvent {
269public:
270 void RequestMore(bool needMore = TRUE);
271 bool MoreRequested();
272};
273
274//---------------------------------------------------------------------------
275
276class wxUpdateUIEvent: public wxEvent {
277public:
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
292class wxSysColourChangedEvent: public wxEvent {
293public:
294
295};
296
297//---------------------------------------------------------------------------
298
299
300/////////////////////////////////////////////////////////////////////////////
301//
302// $Log$
b8b8dda7
RD
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//
62bd0874
RD
322// Revision 1.4 1998/11/16 00:00:55 RD
323// Generic treectrl for wxPython/GTK compiles...
324//
d5c9047a
RD
325// Revision 1.3 1998/10/20 06:43:56 RD
326// New wxTreeCtrl wrappers (untested)
327// some changes in helpers
328// etc.
329//
03e9bead
RD
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//
7bf85405
RD
337// Revision 1.1 1998/08/09 08:25:50 RD
338// Initial version
339//
340//
341