]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: timer.h | |
3 | // Purpose: wxTimer class | |
d90895ac | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
d90895ac | 6 | // Created: 10/17/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
d90895ac | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_TIMER_H_ | |
13 | #define _WX_TIMER_H_ | |
14 | ||
8d8bd9bf SN |
15 | #ifdef __GNUG__ |
16 | #pragma interface "timer.h" | |
17 | #endif | |
18 | ||
0e320a79 DW |
19 | #include "wx/object.h" |
20 | ||
9ed0fac8 | 21 | class WXDLLEXPORT wxTimer: public wxTimerBase |
0e320a79 | 22 | { |
d90895ac DW |
23 | friend void wxProcessTimer(wxTimer& timer); |
24 | ||
0e320a79 | 25 | public: |
b9cf5e6d DW |
26 | wxTimer() { Init(); } |
27 | wxTimer( wxEvtHandler* pOwner | |
28 | ,int nId = -1 | |
29 | ) | |
30 | : wxTimerBase( pOwner | |
31 | ,nId | |
32 | ) | |
33 | { Init(); } | |
0e320a79 DW |
34 | ~wxTimer(); |
35 | ||
6c0fdfbb | 36 | virtual void Notify(void); |
9ed0fac8 DW |
37 | virtual bool Start( int nMilliseconds = -1 |
38 | ,bool bOneShot = FALSE | |
39 | ); | |
40 | virtual void Stop(void); | |
0e320a79 | 41 | |
9ed0fac8 | 42 | inline virtual bool IsRunning(void) const { return m_ulId != 0L; } |
5d644707 | 43 | inline int GetTimerId(void) const { return m_idTimer; } |
0e320a79 DW |
44 | |
45 | protected: | |
b9cf5e6d DW |
46 | void Init(void); |
47 | ||
9ed0fac8 DW |
48 | ULONG m_ulId; |
49 | HAB m_Hab; | |
0e320a79 DW |
50 | |
51 | private: | |
52 | DECLARE_ABSTRACT_CLASS(wxTimer) | |
53 | }; | |
54 | ||
b9cf5e6d DW |
55 | extern ULONG wxTimerProc( HWND WXUNUSED(hwnd) |
56 | ,ULONG | |
57 | ,int nIdTimer | |
58 | ,ULONG | |
59 | ); | |
0e320a79 DW |
60 | #endif |
61 | // _WX_TIMER_H_ |