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.
 
  31 //---------------------------------------------------------------------------
 
  38     wxObject* GetEventObject();
 
  39     wxEventType GetEventType();
 
  43     void SetEventObject(wxObject* object);
 
  44     void SetEventType(wxEventType typ);
 
  46     void SetTimestamp(long timeStamp);
 
  47     void Skip(bool skip = TRUE);
 
  50 //---------------------------------------------------------------------------
 
  52 class wxSizeEvent : public wxEvent {
 
  54     wxSizeEvent(const wxSize& sz, int id = 0);
 
  58 //---------------------------------------------------------------------------
 
  60 class wxCloseEvent : public wxEvent {
 
  62     wxCloseEvent(int commandEventType = 0, int id = 0);
 
  64     void SetLoggingOff(bool loggingOff);
 
  66     void Veto(bool veto = TRUE);
 
  69     void SetCanVeto(bool canVeto);
 
  72 //---------------------------------------------------------------------------
 
  74 class wxCommandEvent : public wxEvent {
 
  76     wxCommandEvent(int commandEventType = 0, int id = 0);
 
  79     %name(Checked)bool IsChecked();
 
  85     void SetString(const wxString& s);
 
  86     void SetExtraLong(long extraLong);
 
  92 //---------------------------------------------------------------------------
 
  94 class wxScrollEvent: public wxCommandEvent {
 
  96     wxScrollEvent(int commandType = 0, int id = 0, int pos = 0,
 
 103 //---------------------------------------------------------------------------
 
 105 class wxScrollWinEvent: public wxEvent {
 
 107     wxScrollWinEvent(int commandType = 0, int pos = 0,
 
 108                      int orientation = 0);
 
 110     int GetOrientation();
 
 114 //---------------------------------------------------------------------------
 
 116 class wxSpinEvent : public wxScrollEvent {
 
 118     wxSpinEvent(int commandType = 0, int id = 0);
 
 122 //---------------------------------------------------------------------------
 
 124 class wxMouseEvent: public wxEvent {
 
 126     wxMouseEvent(int mouseEventType = 0);
 
 129     bool ButtonDown(int but = -1);
 
 130     bool ButtonDClick(int but = -1);
 
 131     bool ButtonUp(int but = -1);
 
 132     bool Button(int but);
 
 133     bool ButtonIsDown(int but);
 
 154     wxPoint GetPosition();
 
 155     %name(GetPositionTuple)void GetPosition(long *OUTPUT, long *OUTPUT);
 
 156     wxPoint GetLogicalPosition(const wxDC& dc);
 
 161 //---------------------------------------------------------------------------
 
 163 class wxKeyEvent: public wxEvent {
 
 165     wxKeyEvent(int keyEventType);
 
 178     wxPoint GetPosition();
 
 179     %name(GetPositionTuple) void GetPosition(long* OUTPUT, long* OUTPUT);
 
 182 //---------------------------------------------------------------------------
 
 184 class wxNavigationKeyEvent : public wxEvent {
 
 186     wxNavigationKeyEvent();
 
 189     void SetDirection(bool bForward);
 
 190     bool IsWindowChange();
 
 191     void SetWindowChange(bool bIs);
 
 192     wxWindow* GetCurrentFocus();
 
 193     void SetCurrentFocus(wxWindow *win);
 
 197 //---------------------------------------------------------------------------
 
 199 class wxMoveEvent: public wxEvent {
 
 201     wxMoveEvent(const wxPoint& pt, int id = 0);
 
 203     wxPoint GetPosition();
 
 206 //---------------------------------------------------------------------------
 
 208 class wxPaintEvent: public wxEvent {
 
 210     wxPaintEvent(int id = 0);
 
 214 //---------------------------------------------------------------------------
 
 216 class wxEraseEvent: public wxEvent {
 
 218     wxEraseEvent(int id = 0, wxDC* dc = NULL);
 
 223 //---------------------------------------------------------------------------
 
 225 class wxFocusEvent: public wxEvent {
 
 227     wxFocusEvent(WXTYPE eventType = 0, int id = 0);
 
 230 //---------------------------------------------------------------------------
 
 232 class wxActivateEvent: public wxEvent{
 
 234     wxActivateEvent(WXTYPE eventType = 0, int active = TRUE, int id = 0);
 
 238 //---------------------------------------------------------------------------
 
 240 class wxInitDialogEvent: public wxEvent {
 
 242     wxInitDialogEvent(int id = 0);
 
 245 //---------------------------------------------------------------------------
 
 247 class wxMenuEvent: public wxEvent {
 
 249     wxMenuEvent(WXTYPE id = 0, int id = 0);
 
 253 //---------------------------------------------------------------------------
 
 255 class wxShowEvent: public wxEvent {
 
 257     wxShowEvent(int id = 0, int show = FALSE);
 
 258     void SetShow(bool show);
 
 262 //---------------------------------------------------------------------------
 
 264 class wxIconizeEvent: public wxEvent {
 
 266     wxIconizeEvent(int id = 0);
 
 269 //---------------------------------------------------------------------------
 
 271 class wxMaximizeEvent: public wxEvent {
 
 273     wxMaximizeEvent(int id = 0);
 
 276 //---------------------------------------------------------------------------
 
 278 class wxJoystickEvent: public wxEvent {
 
 280     wxJoystickEvent(int type = wxEVT_NULL,
 
 282                     int joystick = wxJOYSTICK1,
 
 284     wxPoint GetPosition();
 
 286     int GetButtonState();
 
 287     int GetButtonChange();
 
 289     void SetJoystick(int stick);
 
 290     void SetButtonState(int state);
 
 291     void SetButtonChange(int change);
 
 292     void SetPosition(const wxPoint& pos);
 
 293     void SetZPosition(int zPos);
 
 297     bool ButtonDown(int but = wxJOY_BUTTON_ANY);
 
 298     bool ButtonUp(int but = wxJOY_BUTTON_ANY);
 
 299     bool ButtonIsDown(int but =  wxJOY_BUTTON_ANY);
 
 302 //---------------------------------------------------------------------------
 
 304 class wxDropFilesEvent: public wxEvent {
 
 306     wxPoint GetPosition();
 
 307     int GetNumberOfFiles();
 
 310         PyObject* GetFiles() {
 
 311             int         count = self->GetNumberOfFiles();
 
 312             wxString*   files = self->GetFiles();
 
 313             PyObject*   list  = PyList_New(count);
 
 316                 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
 
 320             for (int i=0; i<count; i++) {
 
 321                 PyList_SetItem(list, i, PyString_FromString((const char*)files[i]));
 
 328 //---------------------------------------------------------------------------
 
 330 class wxIdleEvent: public wxEvent {
 
 333     void RequestMore(bool needMore = TRUE);
 
 334     bool MoreRequested();
 
 337 //---------------------------------------------------------------------------
 
 339 class wxUpdateUIEvent: public wxEvent {
 
 341     wxUpdateUIEvent(wxWindowID commandId = 0);
 
 346     bool GetSetChecked();
 
 347     bool GetSetEnabled();
 
 349     void Check(bool check);
 
 350     void Enable(bool enable);
 
 351     void SetText(const wxString& text);
 
 354 //---------------------------------------------------------------------------
 
 356 class wxSysColourChangedEvent: public wxEvent {
 
 358     wxSysColourChangedEvent();
 
 361 //---------------------------------------------------------------------------
 
 364 class wxNotifyEvent : public wxCommandEvent {
 
 366     wxNotifyEvent(int commandType = wxEVT_NULL, int id = 0);
 
 372 //---------------------------------------------------------------------------
 
 374 class  wxPaletteChangedEvent : public wxEvent {
 
 376     wxPaletteChangedEvent(wxWindowID id = 0);
 
 378     void SetChangedWindow(wxWindow* win);
 
 379     wxWindow* GetChangedWindow();
 
 383 //---------------------------------------------------------------------------
 
 385 class  wxQueryNewPaletteEvent : public wxEvent {
 
 387     wxQueryNewPaletteEvent(wxWindowID id = 0);
 
 389     void SetPaletteRealized(bool realized);
 
 390     bool GetPaletteRealized();
 
 394 //---------------------------------------------------------------------------
 
 396 class wxWindowCreateEvent : public wxCommandEvent {
 
 398     wxWindowCreateEvent(wxWindow *win = NULL);
 
 400     wxWindow *GetWindow();
 
 403 class wxWindowDestroyEvent : public wxCommandEvent {
 
 405     wxWindowDestroyEvent(wxWindow *win = NULL);
 
 407     wxWindow *GetWindow();
 
 410 //---------------------------------------------------------------------------
 
 412 class  wxTimerEvent : public wxEvent
 
 415     wxTimerEvent(int id = 0, int interval = 0);
 
 420 //---------------------------------------------------------------------------
 
 421 //---------------------------------------------------------------------------
 
 422 // These classes can be derived from in Python and passed through the event
 
 423 // system without loosing anything.  They do this by keeping a reference to
 
 424 // themselves and some special case handling in wxPyCallback::EventThunker.
 
 426 class wxPyEvent : public wxEvent {
 
 431     %pragma(python) addtomethod = "__init__:self.SetSelf(self)"
 
 433     void SetSelf(PyObject* self);
 
 438 class wxPyCommandEvent : public wxCommandEvent {
 
 440     wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0);
 
 443     %pragma(python) addtomethod = "__init__:self.SetSelf(self)"
 
 445     void SetSelf(PyObject* self);
 
 452 //---------------------------------------------------------------------------
 
 453 //---------------------------------------------------------------------------