Please enable JavaScript to view this site.

CWT User Interface Design Handbook

Navigation: STN controls

Timer (STN)

Scroll Prev Top Next More

<Stn:Timer Name="AcceptTimer" >

Description

The Timer control can be used to automate certain steps in the user interface. Several timer objects can be defined in each panel or pop up panel with different properties. The timer object will execute the defined timeout handler when the defined timeout expires. It is also possible to define property properties on the timer to pass information to the timeout event handler.

All timer objects in a panel or pop up panel are started when the panel or pop up panel is displayed on the screen. The timers will be restarted as soon as any update occurs in the panel or pop up panel. This means that the timers will be restarted every time a coin is inserted

 

Properties

IndexProperty

Type:Integer
Description:Used in combination with the timeout event handler to specify the behavior of the timer. IndexParmeter is a generic integer property that has different uses depending on the timeout event specified.

Name

Type:A string of one or more characters
Description:The name of the timer object. The name must be unique within a panel or popup.

RestartOnParentUpdate

Boolean:true, false

Set the property to true if the timer shall be reset every time the same panel is refreshed. If the property is set to false the timer will be started when the parent panel is displayed but not restarted every time the parent panel is updated (without switching panel).

Timeout

Type:Unsigned integer
Description:A timeout in seconds before the timer fires.

TimeoutEvent

Type:A valid timeout event handler
Description:The TimeoutEvent assigns a timeout event handler to the timer object to define the action to be executed when the timer fire.

The valid timeout event handlers are:

OnAccept

OnReject

ValueProperty

Type:A string of any length
Description:Used in combination with the TimeoutEvent property to specify the button's behaviour when pressed. ValueProperty is a generic string that has different uses depending on the timeout event specified.

Example

Below is an example set up of a timer object that accepts the purchase after 20 second after the last update of the parent panel.

<Stn:Timer Name="AcceptTimer" TimeoutEvent="OnAccept" Timeout="20"
  RestartOnParentUpdate="true"/>