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 %addtofunc 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;
85 %# For backwards compatibility with 2.4
87 def __init__(self, notify):
96 EVT_TIMER = wx.PyEventBinder( wxEVT_TIMER, 1 )
102 class wxTimerEvent : public wxEvent
105 wxTimerEvent(int timerid = 0, int interval = 0);
106 int GetInterval() const;
111 // wxTimerRunner: starts the timer in its ctor, stops in the dtor
115 %nokwargs wxTimerRunner;
116 wxTimerRunner(wxTimer& timer);
117 wxTimerRunner(wxTimer& timer, int milli, bool oneShot = False);
120 void Start(int milli, bool oneShot = False);
124 //---------------------------------------------------------------------------