]>
Commit | Line | Data |
---|---|---|
2fcd7f64 RN |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: timer.h | |
3 | // Purpose: Cocoa wxTimer class | |
4 | // Author: Ryan Norton | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) Ryan Norton | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | ||
11 | #ifndef __WX_TIMER_H__ | |
12 | #define __WX_TIMER_H__ | |
13 | ||
2fcd7f64 RN |
14 | #include "wx/cocoa/ObjcRef.h" |
15 | ||
16 | //----------------------------------------------------------------------------- | |
17 | // wxTimer | |
18 | //----------------------------------------------------------------------------- | |
19 | ||
20 | DECLARE_WXCOCOA_OBJC_CLASS(NSTimer); | |
21 | ||
22 | class WXDLLEXPORT wxTimer : public wxTimerBase | |
23 | { | |
24 | public: | |
25 | wxTimer() { Init(); } | |
26 | wxTimer(wxEvtHandler *owner, int timerid = -1) : wxTimerBase(owner, timerid) | |
27 | { Init(); } | |
d3c7fc99 | 28 | virtual ~wxTimer(); |
2fcd7f64 RN |
29 | |
30 | virtual bool Start(int millisecs = -1, bool oneShot = false); | |
31 | virtual void Stop(); | |
32 | ||
33 | virtual bool IsRunning() const; | |
34 | ||
35 | inline WX_NSTimer GetNSTimer() | |
36 | { return m_cocoaNSTimer; } | |
37 | ||
38 | protected: | |
39 | void Init(); | |
40 | ||
41 | private: | |
42 | WX_NSTimer m_cocoaNSTimer; | |
2fcd7f64 RN |
43 | |
44 | DECLARE_ABSTRACT_CLASS(wxTimer) | |
45 | }; | |
46 | ||
47 | #endif // __WX_TIMER_H__ |