Crazy Eddie's GUI System
0.8.7
|
29 #ifndef _CEGUIListbox_h_
30 #define _CEGUIListbox_h_
33 #include "../Window.h"
38 # pragma warning(push)
39 # pragma warning(disable : 4251)
74 bool fit_height)
const = 0;
235 bool isItemTooltipsEnabled(
void)
const {
return d_itemTooltips;}
447 void setItemTooltipsEnabled(
bool setting);
765 void addListboxProperties(
void);
787 #if defined(_MSC_VER)
788 # pragma warning(pop)
791 #endif // end of guard _CEGUIListbox_h_
bool handle_scrollChange(const EventArgs &args)
Internal handler that is triggered when the user interacts with the scrollbars.
virtual void onMouseMove(MouseEventArgs &e)
Handler called when the mouse cursor has been moved within this window's area.
virtual void onHorzScrollbarModeChanged(WindowEventArgs &e)
Handler called internally when the forced display of the horizontal scroll bar setting changes.
void setSortingEnabled(bool setting)
Set whether the list should be sorted.
virtual void onMultiselectModeChanged(WindowEventArgs &e)
Handler called internally when the multi-select mode setting changes.
void setItemSelectState(ListboxItem *item, bool state)
Set the select state of an attached ListboxItem.
bool d_sorted
true if list is sorted
Definition: widgets/Listbox.h:750
void clearAllSelections(void)
Clear the selected state for all items.
static const String EventSelectionChanged
Definition: widgets/Listbox.h:102
static const String EventSortModeChanged
Definition: widgets/Listbox.h:108
static const String EventHorzScrollbarModeChanged
Definition: widgets/Listbox.h:128
virtual bool validateWindowRenderer(const WindowRenderer *renderer) const
Function used in checking if a WindowRenderer is valid for this window.
static const String WidgetTypeName
Window factory name.
Definition: widgets/Listbox.h:85
void insertItem(ListboxItem *item, const ListboxItem *position)
Insert an item into the list box before a specified item already in the list.
void addItem(ListboxItem *item)
Add the given ListboxItem to the list.
bool isVertScrollbarAlwaysShown(void) const
Return whether the vertical scroll bar is always shown.
LBItemList d_listItems
list of items in the list box.
Definition: widgets/Listbox.h:755
ListboxWindowRenderer(const String &name)
Constructor.
ListboxItem * getListboxItemFromIndex(size_t index) const
Return the item at index position index.
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:211
virtual void onMouseButtonDown(MouseEventArgs &e)
Handler called when a mouse button has been depressed within this window's area.
void setMultiselectEnabled(bool setting)
Set whether the list should allow multiple selections or just a single selection.
void resortList()
Causes the internal list to be (re)sorted.
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...
void setShowHorzScrollbar(bool setting)
Set whether the horizontal scroll bar should always be shown.
size_t getSelectedCount(void) const
Return the number of selected items in the list box.
static const String HorzScrollbarName
Widget name for the horizontal scrollbar component.
Definition: widgets/Listbox.h:134
Listbox(const String &type, const String &name)
Constructor for Listbox base class.
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
EventArgs based class that is used for objects passed to input event handlers concerning mouse input.
Definition: InputEvent.h:281
ListboxItem * getNextSelected(const ListboxItem *start_item) const
Return a pointer to the next selected item after item start_item.
void handleUpdatedItemData(void)
Causes the list box to update it's internal state after changes have been made to one or more attache...
size_t getItemCount(void) const
Return number of items attached to the list box.
Definition: widgets/Listbox.h:146
Scrollbar * getVertScrollbar() const
Return a pointer to the vertical scrollbar component widget for this Listbox.
Scrollbar * getHorzScrollbar() const
Return a pointer to the horizontal scrollbar component widget for this Listbox.
bool clearAllSelections_impl(void)
Clear the selected state for all items (implementation)
virtual void onListContentsChanged(WindowEventArgs &e)
Handler called internally when the list contents are changed.
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
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...
virtual void initialiseComponents(void)
Initialise the Window based object ready for use.
bool resetList_impl(void)
Remove all items from the list.
virtual Rectf getListRenderArea(void) const
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
virtual Rectf getListRenderArea(void) const =0
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
bool d_multiselect
true if multi-select is enabled
Definition: widgets/Listbox.h:751
virtual void onVertScrollbarModeChanged(WindowEventArgs &e)
Handler called internally when the forced display of the vertical scroll bar setting changes.
static const String EventMultiselectModeChanged
Definition: widgets/Listbox.h:114
void configureScrollbars(void)
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
float getTotalItemsHeight(void) const
Return the sum of all item heights.
Base class for Listbox window renderer.
Definition: widgets/Listbox.h:52
virtual ~Listbox(void)
Destructor for Listbox base class.
bool d_itemTooltips
true if each item should have an individual tooltip
Definition: widgets/Listbox.h:754
void ensureItemIsVisible(const ListboxItem *item)
Ensure the item at the specified index is visible within the list box.
static const String EventVertScrollbarModeChanged
Definition: widgets/Listbox.h:121
ListboxItem * getItemAtPoint(const Vector2f &pt) const
Return a pointer to the ListboxItem attached to this Listbox at the given screen pixel co-ordinate.
bool isListboxItemInList(const ListboxItem *item) const
Return whether the specified ListboxItem is in the List.
ListboxItem * findItemWithText(const String &text, const ListboxItem *start_item)
Search the list for an item with the specified text.
void resetList(void)
Remove all items from the list.
size_t getItemIndex(const ListboxItem *item) const
Return the index of ListboxItem item.
bool isHorzScrollbarAlwaysShown(void) const
Return whether the horizontal scroll bar is always shown.
virtual void onMouseWheel(MouseEventArgs &e)
Handler called when the mouse wheel (z-axis) position changes within this window's area.
virtual void resizeListToContent(bool fit_width, bool fit_height) const =0
void setShowVertScrollbar(bool setting)
Set whether the vertical scroll bar should always be shown.
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: widgets/Listbox.h:753
static const String EventNamespace
Namespace for global events.
Definition: widgets/Listbox.h:84
float getWidestItemWidth(void) const
Return the width of the widest item.
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
void removeItem(const ListboxItem *item)
Removes the given item from the list box. If the item is has the auto delete state set,...
virtual void onSized(ElementEventArgs &e)
Handler called when the window's size changes.
bool isItemSelected(size_t index) const
return whether the string at index position index is selected
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:52
virtual void onSortModeChanged(WindowEventArgs &e)
Handler called internally when the sort mode setting changes.
void selectRange(size_t start, size_t end)
select all strings between positions start and end. (inclusive) including end.
ListboxItem * getFirstSelectedItem(void) const
Return a pointer to the first selected item.
static const String VertScrollbarName
Widget name for the vertical scrollbar component.
Definition: widgets/Listbox.h:133
ListboxItem * d_lastSelected
holds pointer to the last selected item (used in range selections)
Definition: widgets/Listbox.h:756
virtual void onSelectionChanged(WindowEventArgs &e)
Handler called internally when the currently selected item or items changes.
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: widgets/Listbox.h:752
void ensureItemIsVisible(size_t item_index)
Ensure the item at the specified index is visible within the list box.
String class used within the GUI system.
Definition: String.h:64
bool isSortEnabled(void) const
return whether list sorting is enabled
Definition: widgets/Listbox.h:224
void setItemSelectState(size_t item_index, bool state)
Set the select state of an attached ListboxItem.
bool isMultiselectEnabled(void) const
return whether multi-select is enabled
Definition: widgets/Listbox.h:233
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
static const String EventListContentsChanged
Definition: widgets/Listbox.h:95
Base class for list box items.
Definition: ListboxItem.h:53
Base class for standard Listbox widget.
Definition: widgets/Listbox.h:82