29 #ifndef _CEGUIItemListBase_h_
30 #define _CEGUIItemListBase_h_
33 #include "../Window.h"
34 #include "./ItemEntry.h"
40 # pragma warning(push)
41 # pragma warning(disable : 4251)
351 bool client_sized_hint =
false);
559 CEGUI_VECTOR_ALLOC(
ItemEntry*)> ItemEntryList;
581 void addItemListBaseProperties(
void);
587 virtual void addChild_impl(
Element* element);
600 static const String& getDataTypeName()
602 static String type(
"SortMode");
609 if (str ==
"Ascending")
611 return ItemListBase::Ascending;
613 else if (str ==
"Descending")
615 return ItemListBase::Descending;
619 return ItemListBase::UserSort;
625 if (val == ItemListBase::UserSort)
629 else if (val == ItemListBase::Ascending)
633 else if (val == ItemListBase::Descending)
639 assert(
false &&
"Invalid sort mode");
649 #if defined(_MSC_VER)
650 # pragma warning(pop)
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:211
A positioned and sized rectangular node in a tree graph.
Definition: Element.h:246
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
Base class for item type widgets.
Definition: widgets/ItemEntry.h:77
Base class for ItemListBase window renderer.
Definition: ItemListBase.h:54
virtual Rectf getItemRenderArea(void) const =0
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
ItemListBaseWindowRenderer(const String &name)
Constructor.
Base class for item list widgets.
Definition: ItemListBase.h:79
virtual void layoutItemWidgets()=0
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
void resetList(void)
Remove all items from the list.
size_t getItemIndex(const ItemEntry *item) const
Return the index of ItemEntry item.
SortCallback getRealSortCallback(void) const
Returns the SortCallback that's really going to be used for the sorting operation.
ItemListBase(const String &type, const String &name)
Constructor for ItemListBase base class.
virtual Sizef getContentSize() const =0
Returns the Size in unclipped pixels of the content attached to this ItemListBase that is attached to...
bool d_autoResize
Pointer to the content pane (for items), 0 if we're not using one.
Definition: ItemListBase.h:563
void setSortMode(SortMode mode)
Set mode to be used when sorting the list.
virtual void notifyItemSelectState(ItemEntry *, bool)
Notify this ItemListBase that the given item just changed selection state. Internal function - NOT to...
Definition: ItemListBase.h:387
void setSortCallback(SortCallback cb)
Set a user callback as sorting function.
Window * d_pane
True if this ItemListBase is sorted. False if not.
Definition: ItemListBase.h:566
ItemEntry * findItemWithText(const String &text, const ItemEntry *start_item)
Search the list for an item with the specified text.
virtual void onSortModeChanged(WindowEventArgs &e)
Handler called internally when the sorting mode is changed.
bool isSortEnabled(void) const
Returns 'true' if the list is sorted.
Definition: ItemListBase.h:207
SortMode getSortMode(void) const
Get sort mode.
Definition: ItemListBase.h:214
virtual void endInitialisation(void)
Triggers a ListContentsChanged event. These are not fired during initialisation for optimization purp...
size_t getItemCount(void) const
Return number of items attached to the list.
Definition: ItemListBase.h:130
static const String EventSortEnabledChanged
Definition: ItemListBase.h:112
ItemEntry * getItemFromIndex(size_t index) const
Return the item at index position index.
virtual ~ItemListBase(void)
Destructor for ItemListBase base class.
SortMode
Sort modes for ItemListBase.
Definition: ItemListBase.h:88
void addItem(ItemEntry *item)
Add the given ItemEntry to the list.
SortMode d_sortMode
The user sort callback or 0 if none.
Definition: ItemListBase.h:571
void setSortEnabled(bool setting)
Set whether the list should be sorted (by text).
void setAutoResizeEnabled(bool setting)
Set whether or not this ItemListBase widget should automatically resize to fit its content.
virtual bool validateWindowRenderer(const WindowRenderer *renderer) const
Function used in checking if a WindowRenderer is valid for this window.
virtual bool handle_PaneChildRemoved(const EventArgs &e)
Handler to manage items being removed from the content pane. If there is one!
Rectf getItemRenderArea(void) const
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
bool isItemInList(const ItemEntry *item) const
Return whether the specified ItemEntry is in the List.
virtual void sizeToContent_impl(void)
Resize the ItemListBase to exactly fit the content that is attached to it. Return a Rect object descr...
void handleUpdatedItemData(bool resort=false)
void performChildWindowLayout(bool nonclient_sized_hint=false, bool client_sized_hint=false)
Layout child window content.
bool resetList_impl(void)
Remove all items from the list.
void sortList(bool relayout=true)
Sort the list.
static const String EventListContentsChanged
Definition: ItemListBase.h:106
void removeItem(ItemEntry *item)
Removes the given item from the list. If the item is has the 'DestroyedByParent' property set to 'tru...
virtual void notifyItemClicked(ItemEntry *)
Notify this ItemListBase that the given item was just clicked. Internal function - NOT to be used fro...
Definition: ItemListBase.h:380
static const String EventSortModeChanged
Definition: ItemListBase.h:118
virtual void initialiseComponents(void)
Initialise the Window based object ready for use.
virtual void sizeToContent(void)
Resize the ItemListBase to exactly fit the content that is attached to it. Return a Rect object descr...
Definition: ItemListBase.h:338
Window * getContentPane(void) const
Returns a pointer to the window that all items are directed too.
Definition: ItemListBase.h:373
bool isAutoResizeEnabled() const
Return whether this window is automatically resized to fit its content.
Definition: ItemListBase.h:200
ItemEntryList d_listItems
list of items in the list.
Definition: ItemListBase.h:560
SortCallback getSortCallback(void) const
Get user sorting callback.
Definition: ItemListBase.h:221
SortCallback d_sortCallback
True if the list needs to be resorted.
Definition: ItemListBase.h:573
static const String EventNamespace
Namespace for global events.
Definition: ItemListBase.h:81
virtual void onListContentsChanged(WindowEventArgs &e)
Handler called internally when the list contents are changed.
void insertItem(ItemEntry *item, const ItemEntry *position)
Insert an item into the list before a specified item already in the list.
virtual void onSortEnabledChanged(WindowEventArgs &e)
Handler called internally when sorting gets enabled.
virtual void onParentSized(ElementEventArgs &e)
Handler called when this window's parent window has been resized. If this window is the root / GUI Sh...
bool d_sortEnabled
The current sorting mode applied if sorting is enabled.
Definition: ItemListBase.h:569
Helper class used to convert various data types to and from the format expected in Property strings.
Definition: ForwardRefs.h:84
String class used within the GUI system.
Definition: String.h:64
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:52
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1