summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php
blob: 13633a0016617039b1a7472cdfec53fda6a4fac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

class PeriodicCallbackTest extends TPage
{
	function start_timer($sender, $param)
	{
		$this->timer1->startTimer();
		$this->setViewState('count', 0);
	}

	function stop_timer($sender, $param)
	{
		$this->timer1->stopTimer();
	}

	function tick($sender, $param)
	{
		$count = intval($this->getViewState('count'));
		$this->setViewState('count', ++$count);
		if($count > 10)
			$this->timer1->stopTimer();
		else
			$this->label1->Text .= " ".$count;
	}
}

?>