Class Combo

Description

Instances of this class are controls that allow the user to choose an item from a list of items, or optionally enter a new value by typing it into an editable text field.

Widget
   |
   --Control
      |
      --Combo
Method Summary
Combo Combo (Composite &$parent)
void add (string $text, [integer $index = -1])
string get_item (integer $index)
string[] get_items ()
integer get_selection_index ()
string get_text ()
void remove_all ()
void select (integer $index)
void set_size (integer $width, integer $height)
void set_text (mixed $text)
void set_text_limit (integer $limit)
void set_visible_item_count (integer $count)
Methods
Constructor Combo

Constructs a new instance of this class giving it's parent.

Combo Combo (Composite &$parent)
  • Composite &$parent: - a composite control which will be the parent of the new instance
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_selection_index

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

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

Returns a string containing a copy of the contents of the receiver's text field.

  • return: the receiver's text
string get_text ()
get_visible_item_count

Gets the number of items that are visible in the drop down portion of the receiver's list.

  • return: the number of items that are visible
integer get_visible_item_count ()
remove_all

Removes all of the items from the receiver.

void remove_all ()
select

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

If the item at the index was already selected, it remains selected. Indices that are out of range are ignored.

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

Sets the receiver's size as specified by the arguments.

Note: the width and height values are expressed in columns and rows rather than pixels.

void set_size (integer $width, integer $height)
  • integer $width: the new width for the receiver
  • integer $height: the new height for the receiver
set_text

Sets the contents of the receiver to the given string.

  • access: public
void set_text (mixed $text)
set_text_limit

Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument.

void set_text_limit (integer $limit)
  • integer $limit: new text limit
set_visible_item_count

Sets the number of items that are visible in the drop down portion of the receiver's list.

void set_visible_item_count (integer $count)
  • integer $count: the new number of items to be visible

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:49 +0100 by phpDocumentor 1.3.0RC3