From 4d8ed423f7b4a8eae2898cc5552829595717a581 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 2 Jan 2006 20:59:17 +0000 Subject: TCheckBoxList and TRadioButtonList completed. --- .../quickstart/protected/pages/Controls/List.page | 1 + .../pages/Controls/Samples/TCheckBoxList/Home.page | 105 +++++++++++++++- .../pages/Controls/Samples/TCheckBoxList/Home.php | 34 ++---- .../pages/Controls/Samples/TDropDownList/Home.php | 24 ++-- .../pages/Controls/Samples/TListBox/Home.page | 16 +-- .../Controls/Samples/TRadioButtonList/Home.page | 132 +++++++++++++++++++++ .../Controls/Samples/TRadioButtonList/Home.php | 22 ++++ 7 files changed, 288 insertions(+), 46 deletions(-) create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.page create mode 100644 demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.php (limited to 'demos') diff --git a/demos/quickstart/protected/pages/Controls/List.page b/demos/quickstart/protected/pages/Controls/List.page index f3c4cd96..f70c4368 100644 --- a/demos/quickstart/protected/pages/Controls/List.page +++ b/demos/quickstart/protected/pages/Controls/List.page @@ -21,6 +21,7 @@ List controls covered in this section are all inherit directly or indirectly fro

TRadioButtonList

+

TBulletList

diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.page index 7f8772c8..ac9de17e 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.page @@ -6,10 +6,10 @@ -Check box list with initial items: +Check box list with default settings: - + @@ -20,15 +20,110 @@ Check box list with initial items: -Check box list with initial items: +Check box list with customized cellpadding, cellspacing, color and text alignment: - + - + + + + + + +Check box list with vertical (default) repeat direction: + + + + + + + + + + + + + +Check box list with horizontal repeat direction: + + + + + + + + + + + + + +Check box list with flow layout and vertical (default) repeat direction: + + + + + + + + + + + + + +Check box list with flow layout and horizontal repeat direction: + + + + + + + + + + + + + +Check box list's behavior upon postback: + + + + + + + + + +
+ + + + + + +Auto postback check box list: + + + + + + + + + diff --git a/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.php index 6b1d07e1..3873ca30 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.php +++ b/demos/quickstart/protected/pages/Controls/Samples/TCheckBoxList/Home.php @@ -2,50 +2,34 @@ class Home extends TPage { - public function selectionChanged($sender,$param) - { - $index=$sender->SelectedIndex; - $value=$sender->SelectedValue; - $text=$sender->SelectedItem->Text; - $this->SelectionResult->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; - } - public function buttonClicked($sender,$param) { - $index=$this->ListBox1->SelectedIndex; - $value=$this->ListBox1->SelectedValue; - $text=$this->ListBox1->SelectedItem->Text; - $this->SelectionResult2->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; - } - - public function multiSelectionChanged($sender,$param) - { - $indices=$sender->SelectedIndices; + $indices=$this->CheckBoxList->SelectedIndices; $result=''; foreach($indices as $index) { - $item=$sender->Items[$index]; + $item=$this->CheckBoxList->Items[$index]; $result.="(Index: $index, Value: $item->Value, Text: $item->Text)\n"; } if($result==='') - $this->MultiSelectionResult->Text='Your selection is empty.'; + $this->SelectionResult->Text='Your selection is empty.'; else - $this->MultiSelectionResult->Text='Your selection is: '.$result; + $this->SelectionResult->Text='Your selection is: '.$result; } - public function buttonClicked2($sender,$param) + public function selectionChanged($sender,$param) { - $indices=$this->ListBox2->SelectedIndices; + $indices=$sender->SelectedIndices; $result=''; foreach($indices as $index) { - $item=$this->ListBox2->Items[$index]; + $item=$sender->Items[$index]; $result.="(Index: $index, Value: $item->Value, Text: $item->Text)\n"; } if($result==='') - $this->MultiSelectionResult2->Text='Your selection is empty.'; + $this->SelectionResult2->Text='Your selection is empty.'; else - $this->MultiSelectionResult2->Text='Your selection is: '.$result; + $this->SelectionResult2->Text='Your selection is: '.$result; } } diff --git a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php index 3835d3c3..5dfa3bba 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php +++ b/demos/quickstart/protected/pages/Controls/Samples/TDropDownList/Home.php @@ -4,18 +4,26 @@ class Home extends TPage { public function selectionChanged($sender,$param) { - $index=$sender->SelectedIndex; - $value=$sender->SelectedValue; - $text=$sender->SelectedItem->Text; - $this->SelectionResult->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; + if(($index=$sender->SelectedIndex)>=0) + { + $value=$sender->SelectedValue; + $text=$sender->SelectedItem->Text; + $this->SelectionResult->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; + } + else + $this->SelectionResult->Text="Your selection is empty."; } public function buttonClicked($sender,$param) { - $index=$this->ListBox1->SelectedIndex; - $value=$this->ListBox1->SelectedValue; - $text=$this->ListBox1->SelectedItem->Text; - $this->SelectionResult2->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; + if(($index=$this->ListBox1->SelectedIndex)>=0) + { + $value=$this->ListBox1->SelectedValue; + $text=$this->ListBox1->SelectedItem->Text; + $this->SelectionResult2->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; + } + else + $this->SelectionResult2->Text="Your selection is empty."; } } diff --git a/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.page index 28d0dc1a..f6640879 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.page @@ -122,33 +122,33 @@ List box with initial items: -Auto postback list box: +List box's behavior upon postback: - + - + +
+ -List box's behavior upon postback: +Auto postback list box: - + - -
- + diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.page new file mode 100644 index 00000000..95fea89b --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.page @@ -0,0 +1,132 @@ + + +

TRadioButtonList Samples

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Radio button list with default settings: + + + + + + + +
+Radio button list with customized cellpadding, cellspacing, color and text alignment: + + + + + + + +
+Radio button list with vertical (default) repeat direction: + + + + + + + +
+Radio button list with horizontal repeat direction: + + + + + + + +
+Radio button list with flow layout and vertical (default) repeat direction: + + + + + + + +
+Radio button list with flow layout and horizontal repeat direction: + + + + + + + +
+Radio button list's behavior upon postback: + + + + + + + + +
+ +
+Auto postback radio button list: + + + + + + + + +
+ +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.php new file mode 100644 index 00000000..47d9b23b --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.php @@ -0,0 +1,22 @@ +RadioButtonList->SelectedIndex; + $value=$this->RadioButtonList->SelectedValue; + $text=$this->RadioButtonList->SelectedItem->Text; + $this->SelectionResult->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; + } + + public function selectionChanged($sender,$param) + { + $index=$sender->SelectedIndex; + $value=$sender->SelectedValue; + $text=$sender->SelectedItem->Text; + $this->SelectionResult2->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; + } +} + +?> \ No newline at end of file -- cgit v1.2.3