Crazy Eddie's GUI System 0.8.7
widgets/MultiColumnList.h
1/***********************************************************************
2 created: 13/4/2004
3 author: Paul D Turner
4
5 purpose: Interface to base class for MultiColumnList widget
6*************************************************************************/
7/***************************************************************************
8 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining
11 * a copy of this software and associated documentation files (the
12 * "Software"), to deal in the Software without restriction, including
13 * without limitation the rights to use, copy, modify, merge, publish,
14 * distribute, sublicense, and/or sell copies of the Software, and to
15 * permit persons to whom the Software is furnished to do so, subject to
16 * the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 * OTHER DEALINGS IN THE SOFTWARE.
28 ***************************************************************************/
29#ifndef _CEGUIMultiColumnList_h_
30#define _CEGUIMultiColumnList_h_
31
32#include "../Base.h"
33#include "../Window.h"
34#include "./ListHeader.h"
35
36#if defined(_MSC_VER)
37# pragma warning(push)
38# pragma warning(disable : 4251)
39#endif
40
41
42// Start of CEGUI namespace section
43namespace CEGUI
44{
45
50struct CEGUIEXPORT MCLGridRef
51{
52 MCLGridRef(uint r, uint c) : row(r), column(c) {}
53
54 uint row;
55 uint column;
56
57 // operators
58 MCLGridRef& operator=(const MCLGridRef& rhs);
59 bool operator<(const MCLGridRef& rhs) const;
60 bool operator<=(const MCLGridRef& rhs) const;
61 bool operator>(const MCLGridRef& rhs) const;
62 bool operator>=(const MCLGridRef& rhs) const;
63 bool operator==(const MCLGridRef& rhs) const;
64 bool operator!=(const MCLGridRef& rhs) const;
65};
66
72{
73public:
79
89 virtual Rectf getListRenderArea(void) const = 0;
90};
91
96class CEGUIEXPORT MultiColumnList : public Window
97{
98public:
99 static const String EventNamespace;
100 static const String WidgetTypeName;
101
102 /*************************************************************************
103 Constants
104 *************************************************************************/
105 // Event names
172
173 /*************************************************************************
174 Child Widget name constants
175 *************************************************************************/
178 static const String ListHeaderName;
179
180 /*************************************************************************
181 Enumerations
182 *************************************************************************/
188 {
189 RowSingle, // Any single row may be selected. All items in the row are selected.
190 RowMultiple, // Multiple rows may be selected. All items in the row are selected.
191 CellSingle, // Any single cell may be selected.
192 CellMultiple, // Multiple cells bay be selected.
193 NominatedColumnSingle, // Any single item in a nominated column may be selected.
194 NominatedColumnMultiple, // Multiple items in a nominated column may be selected.
195 ColumnSingle, // Any single column may be selected. All items in the column are selected.
196 ColumnMultiple, // Multiple columns may be selected. All items in the column are selected.
197 NominatedRowSingle, // Any single item in a nominated row may be selected.
198 NominatedRowMultiple // Multiple items in a nominated row may be selected.
199 };
200
201
202 /*************************************************************************
203 Accessor Methods
204 *************************************************************************/
213 bool isUserSortControlEnabled(void) const;
214
215
224
225
234
235
243 uint getColumnCount(void) const;
244
245
253 uint getRowCount(void) const;
254
255
266 uint getSortColumn(void) const;
267 uint getSortColumnID(void) const;
268
281 uint getColumnWithID(uint col_id) const;
282
283
296 uint getColumnWithHeaderText(const String& text) const;
297
298
307
308
321 UDim getColumnHeaderWidth(uint col_idx) const;
322
323
332
333
347
348
361 uint getItemRowIndex(const ListboxItem* item) const;
362
363
376 uint getItemColumnIndex(const ListboxItem* item) const;
377
378
392
393
407
408
425 bool isListboxItemInColumn(const ListboxItem* item, uint col_idx) const;
426
427
444 bool isListboxItemInRow(const ListboxItem* item, uint row_idx) const;
445
446
458 bool isListboxItemInList(const ListboxItem* item) const;
459
460
479 ListboxItem* findColumnItemWithText(const String& text, uint col_idx, const ListboxItem* start_item) const;
480
481
500 ListboxItem* findRowItemWithText(const String& text, uint row_idx, const ListboxItem* start_item) const;
501
502
521 ListboxItem* findListItemWithText(const String& text, const ListboxItem* start_item) const;
522
523
535
536
552 ListboxItem* getNextSelected(const ListboxItem* start_item) const;
553
554
562 uint getSelectedCount(void) const;
563
564
578 bool isItemSelected(const MCLGridRef& grid_ref) const;
579
580
593
594
604
605
614 uint getNominatedSelectionRow(void) const;
615
616
625
626
636
637
647
648
661 uint getColumnID(uint col_idx) const;
662
663
676 uint getRowID(uint row_idx) const;
677
678
691 uint getRowWithID(uint row_id) const;
692
693
704
705
718
731
744
749 float getTotalRowsHeight(void) const;
750
755 float getWidestColumnItemWidth(uint col_idx) const;
756
761 float getHighestRowItemHeight(uint row_idx) const;
762
773
774 /*************************************************************************
775 Manipulator Methods
776 *************************************************************************/
787 virtual void initialiseComponents(void);
788
789
796 void resetList(void);
797
798
815 void addColumn(const String& text, uint col_id, const UDim& width);
816 void addColumn(const String& value);
817
838 void insertColumn(const String& text, uint col_id, const UDim& width, uint position);
839
840
853 void removeColumn(uint col_idx);
854
855
868 void removeColumnWithID(uint col_id);
869
870
886 void moveColumn(uint col_idx, uint position);
887
888
904 void moveColumnWithID(uint col_id, uint position);
905
906
921 uint addRow(uint row_id = 0);
922
923
946 uint addRow(ListboxItem* item, uint col_id, uint row_id = 0);
947
948
967 uint insertRow(uint row_idx, uint row_id = 0);
968
969
996 uint insertRow(ListboxItem* item, uint col_id, uint row_idx, uint row_id = 0);
997
998
1011 void removeRow(uint row_idx);
1012
1013
1029 void setItem(ListboxItem* item, const MCLGridRef& position);
1030
1031
1050 void setItem(ListboxItem* item, uint col_id, uint row_idx);
1051
1052
1066
1067
1081
1082
1096
1097
1110 void setNominatedSelectionRow(uint row_idx);
1111
1112
1124
1125
1138 void setSortColumn(uint col_idx);
1139
1140
1153 void setSortColumnByID(uint col_id);
1154
1155
1167 void setShowVertScrollbar(bool setting);
1168
1169
1181 void setShowHorzScrollbar(bool setting);
1182
1183
1192
1193
1214 void setItemSelectState(ListboxItem* item, bool state);
1215
1216
1237 void setItemSelectState(const MCLGridRef& grid_ref, bool state);
1238
1239
1249
1250
1266 void setColumnHeaderWidth(uint col_idx, const UDim& width);
1267
1268
1280 void setUserSortControlEnabled(bool setting);
1281
1282
1294 void setUserColumnSizingEnabled(bool setting);
1295
1296
1306
1307
1321 void autoSizeColumnHeader(uint col_idx);
1322
1323
1339 void setRowID(uint row_idx, uint row_id);
1340
1357
1370 void ensureItemIsVisible(const MCLGridRef& grid_ref);
1371
1388
1405
1417 void ensureRowIsVisible(uint row_idx);
1418
1430 void ensureColumnIsVisible(uint column_idx);
1431
1444 void setAutoSizeColumnUsesHeader(bool include_header);
1445
1446
1447 /*************************************************************************
1448 Construction and Destruction
1449 *************************************************************************/
1454 MultiColumnList(const String& type, const String& name);
1455
1456
1461 virtual ~MultiColumnList(void);
1462
1463
1464protected:
1465 /*************************************************************************
1466 Implementation Functions (abstract interface)
1467 *************************************************************************/
1477 //virtual Rect getListRenderArea_impl(void) const = 0;
1478
1479
1480 /*************************************************************************
1481 Implementation Functions
1482 *************************************************************************/
1488
1489
1494 bool selectRange(const MCLGridRef& start, const MCLGridRef& end);
1495
1496
1505
1506
1516
1517
1524 bool setItemSelectState_impl(const MCLGridRef grid_ref, bool state);
1525
1526
1531 void setSelectForItemsInRow(uint row_idx, bool state);
1532
1533
1538 void setSelectForItemsInColumn(uint col_idx, bool state);
1539
1540
1548 void moveColumn_impl(uint col_idx, uint position);
1549
1550
1562 bool resetList_impl(void);
1563
1564 // overrides function in base class.
1565 virtual bool validateWindowRenderer(const WindowRenderer* renderer) const;
1566
1567 // overrides function in base class.
1568 int writePropertiesXML(XMLSerializer& xml_stream) const;
1569
1575
1576 /*************************************************************************
1577 New event handlers for multi column list
1578 *************************************************************************/
1584
1585
1591
1592
1598
1599
1605
1606
1612
1613
1619
1620
1626
1627
1633
1634
1640
1641
1647
1648
1654
1655
1656 /*************************************************************************
1657 Overridden Event handlers
1658 *************************************************************************/
1660 virtual void onSized(ElementEventArgs& e);
1663
1664
1665 /*************************************************************************
1666 Handlers for subscribed events
1667 *************************************************************************/
1668 bool handleHeaderScroll(const EventArgs& e);
1669 bool handleHeaderSegMove(const EventArgs& e);
1670 bool handleColumnSizeChange(const EventArgs& e);
1671 bool handleHorzScrollbar(const EventArgs& e);
1672 bool handleVertScrollbar(const EventArgs& e);
1673 bool handleSortColumnChange(const EventArgs& e);
1674 bool handleSortDirectionChange(const EventArgs& e);
1675 bool handleHeaderSegDblClick(const EventArgs& e);
1676
1682 struct ListRow
1683 {
1684 typedef std::vector<ListboxItem*
1685 CEGUI_VECTOR_ALLOC(ListboxItem*)> RowItems;
1686 RowItems d_items;
1687 uint d_sortColumn;
1688 uint d_rowID;
1689
1690 // operators
1691 ListboxItem* const& operator[](uint idx) const {return d_items[idx];}
1692 ListboxItem*& operator[](uint idx) {return d_items[idx];}
1693 bool operator<(const ListRow& rhs) const;
1694 bool operator>(const ListRow& rhs) const;
1695 };
1696
1697
1702 static bool pred_descend(const ListRow& a, const ListRow& b);
1703
1704
1705 /*************************************************************************
1706 Implementation Data
1707 *************************************************************************/
1708 // scrollbar settings.
1711
1712 // selection abilities.
1722
1724
1725 // storage of items in the list box.
1726 typedef std::vector<ListRow
1727 CEGUI_VECTOR_ALLOC(ListRow)> ListItemGrid;
1728 ListItemGrid d_grid;
1729
1732
1733 friend class MultiColumnListWindowRenderer;
1734
1735
1736private:
1737 /*************************************************************************
1738 Private methods
1739 *************************************************************************/
1740 void addMultiColumnListProperties(void);
1741};
1742
1743
1744template<>
1745class PropertyHelper<MultiColumnList::SelectionMode>
1746{
1747public:
1751 typedef String string_return_type;
1752
1753 static const String& getDataTypeName()
1754 {
1755 static String type("SelectionMode");
1756
1757 return type;
1758 }
1759
1760 static return_type fromString(const String& str)
1761 {
1763
1764 if (str == "RowMultiple")
1765 {
1766 mode = MultiColumnList::RowMultiple;
1767 }
1768 else if (str == "ColumnSingle")
1769 {
1770 mode = MultiColumnList::ColumnSingle;
1771 }
1772 else if (str == "ColumnMultiple")
1773 {
1774 mode = MultiColumnList::ColumnMultiple;
1775 }
1776 else if (str == "CellSingle")
1777 {
1778 mode = MultiColumnList::CellSingle;
1779 }
1780 else if (str == "CellMultiple")
1781 {
1782 mode = MultiColumnList::CellMultiple;
1783 }
1784 else if (str == "NominatedColumnSingle")
1785 {
1786 mode = MultiColumnList::NominatedColumnSingle;
1787 }
1788 else if (str == "NominatedColumnMultiple")
1789 {
1790 mode = MultiColumnList::NominatedColumnMultiple;
1791 }
1792 else if (str == "NominatedRowSingle")
1793 {
1794 mode = MultiColumnList::NominatedRowSingle;
1795 }
1796 else if (str == "NominatedRowMultiple")
1797 {
1798 mode = MultiColumnList::NominatedRowMultiple;
1799 }
1800 else
1801 {
1802 mode = MultiColumnList::RowSingle;
1803 }
1804 return mode;
1805 }
1806
1807 static string_return_type toString(pass_type val)
1808 {
1809 switch(val)
1810 {
1811 case MultiColumnList::RowMultiple:
1812 return String("RowMultiple");
1813 break;
1814
1815 case MultiColumnList::ColumnSingle:
1816 return String("ColumnSingle");
1817 break;
1818
1819 case MultiColumnList::ColumnMultiple:
1820 return String("ColumnMultiple");
1821 break;
1822
1823 case MultiColumnList::CellSingle:
1824 return String("CellSingle");
1825 break;
1826
1827 case MultiColumnList::CellMultiple:
1828 return String("CellMultiple");
1829 break;
1830
1831 case MultiColumnList::NominatedColumnSingle:
1832 return String("NominatedColumnSingle");
1833 break;
1834
1835 case MultiColumnList::NominatedColumnMultiple:
1836 return String("NominatedColumnMultiple");
1837 break;
1838
1839 case MultiColumnList::NominatedRowSingle:
1840 return String("NominatedRowSingle");
1841 break;
1842
1843 case MultiColumnList::NominatedRowMultiple:
1844 return String("NominatedRowMultiple");
1845 break;
1846
1847 default:
1848 return String("RowSingle");
1849 break;
1850 }
1851 }
1852};
1853
1854
1855} // End of CEGUI namespace section
1856
1857#if defined(_MSC_VER)
1858# pragma warning(pop)
1859#endif
1860
1861#endif // end of guard _CEGUIMultiColumnList_h_
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:211
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:51
Base class for list header segment window.
Definition: widgets/ListHeaderSegment.h:50
SortDirection
Enumeration of possible values for sorting direction used with ListHeaderSegment classes.
Definition: widgets/ListHeaderSegment.h:133
Base class for the multi column list header widget.
Definition: widgets/ListHeader.h:104
Base class for list box items.
Definition: ListboxItem.h:53
EventArgs based class that is used for objects passed to input event handlers concerning mouse input.
Definition: InputEvent.h:281
Base class for the multi column list window renderer.
Definition: widgets/MultiColumnList.h:72
MultiColumnListWindowRenderer(const String &name)
Constructor.
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...
Base class for the multi column list widget.
Definition: widgets/MultiColumnList.h:97
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: widgets/MultiColumnList.h:1710
MultiColumnList::SelectionMode getSelectionMode(void) const
Return the currently set selection mode.
ListHeader * getListHeader() const
Return a pointer to the list header component widget for this MultiColumnList.
void setSortColumn(uint col_idx)
Set the column to be used as the sort key.
uint getColumnCount(void) const
Return the number of columns in the multi-column list.
void ensureItemIsVisible(const ListboxItem *item)
Ensure the specified item is made visible within the multi-column listbox.
bool d_autoSizeColumnUsesHeader
whether header size will be considered when auto-sizing columns.
Definition: widgets/MultiColumnList.h:1731
SelectionMode
Enumerated values for the selection modes possible with a Multi-column list.
Definition: widgets/MultiColumnList.h:188
bool isUserColumnSizingEnabled(void) const
Return whether the user may size column segments.
void setShowVertScrollbar(bool setting)
Set whether the vertical scroll bar should always be shown, or just when needed.
virtual void onSortDirectionChanged(WindowEventArgs &e)
Handler called when the sort direction changes.
bool selectRange(const MCLGridRef &start, const MCLGridRef &end)
select all strings between positions start and end. (inclusive). Returns true if something was modifi...
ListboxItem * findListItemWithText(const String &text, const ListboxItem *start_item) const
Return the ListboxItem that has the text string text.
virtual void onMouseWheel(MouseEventArgs &e)
Handler called when the mouse wheel (z-axis) position changes within this window's area.
uint getNominatedSelectionRow(void) const
Return the index of the currently set nominated selection row to be used when in one of the Nominated...
void setShowHorzScrollbar(bool setting)
Set whether the horizontal scroll bar should always be shown, or just when needed.
uint getColumnID(uint col_idx) const
Return the ID code assigned to the requested column.
virtual void onListContentsChanged(WindowEventArgs &e)
Handler called when the list contents is changed.
uint getNominatedSelectionColumnID(void) const
Return the ID of the currently set nominated selection column to be used when in one of the Nominated...
void setUserColumnSizingEnabled(bool setting)
Set whether the user may size column segments.
virtual bool validateWindowRenderer(const WindowRenderer *renderer) const
Function used in checking if a WindowRenderer is valid for this window.
bool d_multiSelect
Allow multiple selections.
Definition: widgets/MultiColumnList.h:1716
void ensureItemIsVisible(const MCLGridRef &grid_ref)
Ensure the item at the specified grid coordinate is visible within the multi-column listbox.
uint getColumnWithID(uint col_id) const
Return the zero based column index of the column with the specified ID.
static const String EventListContentsChanged
Definition: widgets/MultiColumnList.h:147
uint d_columnCount
keeps track of the number of columns.
Definition: widgets/MultiColumnList.h:1723
MCLGridRef getItemGridReference(const ListboxItem *item) const
Return the grid reference for item.
static const String EventHorzScrollbarModeChanged
Definition: widgets/MultiColumnList.h:135
void setSortColumnByID(uint col_id)
Set the column to be used as the sort key.
ListboxItem * getNextSelected(const ListboxItem *start_item) const
Return a pointer to the next selected ListboxItem after start_item.
static const String ListHeaderName
Widget name for the list header component.
Definition: widgets/MultiColumnList.h:178
virtual void onMouseButtonDown(MouseEventArgs &e)
Handler called when a mouse button has been depressed within this window's area.
uint insertRow(uint row_idx, uint row_id=0)
Insert an empty row into the list box.
void setNominatedSelectionRow(uint row_idx)
Set the row to be used for the NominatedRow* selection modes.
ListboxItem * getFirstSelectedItem(void) const
Return a pointer to the first selected ListboxItem attached to this list box.
void addColumn(const String &text, uint col_id, const UDim &width)
Add a column to the list box.
SelectionMode d_selectMode
Holds selection mode (represented by settings below).
Definition: widgets/MultiColumnList.h:1713
ListboxItem * findRowItemWithText(const String &text, uint row_idx, const ListboxItem *start_item) const
Return the ListboxItem in row row_idx that has the text string text.
static const String EventListColumnSized
Definition: widgets/MultiColumnList.h:165
static const String EventListColumnMoved
Definition: widgets/MultiColumnList.h:171
void setSortDirection(ListHeaderSegment::SortDirection direction)
Set the sort direction to be used.
uint getItemRowIndex(const ListboxItem *item) const
Return the zero based index of the Row that contains item.
static const String VertScrollbarName
Widget name for the vertical scrollbar component.
Definition: widgets/MultiColumnList.h:176
virtual void onFontChanged(WindowEventArgs &e)
Handler called when the window's font is changed.
MultiColumnList(const String &type, const String &name)
Constructor for the Multi-column list base class.
void setItem(ListboxItem *item, const MCLGridRef &position)
Set the ListboxItem for grid reference position.
void resortList()
Causes the internal list to be (re)sorted.
void moveColumn(uint col_idx, uint position)
Move the column at index col_idx so it is at index position.
void removeRow(uint row_idx)
Remove the list box row with index row_idx. Any ListboxItem in row row_idx using autoDelete mode will...
void removeColumn(uint col_idx)
Removes a column from the list box. This will cause any ListboxItem using the autoDelete option in th...
float getHighestRowItemHeight(uint row_idx) const
Return, in pixels, the height of the highest item in the given row.
void ensureItemRowIsVisible(const ListboxItem *item)
Ensure that the row of the item is visible within the multi-column listbox.
ListHeaderSegment & getHeaderSegmentForColumn(uint col_idx) const
Return the ListHeaderSegment object for the specified column.
static const String EventSelectionModeChanged
Definition: widgets/MultiColumnList.h:111
uint getNominatedSelectionColumn(void) const
Return the index of the currently set nominated selection column to be used when in one of the Nomina...
void setUserColumnDraggingEnabled(bool setting)
Set whether the user may modify the order of the columns.
static const String HorzScrollbarName
Widget name for the horizontal scrollbar component.
Definition: widgets/MultiColumnList.h:177
uint getSortColumn(void) const
Return the zero based index of the current sort column. There must be at least one column to successf...
virtual void onSelectionModeChanged(WindowEventArgs &e)
Handler called when the selection mode of the list box changes.
bool d_useNominatedCol
true if we use a nominated col to select.
Definition: widgets/MultiColumnList.h:1720
void setItemSelectState(ListboxItem *item, bool state)
Sets or clears the selected state of the given ListboxItem which must be attached to the list.
ListboxItem * findColumnItemWithText(const String &text, uint col_idx, const ListboxItem *start_item) const
Return the ListboxItem in column col_idx that has the text string text.
bool resetList_impl(void)
Remove all items from the list.
UDim getColumnHeaderWidth(uint col_idx) const
Return the width of the specified column header (and therefore the column itself).
float getTotalRowsHeight(void) const
Return the sum of all row heights in pixels.
ListboxItem * getItemAtGridReference(const MCLGridRef &grid_ref) const
Return a pointer to the ListboxItem at the specified grid reference.
void setItemSelectState(const MCLGridRef &grid_ref, bool state)
Sets or clears the selected state of the ListboxItem at the given grid reference.
void ensureItemColumnIsVisible(const ListboxItem *item)
Ensure that the column of item is visible within the multi-column listbox.
Scrollbar * getVertScrollbar() const
Return a pointer to the vertical scrollbar component widget for this MultiColumnList.
virtual void onNominatedSelectRowChanged(WindowEventArgs &e)
Handler called when the nominated selection row changes.
void setColumnHeaderWidth(uint col_idx, const UDim &width)
Set the width of the specified column header (and therefore the column itself).
virtual void onNominatedSelectColumnChanged(WindowEventArgs &e)
Handler called when the nominated selection column changes.
uint getRowCount(void) const
Return the number of rows in the multi-column list.
uint d_nominatedSelectCol
Nominated column for single column selection.
Definition: widgets/MultiColumnList.h:1714
uint insertRow(ListboxItem *item, uint col_id, uint row_idx, uint row_id=0)
Insert a row into the list box, and set the item in the column with ID col_id to item.
bool d_useNominatedRow
true if we use a nominated row to select.
Definition: widgets/MultiColumnList.h:1719
virtual void onSized(ElementEventArgs &e)
Handler called when the window's size changes.
UDim getTotalColumnHeadersWidth(void) const
Return the total width of all column headers.
bool setItemSelectState_impl(const MCLGridRef grid_ref, bool state)
Set select state for the given item. This appropriately selects other items depending upon the select...
void setItem(ListboxItem *item, uint col_id, uint row_idx)
Set the ListboxItem for the column with ID col_id in row row_idx.
ListHeaderSegment::SortDirection getSortDirection(void) const
Return the currently set sort direction.
Rectf getListRenderArea(void) const
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
bool isListboxItemInList(const ListboxItem *item) const
return whether ListboxItem item is attached to the list box.
static const String EventNominatedSelectRowChanged
Definition: widgets/MultiColumnList.h:123
uint getRowID(uint row_idx) const
Return the ID code assigned to the requested row.
uint getSelectedCount(void) const
Return the number of selected ListboxItems attached to this list box.
ListboxItem * getItemAtPoint(const Vector2f &pt) const
Return the ListboxItem under the given window local pixel co-ordinate.
static const String EventNominatedSelectColumnChanged
Definition: widgets/MultiColumnList.h:117
bool isListboxItemInRow(const ListboxItem *item, uint row_idx) const
return whether ListboxItem item is attached to the row at index row_idx.
void ensureRowIsVisible(uint row_idx)
Ensure that the row with index row_idx is visible within the multi-column listbox.
virtual void onListColumnSized(WindowEventArgs &e)
Handler called when a column is sized.
bool isItemSelected(const MCLGridRef &grid_ref) const
Return whether the ListboxItem at grid_ref is selected.
void setSelectionMode(MultiColumnList::SelectionMode sel_mode)
Set the selection mode for the list box.
bool clearAllSelections_impl(void)
Clear the selected state for all items (implementation)
virtual void onSortColumnChanged(WindowEventArgs &e)
Handler called when the sort column changes.
static const String EventNamespace
Namespace for global events.
Definition: widgets/MultiColumnList.h:99
bool d_fullRowSelect
All items in a row are selected.
Definition: widgets/MultiColumnList.h:1717
static const String WidgetTypeName
Window factory name.
Definition: widgets/MultiColumnList.h:100
void setRowID(uint row_idx, uint row_id)
Set the ID code assigned to a given row.
void setSelectForItemsInColumn(uint col_idx, bool state)
Set select state for all items in the given column.
void resetList(void)
Remove all items from the list.
static const String EventSelectionChanged
Definition: widgets/MultiColumnList.h:141
void ensureColumnIsVisible(uint column_idx)
Ensure that the column with ID column_idx is visible within the multi-column listbox.
void removeColumnWithID(uint col_id)
Removes a column from the list box. This will cause any ListboxItem using the autoDelete option in th...
ListItemGrid d_grid
Holds the list box data.
Definition: widgets/MultiColumnList.h:1728
static const String EventSortColumnChanged
Definition: widgets/MultiColumnList.h:153
bool isUserColumnDraggingEnabled(void) const
Return whether the user may modify the order of the columns.
void configureScrollbars(void)
Return a Rect object describing, in un-clipped pixels, the window relative area that is to be used fo...
uint addRow(uint row_id=0)
Add an empty row to the list box.
virtual ~MultiColumnList(void)
Destructor for the multi-column list base class.
static const String EventVertScrollbarModeChanged
Definition: widgets/MultiColumnList.h:129
static const String EventSortDirectionChanged
Definition: widgets/MultiColumnList.h:159
bool isVertScrollbarAlwaysShown(void) const
Return whether the vertical scroll bar is always shown.
virtual void initialiseComponents(void)
Initialise the Window based object ready for use.
bool isUserSortControlEnabled(void) const
Return whether user manipulation of the sort column and direction are enabled.
void setSelectForItemsInRow(uint row_idx, bool state)
Set select state for all items in the given row.
void setNominatedSelectionColumn(uint col_idx)
Set the column to be used for the NominatedColumn* selection modes.
Scrollbar * getHorzScrollbar() const
Return a pointer to the horizontal scrollbar component widget for this MultiColumnList.
void insertColumn(const String &text, uint col_id, const UDim &width, uint position)
Insert a new column in the list.
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: widgets/MultiColumnList.h:1709
uint getItemColumnIndex(const ListboxItem *item) const
Return the current zero based index of the column that contains item.
uint d_nominatedSelectRow
Nominated row for single row selection.
Definition: widgets/MultiColumnList.h:1715
bool getAutoSizeColumnUsesHeader() const
Get whether or not column auto-sizing (autoSizeColumnHeader()) will use the list header segment size.
uint getRowWithID(uint row_id) const
Return the zero based row index of the row with the specified ID.
void moveColumn_impl(uint col_idx, uint position)
Move the column at index col_idx so it is at index position. Implementation version which does not mo...
void clearAllSelections(void)
Removed the selected state from any currently selected ListboxItem attached to the list.
uint addRow(ListboxItem *item, uint col_id, uint row_id=0)
Add a row to the list box, and set the item in the column with ID col_id to item.
ListboxItem * d_lastSelected
holds pointer to the last selected item (used in range selections)
Definition: widgets/MultiColumnList.h:1721
bool isListboxItemInColumn(const ListboxItem *item, uint col_idx) const
return whether ListboxItem item is attached to the column at index col_idx.
virtual void onHorzScrollbarModeChanged(WindowEventArgs &e)
Handler called when the horizontal scroll bar 'force' mode is changed.
bool d_fullColSelect
All items in a column are selected.
Definition: widgets/MultiColumnList.h:1718
void setNominatedSelectionColumnID(uint col_id)
Set the column to be used for the NominatedColumn* selection modes.
float getWidestColumnItemWidth(uint col_idx) const
Return the pixel width of the widest item in the given column.
virtual void onListColumnMoved(WindowEventArgs &e)
Handler called when the column order is changed.
void setAutoSizeColumnUsesHeader(bool include_header)
Instruct column auto-sizing (autoSizeColumnHeader()) to also use the list header segment size.
bool isHorzScrollbarAlwaysShown(void) const
Return whether the horizontal scroll bar is always shown.
virtual void onSelectionChanged(WindowEventArgs &e)
Handler called when the current selection changes.
void handleUpdatedItemData(void)
Inform the list box that one or more attached ListboxItems have been externally modified,...
virtual void onVertScrollbarModeChanged(WindowEventArgs &e)
Handler called when the vertical scroll bar 'force' mode is changed.
static bool pred_descend(const ListRow &a, const ListRow &b)
std algorithm predicate used for sorting in descending order
void moveColumnWithID(uint col_id, uint position)
Move the column with ID col_id so it is at index position.
void setUserSortControlEnabled(bool setting)
Set whether user manipulation of the sort column and direction are enabled.
void autoSizeColumnHeader(uint col_idx)
Automatically determines the "best fit" size for the specified column and sets the column width to th...
uint getColumnWithHeaderText(const String &text) const
Return the zero based index of the column whos header text matches the specified text.
Helper class used to convert various data types to and from the format expected in Property strings.
Definition: ForwardRefs.h:84
Base scroll bar class.
Definition: widgets/Scrollbar.h:90
String class used within the GUI system.
Definition: String.h:64
Dimension that has both a relative 'scale' portion and and absolute 'offset' portion.
Definition: UDim.h:94
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:252
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:52
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
Class used to create XML Document.
Definition: XMLSerializer.h:87
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
bool CEGUIEXPORT operator<=(const String &str1, const String &str2)
Return true if String str1 is lexicographically less than or equal to String str2.
bool CEGUIEXPORT operator>(const String &str1, const String &str2)
Return true if String str1 is lexicographically greater than String str2.
bool CEGUIEXPORT operator<(const String &str1, const String &str2)
Return true if String str1 is lexicographically less than String str2.
bool CEGUIEXPORT operator>=(const String &str1, const String &str2)
Return true if String str1 is lexicographically greater than or equal to String str2.
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.
Simple grid index structure.
Definition: widgets/MultiColumnList.h:51
uint row
Zero based row index.
Definition: widgets/MultiColumnList.h:54
uint column
Zero based column index.
Definition: widgets/MultiColumnList.h:55
Struct used internally to represent a row in the list and also to ease sorting of the rows.
Definition: widgets/MultiColumnList.h:1683