Crazy Eddies GUI System: CEGUI::ItemListBase Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Class List
- Alphabetical List
- Class Hierarchy
- Class Members

# CEGUI::ItemListBase Class Reference

Base class for item list widgets. More...

Inheritance diagram for CEGUI::ItemListBase:

[legend]
Collaboration diagram for CEGUI::ItemListBase:

[legend]
List of all members.

## Public Member Functions
size_t | getItemCount (void) const
| Return number of items attached to the list.
ItemEntry * | getItemFromIndex (size_t index) const
| Return the item at index position index.
size_t | getItemIndex (const ItemEntry *item) const
| Return the index of ItemEntry item.
ItemEntry * | findItemWithText (const String &text, const ItemEntry *start_item)
| Search the list for an item with the specified text.
bool | isItemInList (const ItemEntry *item) const
| Return whether the specified ItemEntry is in the List.
bool | isAutoResizeEnabled () const
| Return wheter this window is automatically resized to fit its content.
virtual void | initialise (void)
| Initialise the Window based object ready for use.
void | resetList (void)
| Remove all items from the list.
void | addItem (ItemEntry *item)
| Add the given ItemEntry to the list.
void | insertItem (ItemEntry *item, const ItemEntry *position)
| Insert an item into the list after a specified item already in the list.
void | removeItem (ItemEntry *item)
| Removes the given item from the list. If the item is has the auto delete state set, the item will be deleted.
void | handleUpdatedItemData (void)
| Causes the list to update it's internal state after changes have been made to one or more attached ItemEntry objects.
void | setAutoResizeEnabled (bool setting)
| Set whether or not this ItemListBase widget should automatically resize to fit its content.
virtual void | sizeToContent (void)
| Resize the ItemListBase to exactly fit the content that is attached to it. Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used for rendering items.
| ItemListBase (const String &type, const String &name)
| Constructor for ItemListBase base class.
virtual | ~ItemListBase (void)
| Destructor for ItemListBase base class.
## Static Public Attributes
static const String | EventNamespace
| Namespace for global events.
static const String | EventListContentsChanged
| Event triggered when the contents of the list is changed.
## Protected Types
typedef std::vector< ItemEntry * > | ItemEntryList
## Protected Member Functions
virtual void | sizeToContent_impl (void)=0
| Resize the ItemListBase to exactly fit the content that is attached to it. Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used for rendering items.
virtual Size | getContentSize ()=0
| Returns the Size in unclipped pixels of the content attached to this ItemListBase that is attached to it.
virtual Rect | getItemRenderArea (void) const =0
| Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used for rendering list items.
virtual void | layoutItemWidgets ()=0
| Setup size and position for the item widgets attached to this ItemListBase.
virtual void | populateRenderCache ()=0
| Perform the actual rendering for this Window.
void | addItemListBaseEvents (void)
| Add list box specific events.
bool | resetList_impl (void)
| Remove all items from the list.
virtual bool | testClassName_impl (const String &class_name) const
| Return whether this window was inherited from the given class name at some point in the inheritance heirarchy.
virtual void | onListContentsChanged (WindowEventArgs &e)
| Handler called internally when the list contents are changed.
virtual void | onSized (WindowEventArgs &e)
| Handler called when the window's size changes.
## Protected Attributes
ItemEntryList | d_listItems
| list of items in the list.
bool | d_autoResize

## Detailed Description

Base class for item list widgets.

## Member Function Documentation

void CEGUI::ItemListBase::addItem | ( | ItemEntry * | item | ) |

  | Add the given ItemEntry to the list. Parameters:
  | item | Pointer to the ItemEntry to be added to the list. Note that it is the passed object that is added to the list, a copy is not made. If this parameter is NULL, nothing happens.
Returns: Nothing.

ItemEntry * CEGUI::ItemListBase::findItemWithText | ( | const String & | text,
|  | const ItemEntry * | start_item
| ) |

  | Search the list for an item with the specified text. Parameters:
  | text | String object containing the text to be searched for.
  | start_item | ItemEntry where the search is to begin, the search will not include item. If item is NULL, the search will begin from the first item in the list.
  Returns: Pointer to the first ItemEntry in the list after item that has text matching text. If no item matches the criteria NULL is returned. Exceptions:
  | InvalidRequestException | thrown if item is not attached to this list box.

virtual Size CEGUI::ItemListBase::getContentSize | ( |  | ) | `[protected, pure virtual]`

| Returns the Size in unclipped pixels of the content attached to this ItemListBase that is attached to it. Returns: Nothing. Implemented in CEGUI::Menubar, and CEGUI::PopupMenu.

size_t CEGUI::ItemListBase::getItemCount | ( | void |  | ) | const`[inline]`

| Return number of items attached to the list. Returns: the number of items currently attached to this list.

ItemEntry * CEGUI::ItemListBase::getItemFromIndex | ( | size_t | index | ) | const

  | Return the item at index position index. Parameters:
  | index | Zero based index of the item to be returned.
  Returns: Pointer to the ItemEntry at index position index in the list. Exceptions:
  | InvalidRequestException | thrown if index is out of range.

size_t CEGUI::ItemListBase::getItemIndex | ( | const ItemEntry * | item | ) | const

  | Return the index of ItemEntry item. Parameters:
  | item | Pointer to a ItemEntry whos zero based index is to be returned.
  Returns: Zero based index indicating the position of ItemEntry item in the list. Exceptions:
  | InvalidRequestException | thrown if item is not attached to this list.

virtual Rect CEGUI::ItemListBase::getItemRenderArea | ( | void |  | ) | const`[protected, pure virtual]`

| Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used for rendering list items. Returns: Rect object describing the window relative area of the that is to be used for rendering the items.

void CEGUI::ItemListBase::handleUpdatedItemData | ( | void |  | ) |

| Causes the list to update it's internal state after changes have been made to one or more attached ItemEntry objects. Client code must call this whenever it has made any changes to ItemEntry objects already attached to the list. If you are just adding items, or removed items to update them prior to re-adding them, there is no need to call this method. Returns: Nothing.

void CEGUI::ItemListBase::initialise | ( | void |  | ) | `[virtual]`

| Initialise the Window based object ready for use. Note: This must be called for every window created. Normally this is handled automatically by the WindowFactory for each Window type. Returns: Nothing Reimplemented from CEGUI::Window.

void CEGUI::ItemListBase::insertItem | ( | ItemEntry * | item,
|  | const ItemEntry * | position
| ) |

  | Insert an item into the list after a specified item already in the list. Note that if the list is sorted, the item may not end up in the requested position. Parameters:
  | item | Pointer to the ItemEntry to be inserted. Note that it is the passed object that is added to the list, a copy is not made. If this parameter is NULL, nothing happens.
  | position | Pointer to a ItemEntry that item is to be inserted after. If this parameter is NULL, the item is inserted at the start of the list.
Returns: Nothing.

bool CEGUI::ItemListBase::isAutoResizeEnabled | ( |  | ) | const`[inline]`

| Return wheter this window is automatically resized to fit its content. Returns: true if automatic resizing is enabled, false if it is disabled.

bool CEGUI::ItemListBase::isItemInList | ( | const ItemEntry * | item | ) | const

| Return whether the specified ItemEntry is in the List. Returns: true if ItemEntry item is in the list, false if ItemEntry item is not in the list.

virtual void CEGUI::ItemListBase::layoutItemWidgets | ( |  | ) | `[protected, pure virtual]`

| Setup size and position for the item widgets attached to this ItemListBase. Returns: Nothing. Implemented in CEGUI::Menubar, and CEGUI::PopupMenu.

void CEGUI::ItemListBase::onSized | ( | WindowEventArgs & | e | ) | `[protected, virtual]`

  | Handler called when the window's size changes. Parameters:
  | e | WindowEventArgs object whose 'window' pointer field is set to the window that triggered the event. For this event the trigger window is always 'this'.
Reimplemented from CEGUI::Window.

virtual void CEGUI::ItemListBase::populateRenderCache | ( |  | ) | `[protected, pure virtual]`

| Perform the actual rendering for this Window. Returns: Nothing Reimplemented from CEGUI::Window.

void CEGUI::ItemListBase::removeItem | ( | ItemEntry * | item | ) |

  | Removes the given item from the list. If the item is has the auto delete state set, the item will be deleted. Parameters:
  | item | Pointer to the ItemEntry that is to be removed. If item is not attached to this list then nothing will happen.
Returns: Nothing.

void CEGUI::ItemListBase::resetList | ( | void |  | ) |

| Remove all items from the list. Note that this will cause 'AutoDelete' items to be deleted.

bool CEGUI::ItemListBase::resetList_impl | ( | void |  | ) | `[protected]`

| Remove all items from the list. Note: Note that this will cause 'AutoDelete' items to be deleted. Returns: true if the list contents were changed. false if the list contents were not changed (list already empty).

void CEGUI::ItemListBase::setAutoResizeEnabled | ( | bool | setting | ) |

  | Set whether or not this ItemListBase widget should automatically resize to fit its content. Parameters:
  | setting | Boolean value that if true enables automatic resizing, if false disables automatic resizing.
Returns: Nothing.

virtual void CEGUI::ItemListBase::sizeToContent | ( | void |  | ) | `[inline, virtual]`

| Resize the ItemListBase to exactly fit the content that is attached to it. Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used for rendering items. Returns: Nothing

virtual void CEGUI::ItemListBase::sizeToContent_impl | ( | void |  | ) | `[protected, pure virtual]`

| Resize the ItemListBase to exactly fit the content that is attached to it. Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used for rendering items. Returns: Nothing

virtual bool CEGUI::ItemListBase::testClassName_impl | ( | const String & | class_name | ) | const`[inline, protected, virtual]`

  | Return whether this window was inherited from the given class name at some point in the inheritance heirarchy. Parameters:
  | class_name | The class name that is to be checked.
Returns: true if this window was inherited from class_name. false if not. Reimplemented from CEGUI::Window. Reimplemented in CEGUI::Menubar, CEGUI::MenuBase, and CEGUI::PopupMenu.