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)
71 virtual Rectf getItemRenderArea(
void)
const = 0;
145 ItemEntry* getItemFromIndex(
size_t index)
const;
160 size_t getItemIndex(
const ItemEntry* item)
const;
190 bool isItemInList(
const ItemEntry* item)
const;
236 virtual void initialiseComponents(
void);
245 void resetList(
void);
313 void handleUpdatedItemData(
bool resort=
false);
326 void setAutoResizeEnabled(
bool setting);
346 virtual void endInitialisation(
void);
350 void performChildWindowLayout(
bool nonclient_sized_hint =
false,
351 bool client_sized_hint =
false);
363 Rectf getItemRenderArea(
void)
const;
393 void setSortEnabled(
bool setting);
401 void setSortMode(SortMode mode);
410 void setSortCallback(SortCallback cb);
423 void sortList(
bool relayout=
true);
455 virtual void sizeToContent_impl(
void);
465 virtual Sizef getContentSize()
const = 0;
487 virtual void layoutItemWidgets() = 0;
504 bool resetList_impl(
void);
507 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
513 SortCallback getRealSortCallback(
void)
const;
553 virtual bool handle_PaneChildRemoved(
const EventArgs& e);
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");
607 static return_type fromString(
const String& str)
609 if (str ==
"Ascending")
611 return ItemListBase::Ascending;
613 else if (str ==
"Descending")
615 return ItemListBase::Descending;
619 return ItemListBase::UserSort;
623 static string_return_type toString(pass_type val)
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)
653 #endif // end of guard _CEGUIItemListBase_h_
virtual void notifyItemSelectState(ItemEntry *, bool)
Notify this ItemListBase that the given item just changed selection state. Internal function - NOT to...
Definition: ItemListBase.h:387
ItemEntryList d_listItems
list of items in the list.
Definition: ItemListBase.h:560
SortCallback d_sortCallback
True if the list needs to be resorted.
Definition: ItemListBase.h:573
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
A positioned and sized rectangular node in a tree graph.
Definition: Element.h:242
Window * d_pane
True if this ItemListBase is sorted. False if not.
Definition: ItemListBase.h:566
Base class for item type widgets.
Definition: widgets/ItemEntry.h:76
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
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:49
static const String EventListContentsChanged
Definition: ItemListBase.h:106
SortCallback getSortCallback(void) const
Get user sorting callback.
Definition: ItemListBase.h:221
bool isSortEnabled(void) const
Returns 'true' if the list is sorted.
Definition: ItemListBase.h:207
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
Base class for ItemListBase window renderer.
Definition: ItemListBase.h:53
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:50
bool d_autoResize
Pointer to the content pane (for items), 0 if we're not using one.
Definition: ItemListBase.h:563
bool d_sortEnabled
The current sorting mode applied if sorting is enabled.
Definition: ItemListBase.h:569
size_t getItemCount(void) const
Return number of items attached to the list.
Definition: ItemListBase.h:130
SortMode d_sortMode
The user sort callback or 0 if none.
Definition: ItemListBase.h:571
bool isAutoResizeEnabled() const
Return whether this window is automatically resized to fit its content.
Definition: ItemListBase.h:200
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:149
Helper class used to convert various data types to and from the format expected in Property strings...
Definition: ForwardRefs.h:84
SortMode getSortMode(void) const
Get sort mode.
Definition: ItemListBase.h:214
static const String EventSortModeChanged
Definition: ItemListBase.h:118
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:210
static const String EventNamespace
Namespace for global events.
Definition: ItemListBase.h:81
static const String EventSortEnabledChanged
Definition: ItemListBase.h:112
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:251
SortMode
Sort modes for ItemListBase.
Definition: ItemListBase.h:87
Base class for item list widgets.
Definition: ItemListBase.h:78
Window * getContentPane(void) const
Returns a pointer to the window that all items are directed too.
Definition: ItemListBase.h:373
String class used within the GUI system.
Definition: String.h:62