1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface definitions wxTimer
7 // Created: 18-June-1999
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
20 // generate notifications periodically until the timer is stopped (default)
23 // only send the notification once and then stop the timer
28 %constant wxEventType wxEVT_TIMER;
31 //---------------------------------------------------------------------------
35 IMP_PYCALLBACK__(wxPyTimer, wxTimer, Notify);
40 %name(Timer) class wxPyTimer : public wxEvtHandler
43 %pythonAppend wxPyTimer "self._setCallbackInfo(self, Timer)"
45 // if you don't call SetOwner() or provide an owner in the contstructor
46 // then you must override Notify() inorder to receive the timer
47 // notification. If the owner is set then it will get the timer
48 // notifications which can be handled with EVT_TIMER.
49 wxPyTimer(wxEvtHandler *owner=NULL, int id = -1);
52 void _setCallbackInfo(PyObject* self, PyObject* _class);
54 // Set the owner instance that will receive the EVT_TIMER events using the
56 void SetOwner(wxEvtHandler *owner, int id = -1);
59 // start the timer: if milliseconds == -1, use the same value as for the
62 // it is now valid to call Start() multiple times: this just restarts the
63 // timer if it is already running
64 virtual bool Start(int milliseconds = -1, bool oneShot = False);
69 // override this in your wxTimer-derived class if you want to process timer
70 // messages in it, use non default ctor or SetOwner() otherwise
71 //virtual void Notify();
73 // return True if the timer is running
74 virtual bool IsRunning() const;
76 // get the (last) timer interval in the milliseconds
77 int GetInterval() const;
79 // return True if the timer is one shot
80 bool IsOneShot() const;
82 // return the timer ID
89 %# For backwards compatibility with 2.4
91 def __init__(self, notify):
100 EVT_TIMER = wx.PyEventBinder( wxEVT_TIMER, 1 )
106 class wxTimerEvent : public wxEvent
109 wxTimerEvent(int timerid = 0, int interval = 0);
110 int GetInterval() const;
115 // wxTimerRunner: starts the timer in its ctor, stops in the dtor
119 %nokwargs wxTimerRunner;
120 wxTimerRunner(wxTimer& timer);
121 wxTimerRunner(wxTimer& timer, int milli, bool oneShot = False);
124 void Start(int milli, bool oneShot = False);
128 //---------------------------------------------------------------------------