From 887da1b3668499821f046665b461aeadb0a9fb2e Mon Sep 17 00:00:00 2001 From: wei <> Date: Sun, 27 Aug 2006 04:18:31 +0000 Subject: Adding TActiveImage and TActiveImageButton --- .../protected/pages/ActiveButtonTest.page | 10 +++---- .../protected/pages/ActiveButtonTest.php | 7 ++++- .../protected/pages/ActiveImageButtonTest.page | 24 ++++++++++++++++ .../protected/pages/ActiveImageButtonTest.php | 31 +++++++++++++++++++++ .../protected/pages/ActivePanelTest.php | 2 +- .../protected/pages/AutoCompleteTest.php | 10 +++---- .../protected/pages/CustomTemplateControlTest.php | 2 +- .../protected/pages/NestedActiveControls.php | 2 +- .../protected/pages/PeriodicCallbackTest.page | 21 -------------- .../protected/pages/PeriodicCallbackTest.php | 27 ------------------ .../protected/pages/TimeTriggeredCallbackTest.page | 21 ++++++++++++++ .../protected/pages/TimeTriggeredCallbackTest.php | 27 ++++++++++++++++++ .../active-controls/protected/pages/group.gif | Bin 0 -> 606 bytes .../active-controls/protected/pages/report.gif | Bin 0 -> 402 bytes 14 files changed, 122 insertions(+), 62 deletions(-) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php delete mode 100644 tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page delete mode 100644 tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/group.gif create mode 100644 tests/FunctionalTests/active-controls/protected/pages/report.gif (limited to 'tests/FunctionalTests/active-controls/protected/pages') diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page index c475f17f..2e192c19 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page @@ -1,11 +1,11 @@ - +

TActiveButton Functional Test

- - + - + - +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php index 6282b804..42322ea1 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php @@ -2,11 +2,16 @@ class ActiveButtonTest extends TPage { + function onLoad($param) + { + new TActiveButton; + } + function button2_onclick($sender, $param) { $this->label1->Text = "Button 1 was clicked "; } - + function button2_oncallback($sender, $param) { $this->label1->Text .= "using callback!"; diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page new file mode 100644 index 00000000..7696261a --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page @@ -0,0 +1,24 @@ + + +

TActiveImageButton Functional Test

+ + This is + OnClick="image1_clicked" /> + an image. + +
+ +
+ + + + OnClick="change_image" /> + + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php new file mode 100644 index 00000000..eced2457 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php @@ -0,0 +1,31 @@ +image1->AlternateText = "Muahahahah"; + } + + function change_image($sender, $param) + { + $this->image1->ImageUrl = $sender->CustomData; + } + + function change_align($sender, $param) + { + $this->image1->ImageAlign="absbottom"; + } + + function change_description($sender, $param) + { + $this->image1->DescriptionUrl = "maahahhaa"; + } + + function image1_clicked($sender, $param) + { + $this->label1->Text = "Image clicked at x={$param->x}, y={$param->y}"; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php index 8a0a4316..b29f8920 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php +++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php @@ -5,7 +5,7 @@ class ActivePanelTest extends TPage function callback1_requested($sender, $param) { $this->content1->visible = true; - $this->panel1->render($param->output); + $this->panel1->render($param->NewWriter); } } diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php index df314891..21f61abe 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php +++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php @@ -9,15 +9,15 @@ class AutoCompleteTest extends TPage { $sender->setDataSource($this->matchCountries($param->getParameter())); $sender->dataBind(); - $sender->flush($param->getOutput()); + $sender->render($param->getNewWriter()); $this->label1->Text = "suggestion for ".$param->getParameter(); } - + public function callback_requested($sender, $param) { $this->label1->Text = "Label 1: ".$this->textbox3->Text; } - + protected function matchCountries($token) { $info = Prado::createComponent('System.I18N.core.CultureInfo', 'en'); @@ -31,9 +31,9 @@ class AutoCompleteTest extends TPage $list[] = $country; $count++; if($count > 10) break; - } + } } - return $list; + return $list; } } diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php index 753de25c..18005a2b 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php +++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php @@ -16,7 +16,7 @@ class CustomTemplateControlTest extends TPage function button2_callback($sender, $param) { - $this->placeholder->render($param->output); + $this->placeholder->render($param->NewWriter); $this->label1->Text .= " using callback!"; $this->label1->Text .= "... and this is the textbox text: ". $this->foo->Text; diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php index 4c6190ee..76b77ff7 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php +++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php @@ -5,7 +5,7 @@ class NestedActiveControls extends TPage function callback1_requested($sender, $param) { $this->content1->visible = true; - $this->panel1->render($param->output); + $this->panel1->render($param->NewWriter); } function button1_clicked($sender, $param) diff --git a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page deleted file mode 100644 index bbc12862..00000000 --- a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page +++ /dev/null @@ -1,21 +0,0 @@ - -

TPeriodicCallback + ViewState Tests

- - -
- -
- - - - - -
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php b/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php deleted file mode 100644 index 13633a00..00000000 --- a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php +++ /dev/null @@ -1,27 +0,0 @@ -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; - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page new file mode 100644 index 00000000..36b3bc05 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page @@ -0,0 +1,21 @@ + +

TTimeTriggeredCallback + ViewState Tests

+ + +
+ +
+ + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.php b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.php new file mode 100644 index 00000000..788857f8 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.php @@ -0,0 +1,27 @@ +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; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/group.gif b/tests/FunctionalTests/active-controls/protected/pages/group.gif new file mode 100644 index 00000000..89c577f7 Binary files /dev/null and b/tests/FunctionalTests/active-controls/protected/pages/group.gif differ diff --git a/tests/FunctionalTests/active-controls/protected/pages/report.gif b/tests/FunctionalTests/active-controls/protected/pages/report.gif new file mode 100644 index 00000000..f7169762 Binary files /dev/null and b/tests/FunctionalTests/active-controls/protected/pages/report.gif differ -- cgit v1.2.3