[Overview][Classes][Index] Reference for unit 'CustomTimer' (#lcl)

TCustomTimer.UpdateTimer

Updates the Timer to reflect the current properties.

Declaration

Source position: customtimer.pas line 45

protected procedure TCustomTimer.UpdateTimer; virtual;

Description

UpdateTimer is a protected virtual procedure used to update property values in the timer class instance. UpdateTimer calls KillTimer to stop the timer if it has been enabled and a widget set handle has been previously assigned for the class instance. The handle is recreated at run-time using the Timer method as a polling routine when Enabled contains True, Interval contains a value greater than 0 (zero), and OnTimer has been assigned for the class instance. The handle is not recreated if the component is being freed, or when the component is Loaded using the LCL streaming mechanism.

UpdateTimer can raise an EOutOfResources exception with the message in SNoTimers if a missing or invalid handle is returned from the widget set class.

UpdateTimer signals the OnStartTimer event handler when it has been assigned for the class instance. The event handler is not signalled when it has not been assigned (contains Nil), Enabled contains False, or Interval contains the value 0 (zero).

UpdateTimer is called from the Loaded method when component streaming has been completed, and when the value in the OnTimer event handler is changed.

Errors

Raises an EOutOfResources exception with the message in SNoTimers if a missing or invalid handle is returned from the widget set class.

See also

TCustomTimer.KillTimer

  

Stops execution of the timer class instance.

TCustomTimer.Enabled

  

Indicates if the timer is ready to start.

TCustomTimer.Interval

  

The Interval (in milliseconds) for timer notifications.

TCustomTimer.OnStartTimer

  

Event handler signalled when the timer is started.

TCustomTimer.OnTimer

  

Event handler signalled when the Interval for the timer has elapsed.

TComponent


Version 4.0 Generated 2025-05-03 Home