Rocket::Controls::WidgetDropDown Class Reference

#include <WidgetDropDown.h>

Inheritance diagram for Rocket::Controls::WidgetDropDown:
Collaboration diagram for Rocket::Controls::WidgetDropDown:

Public Member Functions

 WidgetDropDown (ElementFormControl *element)
void OnRender ()
 Updates the selection box layout if necessary.
void OnLayout ()
 Positions the drop-down's internal elements.
void SetValue (const Rocket::Core::String &value)
const Rocket::Core::StringGetValue () const
void SetSelection (int selection, bool force=false)
int GetSelection () const
int AddOption (const Rocket::Core::String &rml, const Rocket::Core::String &value, int before, bool select, bool selectable=true)
void RemoveOption (int index)
void ClearOptions ()
 Removes all options from the list.
SelectOptionGetOption (int index)
int GetNumOptions () const
virtual void ProcessEvent (Core::Event &event)
 Processes the incoming event.

Detailed Description

Widget for drop-down functionality.
Author:
Lloyd Weehuizen

Member Function Documentation

void Rocket::Controls::WidgetDropDown::SetValue ( const Rocket::Core::String value  ) 

Sets the value of the widget.

Parameters:
[in] value The new value to set.

const Rocket::Core::String & Rocket::Controls::WidgetDropDown::GetValue (  )  const

Returns the current value of the widget.

Returns:
The current value of the widget.

void Rocket::Controls::WidgetDropDown::SetSelection ( int  selection,
bool  force = false 
)

Sets the index of the selection. If the new index lies outside of the bounds, the selection index will be set to -1.

Parameters:
[in] selection The new selection index.
[in] force Forces the new selection, even if the widget believes the selection to not have changed.

int Rocket::Controls::WidgetDropDown::GetSelection (  )  const

Returns the index of the currently selected item.

Returns:
The index of the currently selected item.

int Rocket::Controls::WidgetDropDown::AddOption ( const Rocket::Core::String rml,
const Rocket::Core::String value,
int  before,
bool  select,
bool  selectable = true 
)

Adds a new option to the select control.

Parameters:
[in] rml The RML content used to represent the option.
[in] value The value of the option.
[in] before The index of the element to insert the new option before.
[in] select True to select the new option.
[in] selectable If true this option can be selected. If false, this option is not selectable.
Returns:
The index of the new option.

void Rocket::Controls::WidgetDropDown::RemoveOption ( int  index  ) 

Removes an option from the select control.

Parameters:
[in] index The index of the option to remove.

SelectOption * Rocket::Controls::WidgetDropDown::GetOption ( int  index  ) 

Returns on of the widget's options.

Parameters:
[in] The index of the desired option.
Returns:
The option. This may be NULL if the index was out of bounds.

int Rocket::Controls::WidgetDropDown::GetNumOptions (  )  const

Returns the number of options in the widget.

Returns:
The number of options.


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