29 #ifndef _CEGUIMultiColumnList_h_
30 #define _CEGUIMultiColumnList_h_
33 #include "../Window.h"
34 #include "./ListHeader.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
52 MCLGridRef(uint r, uint c) : row(r), column(c) {}
58 MCLGridRef& operator=(
const MCLGridRef& rhs);
59 bool operator<(
const MCLGridRef& rhs)
const;
61 bool operator>(
const MCLGridRef& rhs)
const;
89 virtual Rectf getListRenderArea(
void)
const = 0;
193 NominatedColumnSingle,
194 NominatedColumnMultiple,
213 bool isUserSortControlEnabled(
void)
const;
223 bool isUserColumnSizingEnabled(
void)
const;
233 bool isUserColumnDraggingEnabled(
void)
const;
243 uint getColumnCount(
void)
const;
253 uint getRowCount(
void)
const;
266 uint getSortColumn(
void)
const;
267 uint getSortColumnID(
void)
const;
281 uint getColumnWithID(uint col_id)
const;
296 uint getColumnWithHeaderText(
const String& text)
const;
306 UDim getTotalColumnHeadersWidth(
void)
const;
321 UDim getColumnHeaderWidth(uint col_idx)
const;
361 uint getItemRowIndex(
const ListboxItem* item)
const;
376 uint getItemColumnIndex(
const ListboxItem* item)
const;
425 bool isListboxItemInColumn(
const ListboxItem* item, uint col_idx)
const;
444 bool isListboxItemInRow(
const ListboxItem* item, uint row_idx)
const;
458 bool isListboxItemInList(
const ListboxItem* item)
const;
562 uint getSelectedCount(
void)
const;
578 bool isItemSelected(
const MCLGridRef& grid_ref)
const;
592 uint getNominatedSelectionColumnID(
void)
const;
603 uint getNominatedSelectionColumn(
void)
const;
614 uint getNominatedSelectionRow(
void)
const;
635 bool isVertScrollbarAlwaysShown(
void)
const;
646 bool isHorzScrollbarAlwaysShown(
void)
const;
661 uint getColumnID(uint col_idx)
const;
676 uint getRowID(uint row_idx)
const;
691 uint getRowWithID(uint row_id)
const;
703 Rectf getListRenderArea(
void)
const;
749 float getTotalRowsHeight(
void)
const;
755 float getWidestColumnItemWidth(uint col_idx)
const;
761 float getHighestRowItemHeight(uint row_idx)
const;
772 bool getAutoSizeColumnUsesHeader()
const;
787 virtual void initialiseComponents(
void);
796 void resetList(
void);
815 void addColumn(
const String& text, uint col_id,
const UDim& width);
816 void addColumn(
const String& value);
838 void insertColumn(
const String& text, uint col_id,
const UDim& width, uint position);
853 void removeColumn(uint col_idx);
868 void removeColumnWithID(uint col_id);
886 void moveColumn(uint col_idx, uint position);
904 void moveColumnWithID(uint col_id, uint position);
921 uint addRow(uint row_id = 0);
946 uint addRow(
ListboxItem* item, uint col_id, uint row_id = 0);
967 uint insertRow(uint row_idx, uint row_id = 0);
996 uint insertRow(
ListboxItem* item, uint col_id, uint row_idx, uint row_id = 0);
1011 void removeRow(uint row_idx);
1050 void setItem(
ListboxItem* item, uint col_id, uint row_idx);
1080 void setNominatedSelectionColumnID(uint col_id);
1095 void setNominatedSelectionColumn(uint col_idx);
1110 void setNominatedSelectionRow(uint row_idx);
1138 void setSortColumn(uint col_idx);
1153 void setSortColumnByID(uint col_id);
1167 void setShowVertScrollbar(
bool setting);
1181 void setShowHorzScrollbar(
bool setting);
1191 void clearAllSelections(
void);
1214 void setItemSelectState(
ListboxItem* item,
bool state);
1237 void setItemSelectState(
const MCLGridRef& grid_ref,
bool state);
1248 void handleUpdatedItemData(
void);
1266 void setColumnHeaderWidth(uint col_idx,
const UDim& width);
1280 void setUserSortControlEnabled(
bool setting);
1294 void setUserColumnSizingEnabled(
bool setting);
1305 void setUserColumnDraggingEnabled(
bool setting);
1321 void autoSizeColumnHeader(uint col_idx);
1339 void setRowID(uint row_idx, uint row_id);
1356 void ensureItemIsVisible(
const ListboxItem* item);
1370 void ensureItemIsVisible(
const MCLGridRef& grid_ref);
1387 void ensureItemRowIsVisible(
const ListboxItem* item);
1404 void ensureItemColumnIsVisible(
const ListboxItem* item);
1417 void ensureRowIsVisible(uint row_idx);
1430 void ensureColumnIsVisible(uint column_idx);
1444 void setAutoSizeColumnUsesHeader(
bool include_header);
1487 void configureScrollbars(
void);
1504 bool clearAllSelections_impl(
void);
1524 bool setItemSelectState_impl(
const MCLGridRef grid_ref,
bool state);
1531 void setSelectForItemsInRow(uint row_idx,
bool state);
1538 void setSelectForItemsInColumn(uint col_idx,
bool state);
1548 void moveColumn_impl(uint col_idx, uint position);
1562 bool resetList_impl(
void);
1565 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
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);
1691 ListboxItem*
const& operator[](uint idx)
const {
return d_items[idx];}
1692 ListboxItem*& operator[](uint idx) {
return d_items[idx];}
1727 CEGUI_VECTOR_ALLOC(
ListRow)> ListItemGrid;
1740 void addMultiColumnListProperties(
void);
1753 static const String& getDataTypeName()
1755 static String type(
"SelectionMode");
1760 static return_type fromString(
const String& str)
1764 if (str ==
"RowMultiple")
1766 mode = MultiColumnList::RowMultiple;
1768 else if (str ==
"ColumnSingle")
1770 mode = MultiColumnList::ColumnSingle;
1772 else if (str ==
"ColumnMultiple")
1774 mode = MultiColumnList::ColumnMultiple;
1776 else if (str ==
"CellSingle")
1778 mode = MultiColumnList::CellSingle;
1780 else if (str ==
"CellMultiple")
1782 mode = MultiColumnList::CellMultiple;
1784 else if (str ==
"NominatedColumnSingle")
1786 mode = MultiColumnList::NominatedColumnSingle;
1788 else if (str ==
"NominatedColumnMultiple")
1790 mode = MultiColumnList::NominatedColumnMultiple;
1792 else if (str ==
"NominatedRowSingle")
1794 mode = MultiColumnList::NominatedRowSingle;
1796 else if (str ==
"NominatedRowMultiple")
1798 mode = MultiColumnList::NominatedRowMultiple;
1802 mode = MultiColumnList::RowSingle;
1807 static string_return_type toString(pass_type val)
1811 case MultiColumnList::RowMultiple:
1812 return String(
"RowMultiple");
1815 case MultiColumnList::ColumnSingle:
1816 return String(
"ColumnSingle");
1819 case MultiColumnList::ColumnMultiple:
1820 return String(
"ColumnMultiple");
1823 case MultiColumnList::CellSingle:
1824 return String(
"CellSingle");
1827 case MultiColumnList::CellMultiple:
1828 return String(
"CellMultiple");
1831 case MultiColumnList::NominatedColumnSingle:
1832 return String(
"NominatedColumnSingle");
1835 case MultiColumnList::NominatedColumnMultiple:
1836 return String(
"NominatedColumnMultiple");
1839 case MultiColumnList::NominatedRowSingle:
1840 return String(
"NominatedRowSingle");
1843 case MultiColumnList::NominatedRowMultiple:
1844 return String(
"NominatedRowMultiple");
1848 return String(
"RowSingle");
1857 #if defined(_MSC_VER)
1858 # pragma warning(pop)
1861 #endif // end of guard _CEGUIMultiColumnList_h_
bool d_useNominatedCol
true if we use a nominated col to select.
Definition: widgets/MultiColumnList.h:1720
bool CEGUIEXPORT operator>(const String &str1, const String &str2)
Return true if String str1 is lexicographically greater than String str2.
Base class for the multi column list window renderer.
Definition: widgets/MultiColumnList.h:71
static const String EventHorzScrollbarModeChanged
Definition: widgets/MultiColumnList.h:135
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.
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/MultiColumnList.h:1710
bool CEGUIEXPORT operator>=(const String &str1, const String &str2)
Return true if String str1 is lexicographically greater than or equal to String str2.
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:49
uint column
Zero based column index.
Definition: widgets/MultiColumnList.h:55
static const String EventSortDirectionChanged
Definition: widgets/MultiColumnList.h:159
static const String EventSortColumnChanged
Definition: widgets/MultiColumnList.h:153
static const String WidgetTypeName
Window factory name.
Definition: widgets/MultiColumnList.h:100
uint d_columnCount
keeps track of the number of columns.
Definition: widgets/MultiColumnList.h:1723
uint row
Zero based row index.
Definition: widgets/MultiColumnList.h:54
static const String EventNominatedSelectRowChanged
Definition: widgets/MultiColumnList.h:123
Base-class for the assignable WindowRenderer object.
Definition: WindowRenderer.h:50
static const String EventSelectionModeChanged
Definition: widgets/MultiColumnList.h:111
uint d_nominatedSelectRow
Nominated row for single row selection.
Definition: widgets/MultiColumnList.h:1715
static const String EventListContentsChanged
Definition: widgets/MultiColumnList.h:147
bool CEGUIEXPORT operator<=(const String &str1, const String &str2)
Return true if String str1 is lexicographically less than or equal to String str2.
static const String EventSelectionChanged
Definition: widgets/MultiColumnList.h:141
bool d_multiSelect
Allow multiple selections.
Definition: widgets/MultiColumnList.h:1716
bool CEGUIEXPORT operator<(const String &str1, const String &str2)
Return true if String str1 is lexicographically less than String str2.
SelectionMode
Enumerated values for the selection modes possible with a Multi-column list.
Definition: widgets/MultiColumnList.h:187
bool d_autoSizeColumnUsesHeader
whether header size will be considered when auto-sizing columns.
Definition: widgets/MultiColumnList.h:1731
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
Helper class used to convert various data types to and from the format expected in Property strings...
Definition: ForwardRefs.h:84
static const String EventVertScrollbarModeChanged
Definition: widgets/MultiColumnList.h:129
Struct used internally to represent a row in the list and also to ease sorting of the rows...
Definition: widgets/MultiColumnList.h:1682
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: widgets/MultiColumnList.h:1709
Simple grid index structure.
Definition: widgets/MultiColumnList.h:50
ListItemGrid d_grid
Holds the list box data.
Definition: widgets/MultiColumnList.h:1728
uint d_nominatedSelectCol
Nominated column for single column selection.
Definition: widgets/MultiColumnList.h:1714
static const String HorzScrollbarName
Widget name for the horizontal scrollbar component.
Definition: widgets/MultiColumnList.h:177
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: Element.h:210
static const String VertScrollbarName
Widget name for the vertical scrollbar component.
Definition: widgets/MultiColumnList.h:176
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
SelectionMode d_selectMode
Holds selection mode (represented by settings below).
Definition: widgets/MultiColumnList.h:1713
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:251
static const String EventNominatedSelectColumnChanged
Definition: widgets/MultiColumnList.h:117
Dimension that has both a relative 'scale' portion and and absolute 'offset' portion.
Definition: UDim.h:92
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: InputEvent.h:280
Base class for the multi column list widget.
Definition: widgets/MultiColumnList.h:96
static const String ListHeaderName
Widget name for the list header component.
Definition: widgets/MultiColumnList.h:178
bool d_fullColSelect
All items in a column are selected.
Definition: widgets/MultiColumnList.h:1718
Class used to create XML Document.
Definition: XMLSerializer.h:85
static const String EventListColumnMoved
Definition: widgets/MultiColumnList.h:171
static const String EventListColumnSized
Definition: widgets/MultiColumnList.h:165
bool d_fullRowSelect
All items in a row are selected.
Definition: widgets/MultiColumnList.h:1717
static const String EventNamespace
Namespace for global events.
Definition: widgets/MultiColumnList.h:99
bool d_useNominatedRow
true if we use a nominated row to select.
Definition: widgets/MultiColumnList.h:1719
String class used within the GUI system.
Definition: String.h:62
ListboxItem * d_lastSelected
holds pointer to the last selected item (used in range selections)
Definition: widgets/MultiColumnList.h:1721