MyGUI
3.0.1
|
#include <MyGUI_List.h>
Public Types | |
typedef RTTIBase | Base |
typedef List | 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 |
List () | |
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. | |
void | swapItemsAt (size_t _index1, size_t _index2) |
Swap items at a specified positions. | |
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 () |
void | setIndexSelected (size_t _index) |
void | clearIndexSelected () |
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 UString & | getItemNameAt (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. | |
bool | isItemVisibleAt (size_t _index, bool _fill=true) |
bool | isItemSelectedVisible (bool _fill=true) |
Same as List::isItemVisible for selected item. | |
void | setScrollVisible (bool _visible) |
Set scroll visible when it needed. | |
void | setScrollPosition (size_t _position) |
Set scroll position. | |
virtual void | setPosition (const IntPoint &_value) |
| |
virtual void | setSize (const IntSize &_value) |
| |
virtual void | setCoord (const IntCoord &_value) |
| |
void | setPosition (int _left, int _top) |
| |
void | setSize (int _width, int _height) |
| |
void | setCoord (int _left, int _top, int _width, int _height) |
| |
int | getOptimalHeight () |
Return optimal height to fit all items in List. | |
virtual void | setProperty (const std::string &_key, const std::string &_value) |
| |
void | _checkAlign () |
void | _setItemFocus (size_t _position, bool _focus) |
void | _sendEventChangeScroll (size_t _position) |
virtual void | _initialise (WidgetStyle _style, const IntCoord &_coord, Align _align, ResourceSkin *_info, Widget *_parent, ICroppedRectangle *_croppedParent, IWidgetCreator *_creator, const std::string &_name) |
void | setPosition (const IntCoord &_coord) |
void | setPosition (int _left, int _top, int _width, int _height) |
size_t | getItemIndexSelected () |
void | setItemSelectedAt (size_t _index) |
void | clearItemSelected () |
void | insertItem (size_t _index, const UString &_item) |
void | setItem (size_t _index, const UString &_item) |
const UString & | getItem (size_t _index) |
void | deleteItem (size_t _index) |
void | deleteAllItems () |
size_t | findItem (const UString &_item) |
size_t | getItemSelect () |
void | resetItemSelect () |
void | setItemSelect (size_t _index) |
void | beginToIndex (size_t _index) |
void | beginToStart () |
void | beginToEnd () |
void | beginToSelect () |
bool | isItemVisible (size_t _index, bool _fill=true) |
bool | isItemSelectVisible (bool _fill=true) |
Static Public Member Functions | |
static const std::string & | getClassTypeName () |
Data Fields | |
EventPair < EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > | eventListSelectAccept |
EventPair < EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > | eventListChangePosition |
EventPair < EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > | eventListMouseItemActivate |
EventPair < EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > | eventListMouseItemFocus |
EventPair < EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > | eventListChangeScroll |
Protected Member Functions | |
virtual | ~List () |
void | baseChangeWidgetSkin (ResourceSkin *_info) |
void | onMouseWheel (int _rel) |
void | onKeyLostFocus (Widget *_new) |
void | onKeySetFocus (Widget *_old) |
void | onKeyButtonPressed (KeyCode _key, Char _char) |
void | notifyScrollChangePosition (VScroll *_sender, size_t _rel) |
void | notifyMousePressed (Widget *_sender, int _left, int _top, MouseButton _id) |
void | notifyMouseDoubleClick (Widget *_sender) |
void | notifyMouseWheel (Widget *_sender, int _rel) |
void | notifyMouseSetFocus (Widget *_sender, Widget *_old) |
void | notifyMouseLostFocus (Widget *_sender, Widget *_new) |
void | updateScroll () |
void | updateLine (bool _reset=false) |
void | _setScrollView (size_t _position) |
void | _redrawItemRange (size_t _start=0) |
void | _redrawItem (size_t _index) |
void | _selectIndex (size_t _index, bool _select) |
void | _updateState () |
Definition at line 36 of file MyGUI_List.h.
typedef RTTIBase MyGUI::List::Base |
Definition at line 39 of file MyGUI_List.h.
typedef List MyGUI::List::RTTIBase |
Reimplemented from MyGUI::Widget.
Definition at line 39 of file MyGUI_List.h.
Definition at line 33 of file MyGUI_List.cpp.
MyGUI::List::~List | ( | ) | [protected, virtual] |
Definition at line 54 of file MyGUI_List.cpp.
void MyGUI::List::_checkAlign | ( | ) |
Definition at line 914 of file MyGUI_List.cpp.
void MyGUI::List::_initialise | ( | WidgetStyle | _style, |
const IntCoord & | _coord, | ||
Align | _align, | ||
ResourceSkin * | _info, | ||
Widget * | _parent, | ||
ICroppedRectangle * | _croppedParent, | ||
IWidgetCreator * | _creator, | ||
const std::string & | _name | ||
) | [virtual] |
Reimplemented from MyGUI::Widget.
Definition at line 47 of file MyGUI_List.cpp.
void MyGUI::List::_redrawItem | ( | size_t | _index | ) | [protected] |
Definition at line 536 of file MyGUI_List.cpp.
void MyGUI::List::_redrawItemRange | ( | size_t | _start = 0 | ) | [protected] |
Definition at line 484 of file MyGUI_List.cpp.
void MyGUI::List::_selectIndex | ( | size_t | _index, |
bool | _select | ||
) | [protected] |
Definition at line 693 of file MyGUI_List.cpp.
void MyGUI::List::_sendEventChangeScroll | ( | size_t | _position | ) |
Definition at line 880 of file MyGUI_List.cpp.
void MyGUI::List::_setItemFocus | ( | size_t | _position, |
bool | _focus | ||
) |
Definition at line 830 of file MyGUI_List.cpp.
void MyGUI::List::_setScrollView | ( | size_t | _position | ) | [protected] |
Definition at line 855 of file MyGUI_List.cpp.
void MyGUI::List::_updateState | ( | ) | [inline, protected] |
Definition at line 293 of file MyGUI_List.h.
void MyGUI::List::addItem | ( | const UString & | _name, |
Any | _data = Any::Null |
||
) | [inline] |
Add an item to the end of a array.
Definition at line 54 of file MyGUI_List.h.
void MyGUI::List::baseChangeWidgetSkin | ( | ResourceSkin * | _info | ) | [protected, virtual] |
Reimplemented from MyGUI::Widget.
Definition at line 59 of file MyGUI_List.cpp.
void MyGUI::List::beginToEnd | ( | ) | [inline] |
Definition at line 253 of file MyGUI_List.h.
void MyGUI::List::beginToIndex | ( | size_t | _index | ) | [inline] |
Definition at line 249 of file MyGUI_List.h.
void MyGUI::List::beginToItemAt | ( | size_t | _index | ) |
Move all elements so specified becomes visible.
Definition at line 713 of file MyGUI_List.cpp.
void MyGUI::List::beginToItemFirst | ( | ) | [inline] |
Move all elements so first becomes visible.
Definition at line 118 of file MyGUI_List.h.
void MyGUI::List::beginToItemLast | ( | ) | [inline] |
Move all elements so last becomes visible.
Definition at line 121 of file MyGUI_List.h.
void MyGUI::List::beginToItemSelected | ( | ) | [inline] |
Move all elements so selected becomes visible.
Definition at line 124 of file MyGUI_List.h.
void MyGUI::List::beginToSelect | ( | ) | [inline] |
Definition at line 255 of file MyGUI_List.h.
void MyGUI::List::beginToStart | ( | ) | [inline] |
Definition at line 251 of file MyGUI_List.h.
void MyGUI::List::clearIndexSelected | ( | ) | [inline] |
Clear item selection
Definition at line 80 of file MyGUI_List.h.
void MyGUI::List::clearItemDataAt | ( | size_t | _index | ) | [inline] |
Clear an item data at a specified position.
Definition at line 90 of file MyGUI_List.h.
void MyGUI::List::clearItemSelected | ( | ) | [inline] |
Definition at line 228 of file MyGUI_List.h.
void MyGUI::List::deleteAllItems | ( | ) | [inline] |
Definition at line 239 of file MyGUI_List.h.
void MyGUI::List::deleteItem | ( | size_t | _index | ) | [inline] |
Definition at line 237 of file MyGUI_List.h.
size_t MyGUI::List::findItem | ( | const UString & | _item | ) | [inline] |
Definition at line 241 of file MyGUI_List.h.
size_t MyGUI::List::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 936 of file MyGUI_List.cpp.
static const std::string& MyGUI::List::getClassTypeName | ( | ) | [inline, static] |
Reimplemented from MyGUI::Widget.
Definition at line 39 of file MyGUI_List.h.
size_t MyGUI::List::getIndexSelected | ( | ) | [inline] |
Get index of selected item (ITEM_NONE if none selected)
Definition at line 74 of file MyGUI_List.h.
const UString& MyGUI::List::getItem | ( | size_t | _index | ) | [inline] |
Definition at line 235 of file MyGUI_List.h.
size_t MyGUI::List::getItemCount | ( | ) | const [inline] |
Get number of items.
Definition at line 48 of file MyGUI_List.h.
ValueType* MyGUI::List::getItemDataAt | ( | size_t | _index, |
bool | _throw = true |
||
) | [inline] |
Get item data from specified position.
Definition at line 94 of file MyGUI_List.h.
size_t MyGUI::List::getItemIndexSelected | ( | ) | [inline] |
Definition at line 224 of file MyGUI_List.h.
const UString & MyGUI::List::getItemNameAt | ( | size_t | _index | ) |
Get item name from specified position.
Definition at line 804 of file MyGUI_List.cpp.
size_t MyGUI::List::getItemSelect | ( | ) | [inline] |
Definition at line 243 of file MyGUI_List.h.
int MyGUI::List::getOptimalHeight | ( | ) |
Return optimal height to fit all items in List.
Definition at line 945 of file MyGUI_List.cpp.
virtual const std::string& MyGUI::List::getTypeName | ( | ) | const [inline, virtual] |
Get type name as string
Reimplemented from MyGUI::Widget.
Definition at line 39 of file MyGUI_List.h.
void MyGUI::List::insertItem | ( | size_t | _index, |
const UString & | _item | ||
) | [inline] |
Definition at line 231 of file MyGUI_List.h.
void MyGUI::List::insertItemAt | ( | size_t | _index, |
const UString & | _name, | ||
Any | _data = Any::Null |
||
) |
Insert an item into a array at a specified position.
Definition at line 554 of file MyGUI_List.cpp.
bool MyGUI::List::isItemSelectedVisible | ( | bool | _fill = true | ) | [inline] |
Same as List::isItemVisible for selected item.
Definition at line 138 of file MyGUI_List.h.
bool MyGUI::List::isItemSelectVisible | ( | bool | _fill = true | ) | [inline] |
Definition at line 259 of file MyGUI_List.h.
bool MyGUI::List::isItemVisible | ( | size_t | _index, |
bool | _fill = true |
||
) | [inline] |
Definition at line 257 of file MyGUI_List.h.
bool MyGUI::List::isItemVisibleAt | ( | size_t | _index, |
bool | _fill = true |
||
) |
Return true if item visible
_index | of item |
_fill | false: function return true when whole item is visible true: function return true when at least part of item is visible |
Definition at line 735 of file MyGUI_List.cpp.
bool MyGUI::List::isType | ( | ) | const [inline] |
Compare with selected type
Reimplemented from MyGUI::Widget.
Definition at line 39 of file MyGUI_List.h.
virtual bool MyGUI::List::isType | ( | const std::type_info & | _type | ) | const [inline, virtual] |
Compare with selected type
Reimplemented from MyGUI::Widget.
Definition at line 39 of file MyGUI_List.h.
void MyGUI::List::notifyMouseDoubleClick | ( | Widget * | _sender | ) | [protected] |
Definition at line 317 of file MyGUI_List.cpp.
void MyGUI::List::notifyMouseLostFocus | ( | Widget * | _sender, |
Widget * | _new | ||
) | [protected] |
Definition at line 821 of file MyGUI_List.cpp.
void MyGUI::List::notifyMousePressed | ( | Widget * | _sender, |
int | _left, | ||
int | _top, | ||
MouseButton | _id | ||
) | [protected] |
Definition at line 272 of file MyGUI_List.cpp.
void MyGUI::List::notifyMouseSetFocus | ( | Widget * | _sender, |
Widget * | _old | ||
) | [protected] |
Definition at line 810 of file MyGUI_List.cpp.
void MyGUI::List::notifyMouseWheel | ( | Widget * | _sender, |
int | _rel | ||
) | [protected] |
Definition at line 244 of file MyGUI_List.cpp.
void MyGUI::List::notifyScrollChangePosition | ( | VScroll * | _sender, |
size_t | _rel | ||
) | [protected] |
Definition at line 266 of file MyGUI_List.cpp.
void MyGUI::List::onKeyButtonPressed | ( | KeyCode | _key, |
Char | _char | ||
) | [protected, virtual] |
Reimplemented from MyGUI::WidgetEvent.
Definition at line 140 of file MyGUI_List.cpp.
void MyGUI::List::onKeyLostFocus | ( | Widget * | _new | ) | [protected, virtual] |
Reimplemented from MyGUI::WidgetEvent.
Definition at line 132 of file MyGUI_List.cpp.
void MyGUI::List::onKeySetFocus | ( | Widget * | _old | ) | [protected, virtual] |
Reimplemented from MyGUI::WidgetEvent.
Definition at line 124 of file MyGUI_List.cpp.
void MyGUI::List::onMouseWheel | ( | int | _rel | ) | [protected, virtual] |
Reimplemented from MyGUI::WidgetEvent.
Definition at line 117 of file MyGUI_List.cpp.
void MyGUI::List::removeAllItems | ( | ) |
Remove all items.
Definition at line 764 of file MyGUI_List.cpp.
void MyGUI::List::removeItemAt | ( | size_t | _index | ) |
Remove item at a specified position.
Definition at line 613 of file MyGUI_List.cpp.
void MyGUI::List::resetItemSelect | ( | ) | [inline] |
Definition at line 245 of file MyGUI_List.h.
void MyGUI::List::setCoord | ( | const IntCoord & | _value | ) | [virtual] |
Set widget position and size
Reimplemented from MyGUI::Widget.
Definition at line 336 of file MyGUI_List.cpp.
void MyGUI::List::setCoord | ( | int | _left, |
int | _top, | ||
int | _width, | ||
int | _height | ||
) | [inline] |
See Widget::setCoord(const IntCoord& _coord)
Reimplemented from MyGUI::Widget.
Definition at line 160 of file MyGUI_List.h.
void MyGUI::List::setIndexSelected | ( | size_t | _index | ) |
Select specified _index
Definition at line 682 of file MyGUI_List.cpp.
void MyGUI::List::setItem | ( | size_t | _index, |
const UString & | _item | ||
) | [inline] |
Definition at line 233 of file MyGUI_List.h.
void MyGUI::List::setItemDataAt | ( | size_t | _index, |
Any | _data | ||
) |
Replace an item data at a specified position.
Definition at line 797 of file MyGUI_List.cpp.
void MyGUI::List::setItemNameAt | ( | size_t | _index, |
const UString & | _name | ||
) |
Replace an item name at a specified position.
Definition at line 790 of file MyGUI_List.cpp.
void MyGUI::List::setItemSelect | ( | size_t | _index | ) | [inline] |
Definition at line 247 of file MyGUI_List.h.
void MyGUI::List::setItemSelectedAt | ( | size_t | _index | ) | [inline] |
Definition at line 226 of file MyGUI_List.h.
void MyGUI::List::setPosition | ( | const IntPoint & | _value | ) | [virtual] |
Set widget position (position of left top corner)
Reimplemented from MyGUI::Widget.
Definition at line 323 of file MyGUI_List.cpp.
void MyGUI::List::setPosition | ( | int | _left, |
int | _top | ||
) | [inline] |
See Widget::setPosition(const IntPoint& _pos)
Reimplemented from MyGUI::Widget.
Definition at line 156 of file MyGUI_List.h.
void MyGUI::List::setPosition | ( | const IntCoord & | _coord | ) | [inline] |
Reimplemented from MyGUI::Widget.
Definition at line 219 of file MyGUI_List.h.
void MyGUI::List::setPosition | ( | int | _left, |
int | _top, | ||
int | _width, | ||
int | _height | ||
) | [inline] |
Reimplemented from MyGUI::Widget.
Definition at line 221 of file MyGUI_List.h.
void MyGUI::List::setProperty | ( | const std::string & | _key, |
const std::string & | _value | ||
) | [virtual] |
Set any widget property
_key | Property name (for example Widget_Alpha or Edit_MultiLine) |
_value | Value converted to string |
Reimplemented from MyGUI::Widget.
Definition at line 950 of file MyGUI_List.cpp.
void MyGUI::List::setScrollPosition | ( | size_t | _position | ) |
Set scroll position.
Definition at line 843 of file MyGUI_List.cpp.
void MyGUI::List::setScrollVisible | ( | bool | _visible | ) |
Set scroll visible when it needed.
Definition at line 836 of file MyGUI_List.cpp.
void MyGUI::List::setSize | ( | const IntSize & | _value | ) | [virtual] |
void MyGUI::List::setSize | ( | int | _width, |
int | _height | ||
) | [inline] |
See Widget::setSize(const IntSize& _size)
Reimplemented from MyGUI::Widget.
Definition at line 158 of file MyGUI_List.h.
void MyGUI::List::swapItemsAt | ( | size_t | _index1, |
size_t | _index2 | ||
) |
Swap items at a specified positions.
Definition at line 886 of file MyGUI_List.cpp.
void MyGUI::List::updateLine | ( | bool | _reset = false | ) | [protected] |
Definition at line 372 of file MyGUI_List.cpp.
void MyGUI::List::updateScroll | ( | ) | [protected] |
Definition at line 344 of file MyGUI_List.cpp.
Event : Selected item position changed.
signature : void method(MyGUI::List* _sender, size_t _index)
_sender | widget that called this event |
_index | of new item |
Definition at line 182 of file MyGUI_List.h.
Event : Position of scroll changed.
signature : void method(MyGUI::List* _sender, size_t _position)
_sender | widget that called this event |
_position | of scroll |
Definition at line 203 of file MyGUI_List.h.
EventPair<EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT> MyGUI::List::eventListMouseItemActivate |
Event : Item was selected by mouse.
signature : void method(MyGUI::List* _sender, size_t _index)
_sender | widget that called this event |
_index | of selected item |
Definition at line 189 of file MyGUI_List.h.
Event : Mouse is over item.
signature : void method(MyGUI::List* _sender, size_t _index)
_sender | widget that called this event |
_index | of focused item |
Definition at line 196 of file MyGUI_List.h.
Event : Enter pressed or double click.
signature : void method(MyGUI::List* _sender, size_t _index)
_sender | widget that called this event |
_index | of selected item |
Definition at line 175 of file MyGUI_List.h.