- oneShot = mode ;
- if (milliseconds < 0)
- milliseconds = lastMilli;
-
- if (milliseconds <= 0)
- return FALSE;
-
- 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)
- {
- wxTimerList.Append(id, this);
- return TRUE;
- }
- else return FALSE;
+ oneShot = mode ;
+ if (milliseconds < 0)
+ milliseconds = lastMilli;
+
+ wxCHECK_MSG( milliseconds > 0, FALSE, "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)
+ {
+ wxTimerList.Append(id, this);
+
+ return TRUE;
+ }
+ else
+ {
+ wxLogSysError(_("Couldn't create a timer"));
+
+ return FALSE;
+ }