30 #ifndef _CEGUIListbox_h_
31 #define _CEGUIListbox_h_
33 #include "../CEGUIBase.h"
34 #include "../CEGUIWindow.h"
35 #include "CEGUIListboxProperties.h"
40 # pragma warning(push)
41 # pragma warning(disable : 4251)
71 virtual Rect getListRenderArea(
void)
const = 0;
153 size_t getSelectedCount(
void)
const;
196 ListboxItem* getListboxItemFromIndex(
size_t index)
const;
211 size_t getItemIndex(
const ListboxItem* item)
const;
232 bool isItemTooltipsEnabled(
void)
const {
return d_itemTooltips;}
246 bool isItemSelected(
size_t index)
const;
266 ListboxItem* findItemWithText(
const String& text,
const ListboxItem* start_item);
276 bool isListboxItemInList(
const ListboxItem* item)
const;
287 bool isVertScrollbarAlwaysShown(
void)
const;
298 bool isHorzScrollbarAlwaysShown(
void)
const;
314 virtual void initialiseComponents(
void);
323 void resetList(
void);
337 void addItem(ListboxItem* item);
363 void insertItem(ListboxItem* item,
const ListboxItem* position);
377 void removeItem(
const ListboxItem* item);
387 void clearAllSelections(
void);
400 void setSortingEnabled(
bool setting);
414 void setMultiselectEnabled(
bool setting);
428 void setShowVertScrollbar(
bool setting);
442 void setShowHorzScrollbar(
bool setting);
444 void setItemTooltipsEnabled(
bool setting);
464 void setItemSelectState(ListboxItem* item,
bool state);
486 void setItemSelectState(
size_t item_index,
bool state);
501 void handleUpdatedItemData(
void);
515 void ensureItemIsVisible(
size_t item_index);
530 void ensureItemIsVisible(
const ListboxItem* item);
542 virtual Rect getListRenderArea(
void)
const;
556 Scrollbar* getVertScrollbar()
const;
569 Scrollbar* getHorzScrollbar()
const;
576 float getTotalItemsHeight(
void)
const;
583 float getWidestItemWidth(
void)
const;
596 ListboxItem* getItemAtPoint(
const Point& pt)
const;
606 Listbox(
const String& type,
const String& name);
613 virtual ~Listbox(
void);
639 void configureScrollbars(
void);
646 void selectRange(
size_t start,
size_t end);
656 bool clearAllSelections_impl(
void);
670 bool resetList_impl(
void);
685 if (class_name==
"Listbox")
return true;
693 bool handle_scrollChange(
const EventArgs& args);
699 return (name ==
"Listbox");
765 typedef std::vector<ListboxItem*> LBItemList;
789 void addListboxProperties(
void);
811 #if defined(_MSC_VER)
812 # pragma warning(pop)
815 #endif // end of guard _CEGUIListbox_h_
static const String EventMultiselectModeChanged
Definition: CEGUIListbox.h:111
Property to access the sort setting of the list box.
Definition: CEGUIListboxProperties.h:59
bool d_itemTooltips
true if each item should have an individual tooltip
Definition: CEGUIListbox.h:770
static const String EventVertScrollbarModeChanged
Definition: CEGUIListbox.h:118
Property to access the multi-select setting of the list box.
Definition: CEGUIListboxProperties.h:85
size_t getItemCount(void) const
Return number of items attached to the list box.
Definition: CEGUIListbox.h:143
bool lbi_greater(const ListboxItem *a, const ListboxItem *b)
Helper function used in sorting to compare two list box item text strings via the ListboxItem pointer...
Base class used as the argument to all subscribers Event object.
Definition: CEGUIEventArgs.h:52
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: CEGUIListbox.h:769
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: CEGUIListbox.h:768
static const String EventNamespace
Namespace for global events.
Definition: CEGUIListbox.h:81
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 h...
Definition: CEGUIWindow.h:3928
virtual bool validateWindowRenderer(const String &name) const
Function used in checking if a WindowRenderer is valid for this window.
Definition: CEGUIListbox.h:697
ListboxItem * d_lastSelected
holds pointer to the last selected item (used in range selections)
Definition: CEGUIListbox.h:772
Base-class for the assignable WindowRenderer object.
Definition: CEGUIWindowRenderer.h:51
static const String EventListContentsChanged
Definition: CEGUIListbox.h:92
static const String EventHorzScrollbarModeChanged
Definition: CEGUIListbox.h:125
bool lbi_less(const ListboxItem *a, const ListboxItem *b)
Helper function used in sorting to compare two list box item text strings via the ListboxItem pointer...
static const String EventSelectionChanged
Definition: CEGUIListbox.h:99
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 h...
Definition: CEGUIListbox.h:683
bool isMultiselectEnabled(void) const
return whether multi-select is enabled
Definition: CEGUIListbox.h:230
Base class for Listbox window renderer.
Definition: CEGUIListbox.h:53
Base class for standard Listbox widget.
Definition: CEGUIListbox.h:78
static const String WidgetTypeName
Window factory name.
Definition: CEGUIListbox.h:82
bool d_sorted
true if list is sorted
Definition: CEGUIListbox.h:766
static const String EventSortModeChanged
Definition: CEGUIListbox.h:105
LBItemList d_listItems
list of items in the list box.
Definition: CEGUIListbox.h:771
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: CEGUIWindow.h:138
Base class for list box items.
Definition: CEGUIListboxItem.h:50
static const String VertScrollbarNameSuffix
Widget name suffix for the vertical scrollbar component.
Definition: CEGUIListbox.h:130
Vector2 Point
Point class.
Definition: CEGUIVector.h:123
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: CEGUIInputEvent.h:245
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: CEGUIInputEvent.h:274
static const String HorzScrollbarNameSuffix
Widget name suffix for the horizontal scrollbar component.
Definition: CEGUIListbox.h:131
bool isSortEnabled(void) const
return whether list sorting is enabled
Definition: CEGUIListbox.h:221
bool d_multiselect
true if multi-select is enabled
Definition: CEGUIListbox.h:767
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44
String class used within the GUI system.
Definition: CEGUIString.h:57