Class Select

Description

Instances of this class represent a selectable user interface object that displays a list of strings and issues notification when a string selected.

Widget
   |
   --Control
      |
      --Select
Method Summary
Select Select (Composite &$parent)
void add (string $text, [integer $index = -1])
string get_item (integer $index)
string[] get_items ()
integer get_item_count ()
string get_selected_item ()
integer get_selection_index ()
void remove_all ()
void set_item (integer $index, string $text)
void set_items (string[] $items)
void set_selection (integer $index)
Methods
Constructor Select

Constructs a new instance of this class given its parent.

Select Select (Composite &$parent)
  • Composite &$parent: a composite control which will be the parent of the new instance (cannot be null)
add

Adds the argument to the receiver's list at the given zero-relative index.

If the index argument is omitted, the item is added at the end of the list.

void add (string $text, [integer $index = -1])
  • string $text: the new item
  • integer $index: the optional index for the item
get_item

Returns the item at the given, zero-relative index in the receiver.

  • return: the item at the given index
string get_item (integer $index)
  • integer $index: - the index of the item to return
get_items

Returns an array of Strings which are the items in the receiver.

  • return: the items in the receiver's list
string[] get_items ()
get_item_count

Returns the number of items contained in the receiver.

  • return: the number of items
integer get_item_count ()
get_selected_item

Returns the item which is currently selected in the receiver, or and empty string if no item is selected.

  • return: the selected item
string get_selected_item ()
get_selection_index

Returns the zero-relative index of the item which is currently selected in the receiver, or -1 if no item is selected.

  • return: the index of the selected item
integer get_selection_index ()
remove_all

Removes all of the items from the receiver.

void remove_all ()
set_item

Sets the text of the item in the receiver's list at the given zero-relative index to the string argument.

void set_item (integer $index, string $text)
  • integer $index: the index for the item
  • string $text: the new text for the item
set_items

Sets the receiver's list to be the given array of items.

void set_items (string[] $items)
  • string[] $items: the array of items
set_selection

Selects the item at the given zero-relative index in the receiver.

void set_selection (integer $index)
  • integer $index: the index of the item to select

Inherited Methods

Inherited From Control

Control::Control()
Control::add_selection_listener()
Control::force_focus()
Control::get_layout_data()
Control::remove_selection_listener()
Control::set_background()
Control::set_bounds()
Control::set_foreground()
Control::set_layout_data()
Control::set_size()

Inherited From Widget

Widget::Widget()
Widget::dispose()
Widget::get_attribute()
Widget::get_attributes()
Widget::get_style()
Widget::is_disposed()
Widget::paint()
Widget::set_attribute()
Widget::set_style()
Widget::show()
Widget::update()

Documentation generated on Wed, 2 Feb 2005 09:33:51 +0100 by phpDocumentor 1.3.0RC3