1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIGgable Event classes for wxPython
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/spinbutt.h>
21 //----------------------------------------------------------------------
24 %include my_typemaps.i
26 // Import some definitions of other classes, etc.
30 //---------------------------------------------------------------------------
34 wxObject* GetEventObject();
35 wxEventType GetEventType();
39 void SetEventObject(wxObject* object);
40 void SetEventType(wxEventType typ);
42 void SetTimestamp(long timeStamp);
43 void Skip(bool skip = TRUE);
46 //---------------------------------------------------------------------------
48 class wxSizeEvent : public wxEvent {
53 //---------------------------------------------------------------------------
55 class wxCloseEvent : public wxEvent {
57 void SetLoggingOff(bool loggingOff);
59 void Veto(bool veto = TRUE);
62 void SetCanVeto(bool canVeto);
65 //---------------------------------------------------------------------------
67 class wxCommandEvent : public wxEvent {
79 //---------------------------------------------------------------------------
81 class wxScrollEvent: public wxCommandEvent {
87 //---------------------------------------------------------------------------
89 class wxSpinEvent : public wxScrollEvent {
94 //---------------------------------------------------------------------------
96 class wxMouseEvent: public wxEvent {
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);
124 void Position(long *OUTPUT, long *OUTPUT);
125 wxPoint GetPosition();
126 wxPoint GetLogicalPosition(const wxDC& dc);
131 //---------------------------------------------------------------------------
133 class wxKeyEvent: public wxEvent {
143 //---------------------------------------------------------------------------
145 class wxMoveEvent: public wxEvent {
147 wxPoint GetPosition();
150 //---------------------------------------------------------------------------
152 class wxPaintEvent: public wxEvent {
157 //---------------------------------------------------------------------------
159 class wxEraseEvent: public wxEvent {
164 //---------------------------------------------------------------------------
166 class wxFocusEvent: public wxEvent {
171 //---------------------------------------------------------------------------
173 class wxActivateEvent: public wxEvent{
178 //---------------------------------------------------------------------------
180 class wxInitDialogEvent: public wxEvent {
185 //---------------------------------------------------------------------------
187 class wxMenuEvent: public wxEvent {
192 //---------------------------------------------------------------------------
194 class wxShowEvent: public wxEvent {
196 void SetShow(bool show);
200 //---------------------------------------------------------------------------
202 class wxIconizeEvent: public wxEvent {
206 //---------------------------------------------------------------------------
208 class wxMaximizeEvent: public wxEvent {
213 //---------------------------------------------------------------------------
215 class wxJoystickEvent: public wxEvent {
217 wxPoint GetPosition();
219 int GetButtonState();
220 int GetButtonChange();
222 void SetJoystick(int stick);
223 void SetButtonState(int state);
224 void SetButtonChange(int change);
225 void SetPosition(const wxPoint& pos);
226 void SetZPosition(int zPos);
230 bool ButtonDown(int but = wxJOY_BUTTON_ANY);
231 bool ButtonUp(int but = wxJOY_BUTTON_ANY);
232 bool ButtonIsDown(int but = wxJOY_BUTTON_ANY);
235 //---------------------------------------------------------------------------
237 class wxDropFilesEvent: public wxEvent {
239 wxPoint GetPosition();
240 int GetNumberOfFiles();
243 PyObject* GetFiles() {
244 int count = self->GetNumberOfFiles();
245 wxString* files = self->GetFiles();
246 PyObject* list = PyList_New(count);
249 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
253 for (int i=0; i<count; i++) {
254 PyList_SetItem(list, i, PyString_FromString((const char*)files[i]));
261 //---------------------------------------------------------------------------
263 class wxIdleEvent: public wxEvent {
265 void RequestMore(bool needMore = TRUE);
266 bool MoreRequested();
269 //---------------------------------------------------------------------------
271 class wxUpdateUIEvent: public wxEvent {
277 bool GetSetChecked();
278 bool GetSetEnabled();
280 void Check(bool check);
281 void Enable(bool enable);
282 void SetText(const wxString& text);
285 //---------------------------------------------------------------------------
287 class wxSysColourChangedEvent: public wxEvent {
292 //---------------------------------------------------------------------------
295 /////////////////////////////////////////////////////////////////////////////
298 // Revision 1.7 1999/02/20 09:02:57 RD
299 // Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a
300 // window handle. If you can get the window handle into the python code,
301 // it should just work... More news on this later.
303 // Added wxImageList, wxToolTip.
305 // Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the
306 // wxRegConfig class.
308 // As usual, some bug fixes, tweaks, etc.
310 // Revision 1.6 1999/02/06 22:55:00 RD
312 // Follow up for changes in wxWindows to various event classes
314 // Revision 1.5 1998/12/15 20:41:17 RD
315 // Changed the import semantics from "from wxPython import *" to "from
316 // wxPython.wx import *" This is for people who are worried about
317 // namespace pollution, they can use "from wxPython import wx" and then
318 // prefix all the wxPython identifiers with "wx."
320 // Added wxTaskbarIcon for wxMSW.
322 // Made the events work for wxGrid.
326 // Added wxMiniFrame for wxGTK, (untested.)
328 // Changed many of the args and return values that were pointers to gdi
329 // objects to references to reflect changes in the wxWindows API.
331 // Other assorted fixes and additions.
333 // Revision 1.4 1998/11/16 00:00:55 RD
334 // Generic treectrl for wxPython/GTK compiles...
336 // Revision 1.3 1998/10/20 06:43:56 RD
337 // New wxTreeCtrl wrappers (untested)
338 // some changes in helpers
341 // Revision 1.2 1998/08/15 07:36:33 RD
342 // - Moved the header in the .i files out of the code that gets put into
343 // the .cpp files. It caused CVS conflicts because of the RCS ID being
344 // different each time.
346 // - A few minor fixes.
348 // Revision 1.1 1998/08/09 08:25:50 RD