29 #ifndef _CEGUIListbox_h_
30 #define _CEGUIListbox_h_
33 #include "../Window.h"
38 # pragma warning(push)
39 # pragma warning(disable : 4251)
65 virtual Rectf getListRenderArea(
void)
const = 0;
73 virtual void resizeListToContent(
bool fit_width,
74 bool fit_height)
const = 0;
156 size_t getSelectedCount(
void)
const;
199 ListboxItem* getListboxItemFromIndex(
size_t index)
const;
214 size_t getItemIndex(
const ListboxItem* item)
const;
235 bool isItemTooltipsEnabled(
void)
const {
return d_itemTooltips;}
249 bool isItemSelected(
size_t index)
const;
269 ListboxItem* findItemWithText(
const String& text,
const ListboxItem* start_item);
279 bool isListboxItemInList(
const ListboxItem* item)
const;
290 bool isVertScrollbarAlwaysShown(
void)
const;
301 bool isHorzScrollbarAlwaysShown(
void)
const;
317 virtual void initialiseComponents(
void);
326 void resetList(
void);
340 void addItem(ListboxItem* item);
366 void insertItem(ListboxItem* item,
const ListboxItem* position);
380 void removeItem(
const ListboxItem* item);
390 void clearAllSelections(
void);
403 void setSortingEnabled(
bool setting);
417 void setMultiselectEnabled(
bool setting);
431 void setShowVertScrollbar(
bool setting);
445 void setShowHorzScrollbar(
bool setting);
447 void setItemTooltipsEnabled(
bool setting);
467 void setItemSelectState(ListboxItem* item,
bool state);
489 void setItemSelectState(
size_t item_index,
bool state);
504 void handleUpdatedItemData(
void);
518 void ensureItemIsVisible(
size_t item_index);
533 void ensureItemIsVisible(
const ListboxItem* item);
545 virtual Rectf getListRenderArea(
void)
const;
559 Scrollbar* getVertScrollbar()
const;
572 Scrollbar* getHorzScrollbar()
const;
579 float getTotalItemsHeight(
void)
const;
586 float getWidestItemWidth(
void)
const;
599 ListboxItem* getItemAtPoint(
const Vector2f& pt)
const;
609 Listbox(
const String& type,
const String& name);
616 virtual ~Listbox(
void);
642 void configureScrollbars(
void);
649 void selectRange(
size_t start,
size_t end);
659 bool clearAllSelections_impl(
void);
673 bool resetList_impl(
void);
679 bool handle_scrollChange(
const EventArgs& args);
683 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
698 virtual void onListContentsChanged(WindowEventArgs& e);
705 virtual void onSelectionChanged(WindowEventArgs& e);
712 virtual void onSortModeChanged(WindowEventArgs& e);
719 virtual void onMultiselectModeChanged(WindowEventArgs& e);
726 virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
733 virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
739 virtual void onSized(ElementEventArgs& e);
740 virtual void onMouseButtonDown(MouseEventArgs& e);
741 virtual void onMouseWheel(MouseEventArgs& e);
742 virtual void onMouseMove(MouseEventArgs& e);
748 typedef std::vector<ListboxItem*
749 CEGUI_VECTOR_ALLOC(ListboxItem*)> LBItemList;
765 void addListboxProperties(
void);
787 #if defined(_MSC_VER)
788 # pragma warning(pop)
791 #endif // end of guard _CEGUIListbox_h_
static const String EventMultiselectModeChanged
Definition: widgets/Listbox.h:114
bool d_itemTooltips
true if each item should have an individual tooltip
Definition: widgets/Listbox.h:754
static const String EventVertScrollbarModeChanged
Definition: widgets/Listbox.h:121
size_t getItemCount(void) const
Return number of items attached to the list box.
Definition: widgets/Listbox.h:146
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...
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: widgets/Listbox.h:753
static const String VertScrollbarName
Widget name for the vertical scrollbar component.
Definition: widgets/Listbox.h:133
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: widgets/Listbox.h:752
static const String EventNamespace
Namespace for global events.
Definition: widgets/Listbox.h:84
ListboxItem * d_lastSelected
holds pointer to the last selected item (used in range selections)
Definition: widgets/Listbox.h:756
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:50
static const String EventListContentsChanged
Definition: widgets/Listbox.h:95
static const String EventHorzScrollbarModeChanged
Definition: widgets/Listbox.h:128
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: widgets/Listbox.h:102
bool isMultiselectEnabled(void) const
return whether multi-select is enabled
Definition: widgets/Listbox.h:233
Base class for Listbox window renderer.
Definition: widgets/Listbox.h:51
Base class for standard Listbox widget.
Definition: widgets/Listbox.h:81
static const String WidgetTypeName
Window factory name.
Definition: widgets/Listbox.h:85
bool d_sorted
true if list is sorted
Definition: widgets/Listbox.h:750
static const String EventSortModeChanged
Definition: widgets/Listbox.h:108
LBItemList d_listItems
list of items in the list box.
Definition: widgets/Listbox.h:755
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:149
Base class for list box items.
Definition: ListboxItem.h:51
static const String HorzScrollbarName
Widget name for the horizontal scrollbar component.
Definition: widgets/Listbox.h:134
bool isSortEnabled(void) const
return whether list sorting is enabled
Definition: widgets/Listbox.h:224
bool d_multiselect
true if multi-select is enabled
Definition: widgets/Listbox.h:751
String class used within the GUI system.
Definition: String.h:62