X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..fa1c12bdd76acc21ddb45b90bb53b2f58aed946d:/src/msw/timer.cpp diff --git a/src/msw/timer.cpp b/src/msw/timer.cpp index cd331eb4ec..17f1c17552 100644 --- a/src/msw/timer.cpp +++ b/src/msw/timer.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_TIMER + #ifndef WX_PRECOMP #include "wx/setup.h" #include "wx/window.h" @@ -51,7 +53,7 @@ UINT WINAPI _EXPORT wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD); #define _EXPORT _export #endif - IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) +IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) // ============================================================================ // implementation @@ -61,7 +63,7 @@ UINT WINAPI _EXPORT wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD); // wxTimer class // ---------------------------------------------------------------------------- -wxTimer::wxTimer() +void wxTimer::Init() { m_id = 0; } @@ -80,11 +82,18 @@ bool wxTimer::Start(int milliseconds, bool oneShot) wxCHECK_MSG( m_milli > 0, FALSE, wxT("invalid value for timer timeour") ); wxTimerList.DeleteObject(this); + +#ifdef __WXMICROWIN__ + m_id = SetTimer(NULL, (UINT)(m_id ? m_id : 1), + (UINT)milliseconds, (TIMERPROC) wxTimerProc); +#else TIMERPROC wxTimerProcInst = (TIMERPROC) MakeProcInstance((FARPROC)wxTimerProc, wxGetInstance()); m_id = SetTimer(NULL, (UINT)(m_id ? m_id : 1), (UINT)milliseconds, wxTimerProcInst); +#endif + if ( m_id > 0 ) { wxTimerList.Append(m_id, this); @@ -136,3 +145,5 @@ UINT WINAPI _EXPORT wxTimerProc(HWND WXUNUSED(hwnd), WORD, int idTimer, DWORD) return 0; } + +#endif // wxUSE_TIMER