NovaTK::DropdownListbox Class Reference

Inheritance diagram for NovaTK::DropdownListbox:
Collaboration diagram for NovaTK::DropdownListbox:

List of all members.


Detailed Description

A dropdown listbox presents a text list of options to the user in the form of a list that drops down from the widget. The option that the user selects is displayed within the widget.

Public Member Functions

virtual NOVATKAPI void Clear ()
virtual NOVATKAPI NStatus Create (Window *parent, int c_x, int c_y, int c_width, int c_height)
virtual NOVATKAPI NStatus DeleteItem (uint id)
virtual NOVATKAPI void Destroy ()
virtual NOVATKAPI void Draw ()
virtual NOVATKAPI uint GetCount () const
virtual NOVATKAPI int GetItemID (const NString &name) const
virtual NOVATKAPI const NString GetItemName (uint id) const
virtual NOVATKAPI int GetSelection () const
virtual NOVATKAPI FontGetFont () const
virtual NOVATKAPI ulong GetForegroundColor () const
virtual NOVATKAPI uint InsertItem (const NString &name)
virtual NOVATKAPI void Resize (uint r_width, uint r_height)
virtual NOVATKAPI NStatus SelectItem (int id)
virtual NOVATKAPI NStatus SetItemName (uint id, const NString &name)
virtual NOVATKAPI void SetFont (Font *f)
virtual NOVATKAPI void SetForegroundColor (ulong fgColor)
virtual NOVATKAPI void ShowList ()

Member Function Documentation

void NovaTK::DropdownListbox::Clear (  )  [virtual]

Deletes all items in the dropdown listbox.

NStatus NovaTK::DropdownListbox::Create ( Window parent,
int  c_x,
int  c_y,
int  c_width,
int  c_height 
) [virtual]

This function is used by all widgets for initialization and to specify essential parameters. Each widget will reimplement this function but a few will have different parameters as needed(Such as Label). Most other member functions of all widgets cannot be called before calling this one except generally functions that specify attributes that must be known before creation of the widget.

Parameters:
parent Specifies the parent window.
c_x Specifies the location of the window's top-left corner along the X-axis relative to its parent.
c_y Specifies the location of the window's top-left corner along the Y-axis relative to its parent.
c_width Specifies the width of the window.
c_height Specifies the height of the window.
Returns:
NOVATK_SUCCESS upon successful creation of the widget otherwise returns NOVATK_ERROR_GENERAL_FAILURE.
Note:
By default, the widget has no border. When a widget is given a border, the top-left corner of the border itself will be the window's X and Y position minus its border width. The actual width of the widget with its border will be its width plus the border width and the same for height.

Reimplemented from NovaTK::Widget.

NStatus NovaTK::DropdownListbox::DeleteItem ( uint  id  )  [virtual]

Deletes all items in the listbox

void NovaTK::DropdownListbox::Destroy (  )  [virtual]

Destroys the widget.

Reimplemented from NovaTK::Widget.

void NovaTK::DropdownListbox::Draw (  )  [virtual]

Redraws the widget. This function is called by NovaTK and doesn't normally need to be called outside of the toolkit.

Reimplemented from NovaTK::Widget.

uint NovaTK::DropdownListbox::GetCount (  )  const [virtual]

Returns:
The number of items in the listbox.

int NovaTK::DropdownListbox::GetItemID ( const NString name  )  const [virtual]

Returns:
the ID of the item with a name matching the name parameter. Note that the if more than one item have the same name then the ID of the first(highest in the list) will be returned.

const NString NovaTK::DropdownListbox::GetItemName ( uint  id  )  const [virtual]

Returns:
A string containing the name of the item specified by id. If id is invalid then the string will be empty.

int NovaTK::DropdownListbox::GetSelection (  )  const [virtual]

Returns:
The ID of the selected item or -1 if no item is selected.

Font * NovaTK::DropdownListbox::GetFont (  )  const [virtual]

Note:
This function may be used before creating the widget. It is useful for dynamically determining the size of a widget. HOWEVER, it MAY NOT be used before initializing NovaTK.
Returns:
The primary font used by the widget.

Reimplemented from NovaTK::Widget.

ulong NovaTK::DropdownListbox::GetForegroundColor (  )  const [virtual]

Returns:
The color set as the widget's font foreground color if it draws text.

Reimplemented from NovaTK::Widget.

uint NovaTK::DropdownListbox::InsertItem ( const NString name  )  [virtual]

Inserts an with the specified name to the end of the dropdown listbox.

void NovaTK::DropdownListbox::Resize ( uint  r_width,
uint  r_height 
) [virtual]

Changes the horiztonal size of the widget to r_w and the vertical size of the widget to r_h .

Reimplemented from NovaTK::Widget.

NStatus NovaTK::DropdownListbox::SelectItem ( int  id  )  [virtual]

Selects the item specified by id. If id is -1 then any selected items will be unselected.

Returns:
NOVATK_SUCCESS upon success, NOVATK_ERROR_DOES_NOT_EXIST if id does not refer to a valid item or NOVATK_ERROR_ALREADY_EXISTS if the item is already selected.

NStatus NovaTK::DropdownListbox::SetItemName ( uint  id,
const NString name 
) [virtual]

Changes the name of the item specified by id.

Returns:
NOVATK_SUCCESS upon success or NOVATK_ERROR_DOES_NOT_EXIST if id does not refer to a valid item.

void NovaTK::DropdownListbox::SetFont ( Font f  )  [virtual]

Sets the primary font used by the widget to that specified by f.

Reimplemented from NovaTK::Widget.

void NovaTK::DropdownListbox::SetForegroundColor ( ulong  fgColor  )  [virtual]

Sets the primary foreground color for text used by the widget.

Reimplemented from NovaTK::Widget.

void NovaTK::DropdownListbox::ShowList (  )  [virtual]

Displays the dropdown list of items.


The documentation for this class was generated from the following files:

Generated on Sat Sep 13 22:34:20 2008 for NovaTK by  doxygen 1.5.5