- Stop();
-
- wxTimerList.DeleteObject(this);
-}
-
-bool wxTimer::Start(int milliseconds, bool mode)
-{
- oneShot = mode ;
- if (milliseconds < 0)
- milliseconds = lastMilli;
-
- wxCHECK_MSG( milliseconds > 0, FALSE, _T("invalid value for timer timeour") );
-
- lastMilli = milli = milliseconds;
-
- wxTimerList.DeleteObject(this);
- TIMERPROC wxTimerProcInst = (TIMERPROC)
- MakeProcInstance((FARPROC)wxTimerProc, wxGetInstance());
-
- id = SetTimer(NULL, (UINT)(id ? id : 1),
- (UINT)milliseconds, wxTimerProcInst);
- if (id > 0)
+ if ( !wxTimerImpl::Start(milliseconds, oneShot) )
+ return false;
+
+ m_id = ::SetTimer
+ (
+ NULL, // don't use window
+ 1, // id ignored with NULL hwnd anyhow
+ (UINT)m_milli, // delay
+ wxTimerProc // timer proc to call
+ );
+
+ if ( !m_id )