]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: timer.h | |
3 | // Purpose: wxTimer class | |
4 | // Author: David Webster | |
5 | // Modified by: | |
6 | // Created: 10/17/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) David Webster | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_TIMER_H_ | |
13 | #define _WX_TIMER_H_ | |
14 | ||
15 | #include "wx/object.h" | |
16 | ||
17 | class WXDLLEXPORT wxTimer: public wxObject | |
18 | { | |
19 | friend void wxProcessTimer(wxTimer& timer); | |
20 | ||
21 | public: | |
22 | wxTimer(); | |
23 | ~wxTimer(); | |
24 | ||
25 | virtual bool Start(int milliseconds = -1, | |
26 | bool one_shot = FALSE); // Start timer | |
27 | virtual void Stop(); // Stop timer | |
28 | ||
29 | virtual void Notify() = 0; // Override this member | |
30 | ||
31 | // Returns the current interval time (0 if stop) | |
32 | int Interval() const { return milli; }; | |
33 | bool OneShot() const { return oneShot; } | |
34 | ||
35 | protected: | |
36 | bool oneShot ; | |
37 | int milli ; | |
38 | int lastMilli ; | |
39 | ||
40 | long id; | |
41 | ||
42 | private: | |
43 | DECLARE_ABSTRACT_CLASS(wxTimer) | |
44 | }; | |
45 | ||
46 | #endif | |
47 | // _WX_TIMER_H_ |