Defines a timer.
Attribute | Description | Type | Default | Options | Use |
---|---|---|---|---|---|
start-time | Initial time given in milliseconds | xs:integer | optional | ||
stop-time | Ending time given in milliseconds | xs:integer | optional |
Action | Description |
---|---|
reset | Resets a timer |
start | Starts counting time |
stop | Stops the clock |
Property | Description | Type | Access |
---|---|---|---|
start-time | Initial time given in milliseconds | xs:integer | read/write |
stop-time | Ending time given in milliseconds | xs:integer | read/write |
Event | Description |
---|---|
finished | The event is sent when the time limit is reached |
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
xmlns:widget="http://www.volantis.com/xmlns/2006/05/widget">
<head>
<title>widget:timer</title>
<style type="text/css">
#myTimer {
mcs-datetime-format: '%d%18/7/121%i%1%s';
}
</style>
</head>
<body>
<widget:timer id="myTimer" start-time="180000" stop-time="0"/>
<div>
<widget:button action="myTimer#start">Start</widget:button>
<widget:button action="myTimer#stop">Stop</widget:button>
<widget:button action="myTimer#reset">Reset</widget:button>
</div>
<div>
<span>Start time:</span>
<widget:input property="myTimer#start-time"/>
<span>Stop time:</span>
<widget:input property="myTimer#stop-time"/>
</div>
</body>
</html>