From 71ca767f51b53d6b162bd6fdccfb125f2dc94d35 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 30 Dec 2005 22:19:07 +0000 Subject: Added TListBox samples. --- .../pages/Controls/Samples/TListBox/Home.page | 121 +++++++++++---------- .../pages/Controls/Samples/TListBox/Home.php | 46 +++++++- 2 files changed, 107 insertions(+), 60 deletions(-) (limited to 'demos/quickstart/protected/pages/Controls') diff --git a/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.page index 43ab16f7..776fc073 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.page +++ b/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.page @@ -1,81 +1,92 @@ -

TTextBox Samples

+

TListBox Samples

-
SingleLine and Password Text Boxes
- -Text box with default settings: - -
- -Password text box: - +
Single Selection List Box
+List box with default settings:
+
-Text box with customized color, font, columns, maximum length: - +List box with initial items:
+ + + + + +
-Disabled text box: - +List box with customized row number, color and font:
+ + + + + +
-Read-only text box: - +Auto postback list box:
+ + + + + + +
-Auto postback text box: - +List box's behavior upon postback:
+ + + + + + + +
- -Text box's behavior upon postback: - - -
-
MultiLine Text Boxes
- -Text box with default settings:
- +
Multiple Selection List Box
+Use Shift + Left Click to change selection
- -Text box with customized dimensions, font and content:
- - -This is a multiline text box. -In HTML, it is displayed as a textarea. - - +List box with default settings:
+
-Disabled text box:
- +List box with initial items:
+ + + + + +
-Read-only text box with text-wrapping disabled:
- +Auto postback list box:
+
+ + + + + + +
+
-Auto postback text box:
- +List box's behavior upon postback:
+ + + + + + +
-
+ +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.php index 5f812c9e..6b1d07e1 100644 --- a/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.php +++ b/demos/quickstart/protected/pages/Controls/Samples/TListBox/Home.php @@ -1,15 +1,51 @@ Text="text changed"; + $index=$sender->SelectedIndex; + $value=$sender->SelectedValue; + $text=$sender->SelectedItem->Text; + $this->SelectionResult->Text="Your selection is (Index: $index, Value: $value, Text: $text)."; } - public function submitText($sender,$param) + public function buttonClicked($sender,$param) { - $this->TextBox1->Text="You just entered '".$this->TextBox1->Text."'."; + $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; + $result=''; + foreach($indices as $index) + { + $item=$sender->Items[$index]; + $result.="(Index: $index, Value: $item->Value, Text: $item->Text)\n"; + } + if($result==='') + $this->MultiSelectionResult->Text='Your selection is empty.'; + else + $this->MultiSelectionResult->Text='Your selection is: '.$result; + } + + public function buttonClicked2($sender,$param) + { + $indices=$this->ListBox2->SelectedIndices; + $result=''; + foreach($indices as $index) + { + $item=$this->ListBox2->Items[$index]; + $result.="(Index: $index, Value: $item->Value, Text: $item->Text)\n"; + } + if($result==='') + $this->MultiSelectionResult2->Text='Your selection is empty.'; + else + $this->MultiSelectionResult2->Text='Your selection is: '.$result; } } -- cgit v1.2.3