Rx Timer List

RX Library

Control Name Unit Class
RX Timer List TimerLst TRxTimerEvent

Description:
This component intend for storage of the event of TRxTimerList events queue. TRxTimerEvent have the same properties as TTimer: Enabled, Interval, OnTimer. Additional event may be "single" - stand inactive after one execute of OnTimer (it action depend on Cycled property value).


Class TRxTimerList
The TRxTimerList component provides all the functions of the standard TTimer component, plus the additional benefit of using only one Windows timer for up to 32767 timing events. The practical maximum number of timing events depends on how long it takes your application to service each timer notification.

Windows (system) timers are a scarce system resource, especially if 16-bit application. Using more system timers than necessary can impact performance. If a (system) timer is not available when a program needs one, it can either terminate gracefully or it can terminate in a manner that leaves Windows in an unstable state. You can reduce the chances of running out of timers by using a TRxTimerList rather than multiple timers.

TRxTimerList uses the concept of a timer events to perform the same function as the TTimer's OnTimer event. After adding a TRxTimerList component to your form, use component editor to create events at design-time, or call Add method at run-time to create timer events dinamically. Events can repeat until they are canceled or they can be fired only once and then automatically removed (accordingly Cycled property value).


Property Active
Declaration: Active: Boolean;

The Active property controls whether the timer's should respond to timer events.


Property Count
Declaration: Count: Integer;

Count returns the total number of timer events. The number returned by Count includes both enabled and disabled timers.


Property EnabledCount
Declaration: EnabledCount: Integer;

EnabledCount returns the number of enabled timer events (which Enabled property is True).


Property Events
Declaration: Events: TList;

List included pointers to events defined by class TRxTimerEvent. Property intend for internal use. In components work time events order in this list may be changed. You can use for access to events data method ItemByHandle and for dynamic add a new events method Add.


Event OnFinish
Declaration: OnFinish: TNotifyEvent;

This is triggered when an event has been completed.


Event OnTimers
Declaration: OnTimers: TAllTimersEvent;

The OnTimers defines an event handler that is called for each timer events.


Method Activate
Declaration: procedure Activate;

Activate and Deactivate methods controls whether the timer's responds to timer events.
Call Activate to set the Active property for the timer list to True.


Method Add
Declaration: function Add(AOnTimer: TNotifyEvent; AInterval: Longint; ACycled: Boolean): Longint;

You can use this method to add new event.

Parameters AOnTimer, AInterval and ACycled contained values of properties OnTimer, Interval

and Cycled accordingly for new event. Handle of this event returned as method result.


Method Clear
Declaration: procedure Clear;
This method removes all events from the list.


Method Deactivate
Declaration: procedure Deactivate;

Activate and Deactivate methods controls whether the timer's responds to timer events.
Call Deactivate to set the Active property for the timer list to False.


Method Delete
Declaration:

procedure Delete(AHandle: Longint);

Method removes event specified by Handle from the list.


Method ItemByHandle
Declaration: function ItemByHandle(AHandle: Longint): TRxTimerEvent;

This returns the handle to the event by ordinal number.

In Simple English:
This converts a "handle to the event" to the actual event.


Type TAllTimersEvent
Declaration: TAllTimersEvent = procedure(Sender: TObject; Handle: Longint) of object;

TAllTimersEvent is the type of the OnTimers event of the TRxTimerList component.


Property AsSeconds
Declaration: AsSeconds: Word;

This is conversion property. AsSecond can be used to read or set the value of Interval property in seconds.


Property Cycled
Declaration: Cycled: Boolean;

Set the Active property to True to define what event to occur whenever a specified period of time passes. You use the Interval property to control the amount of time between timer events (in milliseconds). You can not use RepeatCount property anyhow. Set the Active property to False to define what event to occur only one time and after it Enabled property has been False value.

You can use RepeatCount to define number of occured times. You can use ExecCount

property for definition of the times occured events after execute TRxTimerList.


Property ExecCount
Declaration: ExecCount: Integer;

Run-time and read only. Property stored number of occured times after execute Activate method of TRxTimerList. When Active property of TRxTimerList set in False then value of ExecCount is equal to zero.


Property Handle
Declaration: Handle: Integer;

Run-time and read only. The Handle property provides access to the event by unique identificator.


Property RepeatCount
Declaration: RepeatCount: Integer;

Property stored number of times what need occur event whenever a specified period of time passes after execute Activate method of TRxTimerList. After it property Enabled has been False value.

Value of this property must be more greater or equal 1. May be used only when Cycled property value is False.

You can use ExecCount property for definition of the times occured events after execute TRxTimerList.


Property TimerList
Declaration: TimerList: TRxTimerList;

This contains a "List of events"


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000