MyGUI 3.0.1
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions
MyGUI::ComboBox Class Reference

#include <MyGUI_ComboBox.h>

Inheritance diagram for MyGUI::ComboBox:

Public Types

typedef RTTIBase Base
typedef ComboBox RTTIBase

Public Member Functions

virtual const std::string & getTypeName () const
virtual bool isType (const std::type_info &_type) const
template<typename Type >
bool isType () const
 ComboBox ()
size_t getItemCount () const
 Get number of items.
void insertItemAt (size_t _index, const UString &_name, Any _data=Any::Null)
 Insert an item into a array at a specified position.
void addItem (const UString &_name, Any _data=Any::Null)
 Add an item to the end of a array.
void removeItemAt (size_t _index)
 Remove item at a specified position.
void removeAllItems ()
 Remove all items.
size_t findItemIndexWith (const UString &_name)
 Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
size_t getIndexSelected ()
 Get index of selected item (ITEM_NONE if none selected)
void setIndexSelected (size_t _index)
 Select specified _index.
void clearIndexSelected ()
 Clear item selection.
void setItemDataAt (size_t _index, Any _data)
 Replace an item data at a specified position.
void clearItemDataAt (size_t _index)
 Clear an item data at a specified position.
template<typename ValueType >
ValueType * getItemDataAt (size_t _index, bool _throw=true)
 Get item data from specified position.
void setItemNameAt (size_t _index, const UString &_name)
 Replace an item name at a specified position.
const UStringgetItemNameAt (size_t _index)
 Get item name from specified position.
void beginToItemAt (size_t _index)
 Move all elements so specified becomes visible.
void beginToItemFirst ()
 Move all elements so first becomes visible.
void beginToItemLast ()
 Move all elements so last becomes visible.
void beginToItemSelected ()
 Move all elements so selected becomes visible.
void setComboModeDrop (bool _value)
 Set drop list mode (text can not be edited)
bool getComboModeDrop ()
 Get drop list mode flag.
void setSmoothShow (bool _value)
 Set smooth show of list.
bool getSmoothShow ()
 Get smooth show of list flag.
void setMaxListHeight (int _value)
 Get max list height.
int getMaxListHeight ()
 Set max list height.
virtual void setProperty (const std::string &_key, const std::string &_value)
virtual void _initialise (WidgetStyle _style, const IntCoord &_coord, Align _align, ResourceSkin *_info, Widget *_parent, ICroppedRectangle *_croppedParent, IWidgetCreator *_creator, const std::string &_name)
size_t getItemIndexSelected ()
void setItemSelectedAt (size_t _index)
void clearItemSelected ()
void insertItem (size_t _index, const UString &_name)
void setItem (size_t _index, const UString &_item)
const UStringgetItem (size_t _index)
void deleteItem (size_t _index)
void deleteAllItems ()
size_t getItemSelect ()
void resetItemSelect ()
void setItemSelect (size_t _index)

Static Public Member Functions

static const std::string & getClassTypeName ()

Data Fields

EventPair
< EventHandle_WidgetVoid,
EventHandle_ComboBoxPtrSizeT
eventComboAccept
EventPair
< EventHandle_WidgetSizeT,
EventHandle_ComboBoxPtrSizeT
eventComboChangePosition

Protected Member Functions

virtual ~ComboBox ()
virtual void onKeyButtonPressed (KeyCode _key, Char _char)
virtual void baseChangeWidgetSkin (ResourceSkin *_info)

Detailed Description

Definition at line 38 of file MyGUI_ComboBox.h.


Member Typedef Documentation

Reimplemented from MyGUI::Edit.

Definition at line 41 of file MyGUI_ComboBox.h.

Reimplemented from MyGUI::Edit.

Definition at line 41 of file MyGUI_ComboBox.h.


Constructor & Destructor Documentation

MyGUI::ComboBox::ComboBox ( )

Definition at line 41 of file MyGUI_ComboBox.cpp.

MyGUI::ComboBox::~ComboBox ( ) [protected, virtual]

Definition at line 61 of file MyGUI_ComboBox.cpp.


Member Function Documentation

void MyGUI::ComboBox::_initialise ( WidgetStyle  _style,
const IntCoord _coord,
Align  _align,
ResourceSkin _info,
Widget _parent,
ICroppedRectangle _croppedParent,
IWidgetCreator _creator,
const std::string &  _name 
) [virtual]

Reimplemented from MyGUI::Edit.

Definition at line 54 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::addItem ( const UString _name,
Any  _data = Any::Null 
) [inline]

Add an item to the end of a array.

Definition at line 56 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::baseChangeWidgetSkin ( ResourceSkin _info) [protected, virtual]

Reimplemented from MyGUI::Edit.

Definition at line 66 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::beginToItemAt ( size_t  _index) [inline]

Move all elements so specified becomes visible.

Definition at line 113 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::beginToItemFirst ( ) [inline]

Move all elements so first becomes visible.

Definition at line 116 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::beginToItemLast ( ) [inline]

Move all elements so last becomes visible.

Definition at line 119 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::beginToItemSelected ( ) [inline]

Move all elements so selected becomes visible.

Definition at line 122 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::clearIndexSelected ( ) [inline]

Clear item selection.

Definition at line 79 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::clearItemDataAt ( size_t  _index) [inline]

Clear an item data at a specified position.

Definition at line 89 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::clearItemSelected ( ) [inline]
Deprecated:
"use : void ComboBox::clearIndexSelected()"

Definition at line 173 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::deleteAllItems ( ) [inline]
Deprecated:
"use : void ComboBox::removeAllItems()"

Definition at line 184 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::deleteItem ( size_t  _index) [inline]
Deprecated:
"use : void ComboBox::removeItemAt(size_t _index)"

Definition at line 182 of file MyGUI_ComboBox.h.

size_t MyGUI::ComboBox::findItemIndexWith ( const UString _name)

Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.

Definition at line 421 of file MyGUI_ComboBox.cpp.

static const std::string& MyGUI::ComboBox::getClassTypeName ( ) [inline, static]

Reimplemented from MyGUI::Edit.

Definition at line 41 of file MyGUI_ComboBox.h.

bool MyGUI::ComboBox::getComboModeDrop ( ) [inline]

Get drop list mode flag.

Definition at line 131 of file MyGUI_ComboBox.h.

size_t MyGUI::ComboBox::getIndexSelected ( ) [inline]

Get index of selected item (ITEM_NONE if none selected)

Definition at line 73 of file MyGUI_ComboBox.h.

const UString& MyGUI::ComboBox::getItem ( size_t  _index) [inline]
Deprecated:
"use : const UString& ComboBox::getItemNameAt(size_t _index)"

Definition at line 180 of file MyGUI_ComboBox.h.

size_t MyGUI::ComboBox::getItemCount ( ) const [inline]

Get number of items.

Definition at line 50 of file MyGUI_ComboBox.h.

template<typename ValueType >
ValueType* MyGUI::ComboBox::getItemDataAt ( size_t  _index,
bool  _throw = true 
) [inline]

Get item data from specified position.

Definition at line 93 of file MyGUI_ComboBox.h.

size_t MyGUI::ComboBox::getItemIndexSelected ( ) [inline]
Deprecated:
"use : size_t ComboBox::getIndexSelected()"

Definition at line 169 of file MyGUI_ComboBox.h.

const UString& MyGUI::ComboBox::getItemNameAt ( size_t  _index) [inline]

Get item name from specified position.

Definition at line 106 of file MyGUI_ComboBox.h.

size_t MyGUI::ComboBox::getItemSelect ( ) [inline]
Deprecated:
"use : size_t ComboBox::getIndexSelected()"

Definition at line 186 of file MyGUI_ComboBox.h.

int MyGUI::ComboBox::getMaxListHeight ( ) [inline]

Set max list height.

Definition at line 141 of file MyGUI_ComboBox.h.

bool MyGUI::ComboBox::getSmoothShow ( ) [inline]

Get smooth show of list flag.

Definition at line 136 of file MyGUI_ComboBox.h.

virtual const std::string& MyGUI::ComboBox::getTypeName ( ) const [inline, virtual]

Get type name as string

Reimplemented from MyGUI::Edit.

Definition at line 41 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::insertItem ( size_t  _index,
const UString _name 
) [inline]
Deprecated:
"use : void ComboBox::insertItemAt(size_t _index, const UString& _name)"

Definition at line 176 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::insertItemAt ( size_t  _index,
const UString _name,
Any  _data = Any::Null 
)

Insert an item into a array at a specified position.

Definition at line 383 of file MyGUI_ComboBox.cpp.

template<typename Type >
bool MyGUI::ComboBox::isType ( ) const [inline]

Compare with selected type

Reimplemented from MyGUI::Edit.

Definition at line 41 of file MyGUI_ComboBox.h.

virtual bool MyGUI::ComboBox::isType ( const std::type_info &  _type) const [inline, virtual]

Compare with selected type

Reimplemented from MyGUI::Edit.

Definition at line 41 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::onKeyButtonPressed ( KeyCode  _key,
Char  _char 
) [protected, virtual]

Reimplemented from MyGUI::Edit.

Definition at line 202 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::removeAllItems ( )

Remove all items.

Definition at line 397 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::removeItemAt ( size_t  _index)

Remove item at a specified position.

Definition at line 390 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::resetItemSelect ( ) [inline]
Deprecated:
"use : void void ComboBox::clearIndexSelected()"

Definition at line 188 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::setComboModeDrop ( bool  _value)

Set drop list mode (text can not be edited)

Definition at line 403 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::setIndexSelected ( size_t  _index)

Select specified _index.

Definition at line 355 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::setItem ( size_t  _index,
const UString _item 
) [inline]
Deprecated:
"use : void ComboBox::setItemNameAt(size_t _index, const UString& _name)"

Definition at line 178 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::setItemDataAt ( size_t  _index,
Any  _data 
)

Replace an item data at a specified position.

Definition at line 376 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::setItemNameAt ( size_t  _index,
const UString _name 
)

Replace an item name at a specified position.

Definition at line 369 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::setItemSelect ( size_t  _index) [inline]
Deprecated:
"use : void ComboBox::setIndexSelected(size_t _index)"

Definition at line 190 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::setItemSelectedAt ( size_t  _index) [inline]
Deprecated:
"use : void ComboBox::setIndexSelected(size_t _index)"

Definition at line 171 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::setMaxListHeight ( int  _value) [inline]

Get max list height.

Definition at line 139 of file MyGUI_ComboBox.h.

void MyGUI::ComboBox::setProperty ( const std::string &  _key,
const std::string &  _value 
) [virtual]

Set any widget property

Parameters:
_keyProperty name (for example Widget_Alpha or Edit_MultiLine)
_valueValue converted to string

Reimplemented from MyGUI::Edit.

Definition at line 426 of file MyGUI_ComboBox.cpp.

void MyGUI::ComboBox::setSmoothShow ( bool  _value) [inline]

Set smooth show of list.

Definition at line 134 of file MyGUI_ComboBox.h.


Field Documentation

Event : Enter pressed in combo mode or item selected in drop.
signature : void method(MyGUI::ComboBox* _sender, size_t _index)

Parameters:
_senderwidget that called this event
_indexitem

Definition at line 152 of file MyGUI_ComboBox.h.

Event : Position changed.
signature : void method(MyGUI::ComboBox* _sender, size_t _index)

Parameters:
_senderwidget that called this event
_indexof new position

Definition at line 159 of file MyGUI_ComboBox.h.


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