#include <OpenGUI_WidgetCollection.h>
Maintains an ordered list of Widget pointers. Also provides the option to take ownership of heap allocated memory, and delete the given widget pointer on destruction.
Public Types | |
| typedef collection_iterator< WidgetCollectionItemPtrList::iterator > | iterator |
| WidgetCollection iterator. | |
| typedef collection_iterator< WidgetCollectionItemPtrList::reverse_iterator > | reverse_iterator |
| WidgetCollection reverse_iterator. | |
Public Member Functions | |
| WidgetCollection () | |
| public constructor | |
| ~WidgetCollection () | |
| public destructor | |
| void | add_front (Widget *widget, bool takeOwnership=false) |
| Adds given widget pointer to the front of the collection. | |
| void | add_back (Widget *widget, bool takeOwnership=false) |
| Adds given widget pointer to the back of the collection. | |
| void | remove (Widget *widget) |
| Remove the given widget pointer from the collection. | |
| void | moveToFront (Widget *widget) |
| Move the given widget pointer to the front of the collection. | |
| void | moveToBack (Widget *widget) |
| Move the given widget to the back of the collection. | |
| Widget * | getWidget (const String &widgetName) const |
| returns a pointer to the requested widget or 0 if not found | |
| Widget & | operator[] (const String &widgetName) |
| returns a reference to the requested widget or throws an exception if not found | |
| bool | hasWidget (Widget *widget) |
| returns true if the given widget pointer is in the collection | |
| void | attachListener (WidgetCollectionListener *listener) |
| Attaches a WidgetCollectionListener to this WidgetCollection. | |
| void | detachListener (WidgetCollectionListener *listener) |
| Removes a previously attached WidgetCollectionListener from this WidgetCollection. | |
| void | setParent (Object *object) |
| Sets the hierarchical parent of this collection. | |
| Object * | getParent () |
| Gets the hierarchical parent of this collection. | |
| void | appendWidgetPtrList (WidgetPtrList &l) const |
| Appends the contents of this collection to the end of the given WidgetPtrList, preserving the collection's order. | |
| iterator | begin () |
| returns an iterator for the collection starting at the beginning | |
| iterator | end () |
| returns an iterator for the collection starting off the end | |
| reverse_iterator | rbegin () |
| returns an iterator for the collection starting at the end | |
| reverse_iterator | rend () |
| returns an iterator for the collection starting off the beginning | |
Classes | |
| class | collection_iterator |
| Template class providing iterator encapsulation. More... | |
|
|
WidgetCollection iterator.
|
|
|
WidgetCollection reverse_iterator.
|
|
|
public constructor
|
|
|
public destructor
|
|
||||||||||||
|
Adds given widget pointer to the back of the collection.
|
|
||||||||||||
|
Adds given widget pointer to the front of the collection.
|
|
|
Appends the contents of this collection to the end of the given WidgetPtrList, preserving the collection's order.
|
|
|
Attaches a WidgetCollectionListener to this WidgetCollection.
|
|
|
returns an iterator for the collection starting at the beginning
|
|
|
Removes a previously attached WidgetCollectionListener from this WidgetCollection.
|
|
|
returns an iterator for the collection starting off the end
|
|
|
Gets the hierarchical parent of this collection.
|
|
|
returns a pointer to the requested widget or 0 if not found
|
|
|
returns true if the given widget pointer is in the collection
|
|
|
Move the given widget to the back of the collection.
|
|
|
Move the given widget pointer to the front of the collection.
|
|
|
returns a reference to the requested widget or throws an exception if not found
|
|
|
returns an iterator for the collection starting at the end
|
|
|
Remove the given widget pointer from the collection. If the collection was told to take ownership of the requested widget, this operation removes that ownership. The collection will no longer delete the removed widget on destruction.
|
|
|
returns an iterator for the collection starting off the beginning
|
|
|
Sets the hierarchical parent of this collection.
|