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
44 // if you don't call SetOwner() or provide an owner in the contstructor
45 // then you must override Notify() inorder to receive the timer
46 // notification. If the owner is set then it will get the timer
47 // notifications which can be handled with EVT_TIMER.
48 wxPyTimer(wxEvtHandler *owner=NULL, int id = -1);
51 // Set the owner instance that will receive the EVT_TIMER events using the
53 void SetOwner(wxEvtHandler *owner, int id = -1);
56 // start the timer: if milliseconds == -1, use the same value as for the
59 // it is now valid to call Start() multiple times: this just restarts the
60 // timer if it is already running
61 virtual bool Start(int milliseconds = -1, bool oneShot = False);
66 // override this in your wxTimer-derived class if you want to process timer
67 // messages in it, use non default ctor or SetOwner() otherwise
68 virtual void Notify();
70 // return True if the timer is running
71 virtual bool IsRunning() const;
73 // get the (last) timer interval in the milliseconds
74 int GetInterval() const;
76 // return True if the timer is one shot
77 bool IsOneShot() const;
82 %# For backwards compatibility with 2.4
84 def __init__(self, notify):
93 EVT_TIMER = wx.PyEventBinder( wxEVT_TIMER, 1 )
99 class wxTimerEvent : public wxEvent
102 wxTimerEvent(int timerid = 0, int interval = 0);
103 int GetInterval() const;
108 // wxTimerRunner: starts the timer in its ctor, stops in the dtor
112 %nokwargs wxTimerRunner;
113 wxTimerRunner(wxTimer& timer);
114 wxTimerRunner(wxTimer& timer, int milli, bool oneShot = False);
117 void Start(int milli, bool oneShot = False);
121 //---------------------------------------------------------------------------