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