Timer#

Qualified name: delphivcl.Timer

class Timer#

Bases: Component

TTimer encapsulates the Windows API timer functions. TTimer is used to simplify calling the Windows API timer functions SetTimer and KillTimer, and to simplify processing the WM_TIMER messages. Use one timer component for each timer in the application. The execution of the timer occurs through its OnTimer event. TTimer has an Interval property that determines how often the timer’s OnTimer event occurs. The interval corresponds to the parameter for the Windows API SetTimer function.

Warning: Limitations on the total number of timers system-wide are system-dependent.

Methods

BindMethodsToEvents

Connects methods to component events if they are named using the following pattern: Prefix_ComponentName_EventName.

Create

Instantiates a timer object.

Destroy

Disposes of a timer object.

GetParentComponent

Returns the parent of a component.

HasParent

Indicates whether the component has a parent to handle its filing.

Attributes

ClassName

Returns the TObject.ClassName

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Returns the owned component count

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

Returns an iterator over the owned components

DesignInfo

Contains information used by the Form designer.

Enabled

Controls whether the timer generates OnTimer events periodically.

Interval

Determines the amount of time, in milliseconds, that passes before the timer component initiates another OnTimer event.

Name

Specifies the name of the component as referenced in code.

Observers

Indicates the TObservers object added to the TComponent.

OnTimer

<Delphi property OnTimer of type TTimer at 211419390D0>

Owner

Returns the Component Owner

Tag

Stores a NativeInt integral value as a part of a component.

VCLComObject

Represents information used internally by components that support COM.

BindMethodsToEvents(prefix)#

Connects methods to component events if they are named using the following pattern: Prefix_ComponentName_EventName. Example: def handle_button1_OnClick(Sender): pass The function returns a list of tuples. Each tuple contains the name of the component, the name of the event and the method object assigned to the event. Note that the prefix parameter is optional and will default to “handle_”.

ComponentCount#

Returns the owned component count

Components#

Returns an iterator over the owned components

Create(AOwner: Component)#

Instantiates a timer object. Call Create to instantiate a timer at runtime. Timers added to forms or data modules at design time are created automatically. AOwner specifies the component, typically a form or data module, that is responsible for freeing the timer.

Destroy()#

Disposes of a timer object. Do not call Destroy directly in an application. Instead, an application should call Free. Free verifies that the timer is not nil before it calls Destroy. Destroy deactivates the timer by setting Enabled to False before freeing the resources required by the timer.

Enabled#

Controls whether the timer generates OnTimer events periodically. Use Enabled to enable or disable the timer. If Enabled is true, the timer responds normally. If Enabled is false, the timer does not generate OnTimer events. The default is true.

GetParentComponent()#

Returns the parent of a component.

HasParent()#

Indicates whether the component has a parent to handle its filing.

Interval#

Determines the amount of time, in milliseconds, that passes before the timer component initiates another OnTimer event. Interval determines how frequently the OnTimer event occurs. Each time the specified interval passes, the OnTimer event occurs. Use Interval to specify any cardinal value as the interval between OnTimer events. The default value is 1000 (one second).

Note: A 0 value is valid, however the timer will not call an OnTimer event for a value of 0.

OnTimer#

<Delphi property OnTimer of type TTimer at 211419390D0>

Owner#

Returns the Component Owner