From 4d70cc125dcd915cdbc8c4f13964d27ebec96eca Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 5 May 2006 08:20:50 +0000 Subject: Update funky active control example. (see tests/FunctionalTests/features/ --- .../pages/ActiveControls/ActiveControl.php | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php') 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)]; } } ?> -- cgit v1.2.3