diff options
author | wei <> | 2006-05-05 08:20:50 +0000 |
---|---|---|
committer | wei <> | 2006-05-05 08:20:50 +0000 |
commit | 4d70cc125dcd915cdbc8c4f13964d27ebec96eca (patch) | |
tree | 3ebd35be9ed02e97a08196817ee330131cf938b4 /tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php | |
parent | 47d05516b1d1c465217c59732bf8442ab0cfd497 (diff) |
Update funky active control example. (see tests/FunctionalTests/features/
Diffstat (limited to 'tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php')
-rw-r--r-- | tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php index e9a6226a..ace6291b 100644 --- a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php +++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php @@ -5,10 +5,32 @@ class ActiveControl extends TPage
{
- public function control1onCallback($sender, $param)
+ static private $_colors = array('red', 'green', 'blue', 'purple','black','orange');
+
+ public function slowResponse($sender, $param)
{
- sleep(5);
+ sleep(3);
$this->label1->setText("The time is ".time()." from ".$sender->ID);
+ $this->label1->setForeColor($this->getColor());
+ $this->label1->renderControl($param->getOutput());
+
+ $this->panel2->setVisible(true);
+ $this->panel1->setBackColor($this->getColor());
+ $this->panel1->renderControl($param->getOutput());
+ $this->getCallbackClient()->shake($this->panel1);
+ }
+
+ public function fastResponse($sender, $param)
+ {
+ $this->label2->setText("Muahaha !!! the time is ".time()." from ".$sender->ID);
+ $style['color'] = $this->getColor();
+ $this->getCallbackClient()->setStyle($this->label2, $style);
+ $this->getCallbackClient()->shake($this->label2);
+ }
+
+ private function getColor()
+ {
+ return self::$_colors[rand(0,count(self::$_colors)-1)];
}
}
?>
|