30 #ifndef _CEGUIMultiColumnList_h_
31 #define _CEGUIMultiColumnList_h_
33 #include "../CEGUIBase.h"
34 #include "../CEGUIWindow.h"
35 #include "CEGUIListHeader.h"
36 #include "CEGUIMultiColumnListProperties.h"
40 # pragma warning(push)
41 # pragma warning(disable : 4251)
55 MCLGridRef(uint r, uint c) : row(r), column(c) {}
61 MCLGridRef& operator=(
const MCLGridRef& rhs);
62 bool operator<(
const MCLGridRef& rhs)
const;
64 bool operator>(
const MCLGridRef& rhs)
const;
92 virtual Rect getListRenderArea(
void)
const = 0;
196 NominatedColumnSingle,
197 NominatedColumnMultiple,
216 bool isUserSortControlEnabled(
void)
const;
226 bool isUserColumnSizingEnabled(
void)
const;
236 bool isUserColumnDraggingEnabled(
void)
const;
246 uint getColumnCount(
void)
const;
256 uint getRowCount(
void)
const;
269 uint getSortColumn(
void)
const;
284 uint getColumnWithID(uint col_id)
const;
299 uint getColumnWithHeaderText(
const String& text)
const;
309 UDim getTotalColumnHeadersWidth(
void)
const;
324 UDim getColumnHeaderWidth(uint col_idx)
const;
364 uint getItemRowIndex(
const ListboxItem* item)
const;
379 uint getItemColumnIndex(
const ListboxItem* item)
const;
428 bool isListboxItemInColumn(
const ListboxItem* item, uint col_idx)
const;
447 bool isListboxItemInRow(
const ListboxItem* item, uint row_idx)
const;
461 bool isListboxItemInList(
const ListboxItem* item)
const;
565 uint getSelectedCount(
void)
const;
581 bool isItemSelected(
const MCLGridRef& grid_ref)
const;
595 uint getNominatedSelectionColumnID(
void)
const;
606 uint getNominatedSelectionColumn(
void)
const;
617 uint getNominatedSelectionRow(
void)
const;
638 bool isVertScrollbarAlwaysShown(
void)
const;
649 bool isHorzScrollbarAlwaysShown(
void)
const;
664 uint getColumnID(uint col_idx)
const;
679 uint getRowID(uint row_idx)
const;
694 uint getRowWithID(uint row_id)
const;
706 Rect getListRenderArea(
void)
const;
752 float getTotalRowsHeight(
void)
const;
758 float getWidestColumnItemWidth(uint col_idx)
const;
764 float getHighestRowItemHeight(uint row_idx)
const;
775 bool getAutoSizeColumnUsesHeader()
const;
790 virtual void initialiseComponents(
void);
799 void resetList(
void);
818 void addColumn(
const String& text, uint col_id,
const UDim& width);
841 void insertColumn(
const String& text, uint col_id,
const UDim& width, uint position);
856 void removeColumn(uint col_idx);
871 void removeColumnWithID(uint col_id);
889 void moveColumn(uint col_idx, uint position);
907 void moveColumnWithID(uint col_id, uint position);
924 uint addRow(uint row_id = 0);
949 uint addRow(
ListboxItem* item, uint col_id, uint row_id = 0);
970 uint insertRow(uint row_idx, uint row_id = 0);
999 uint insertRow(
ListboxItem* item, uint col_id, uint row_idx, uint row_id = 0);
1014 void removeRow(uint row_idx);
1053 void setItem(
ListboxItem* item, uint col_id, uint row_idx);
1083 void setNominatedSelectionColumnID(uint col_id);
1098 void setNominatedSelectionColumn(uint col_idx);
1113 void setNominatedSelectionRow(uint row_idx);
1141 void setSortColumn(uint col_idx);
1156 void setSortColumnByID(uint col_id);
1170 void setShowVertScrollbar(
bool setting);
1184 void setShowHorzScrollbar(
bool setting);
1194 void clearAllSelections(
void);
1217 void setItemSelectState(
ListboxItem* item,
bool state);
1240 void setItemSelectState(
const MCLGridRef& grid_ref,
bool state);
1251 void handleUpdatedItemData(
void);
1269 void setColumnHeaderWidth(uint col_idx,
const UDim& width);
1283 void setUserSortControlEnabled(
bool setting);
1297 void setUserColumnSizingEnabled(
bool setting);
1308 void setUserColumnDraggingEnabled(
bool setting);
1324 void autoSizeColumnHeader(uint col_idx);
1342 void setRowID(uint row_idx, uint row_id);
1359 void ensureItemIsVisible(
const ListboxItem* item);
1373 void ensureItemIsVisible(
const MCLGridRef& grid_ref);
1390 void ensureItemRowIsVisible(
const ListboxItem* item);
1407 void ensureItemColumnIsVisible(
const ListboxItem* item);
1420 void ensureRowIsVisible(uint row_idx);
1433 void ensureColumnIsVisible(uint column_idx);
1447 void setAutoSizeColumnUsesHeader(
bool include_header);
1490 void configureScrollbars(
void);
1507 bool clearAllSelections_impl(
void);
1527 bool setItemSelectState_impl(
const MCLGridRef grid_ref,
bool state);
1534 void setSelectForItemsInRow(uint row_idx,
bool state);
1541 void setSelectForItemsInColumn(uint col_idx,
bool state);
1551 void moveColumn_impl(uint col_idx, uint position);
1565 bool resetList_impl(
void);
1580 if (class_name==
"MultiColumnList")
return true;
1588 return (name ==
"MultiColumnList");
1692 bool handleHeaderScroll(
const EventArgs& e);
1693 bool handleHeaderSegMove(
const EventArgs& e);
1694 bool handleColumnSizeChange(
const EventArgs& e);
1695 bool handleHorzScrollbar(
const EventArgs& e);
1696 bool handleVertScrollbar(
const EventArgs& e);
1697 bool handleSortColumnChange(
const EventArgs& e);
1698 bool handleSortDirectionChange(
const EventArgs& e);
1699 bool handleHeaderSegDblClick(
const EventArgs& e);
1708 typedef std::vector<ListboxItem*> RowItems;
1714 ListboxItem*
const& operator[](uint idx)
const {
return d_items[idx];}
1715 ListboxItem*& operator[](uint idx) {
return d_items[idx];}
1749 typedef std::vector<ListRow> ListItemGrid;
1780 void addMultiColumnListProperties(
void);
1785 #if defined(_MSC_VER)
1786 # pragma warning(pop)
1789 #endif // end of guard _CEGUIMultiColumnList_h_
bool d_useNominatedCol
true if we use a nominated col to select.
Definition: CEGUIMultiColumnList.h:1743
bool CEGUIEXPORT operator>(const String &str1, const String &str2)
Return true if String str1 is lexicographically greater than String str2.
Property to access the setting for user modification of the sort column & direction.
Definition: CEGUIMultiColumnListProperties.h:111
Class used as a two dimensional vector (aka a Point)
Definition: CEGUIVector.h:45
Base class for the multi column list window renderer.
Definition: CEGUIMultiColumnList.h:74
Property to access the setting for user sizing of the column headers.
Definition: CEGUIMultiColumnListProperties.h:59
static const String EventHorzScrollbarModeChanged
Definition: CEGUIMultiColumnList.h:138
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.
static const String ListHeaderNameSuffix
Widget name suffix for the list header component.
Definition: CEGUIMultiColumnList.h:181
bool d_forceHorzScroll
true if horizontal scrollbar should always be displayed
Definition: CEGUIMultiColumnList.h:1733
bool CEGUIEXPORT operator>=(const String &str1, const String &str2)
Return true if String str1 is lexicographically greater than or equal to String str2.
Property to access the number of rows in the list (read-only)
Definition: CEGUIMultiColumnListProperties.h:347
Base class used as the argument to all subscribers Event object.
Definition: CEGUIEventArgs.h:52
Property to access the sort direction setting of the list.
Definition: CEGUIMultiColumnListProperties.h:138
Property to access the setting for user moving of the column headers.
Definition: CEGUIMultiColumnListProperties.h:85
Property to access a column.
Definition: CEGUIMultiColumnListProperties.h:326
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
uint column
Zero based column index.
Definition: CEGUIMultiColumnList.h:58
static const String EventSortDirectionChanged
Definition: CEGUIMultiColumnList.h:162
static const String EventSortColumnChanged
Definition: CEGUIMultiColumnList.h:156
static const String WidgetTypeName
Window factory name.
Definition: CEGUIMultiColumnList.h:103
uint d_columnCount
keeps track of the number of columns.
Definition: CEGUIMultiColumnList.h:1746
Property to access the current sort column (via ID code).
Definition: CEGUIMultiColumnListProperties.h:163
uint row
Zero based row index.
Definition: CEGUIMultiColumnList.h:57
static const String EventNominatedSelectRowChanged
Definition: CEGUIMultiColumnList.h:126
Base-class for the assignable WindowRenderer object.
Definition: CEGUIWindowRenderer.h:51
Property to access the nominated selection column (via ID).
Definition: CEGUIMultiColumnListProperties.h:188
virtual bool validateWindowRenderer(const String &name) const
Function used in checking if a WindowRenderer is valid for this window.
Definition: CEGUIMultiColumnList.h:1586
static const String EventSelectionModeChanged
Definition: CEGUIMultiColumnList.h:114
uint d_nominatedSelectRow
Nominated row for single row selection.
Definition: CEGUIMultiColumnList.h:1738
static const String EventListContentsChanged
Definition: CEGUIMultiColumnList.h:150
static const String HorzScrollbarNameSuffix
Widget name suffix for the horizontal scrollbar component.
Definition: CEGUIMultiColumnList.h:180
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: CEGUIMultiColumnList.h:144
Property to access the selection mode setting of the list.
Definition: CEGUIMultiColumnListProperties.h:299
bool d_multiSelect
Allow multiple selections.
Definition: CEGUIMultiColumnList.h:1739
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: CEGUIMultiColumnList.h:190
bool d_autoSizeColumnUsesHeader
whether header size will be considered when auto-sizing columns.
Definition: CEGUIMultiColumnList.h:1753
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 EventVertScrollbarModeChanged
Definition: CEGUIMultiColumnList.h:132
Struct used internally to represent a row in the list and also to ease sorting of the rows...
Definition: CEGUIMultiColumnList.h:1706
bool d_forceVertScroll
true if vertical scrollbar should always be displayed
Definition: CEGUIMultiColumnList.h:1732
Simple grid index structure.
Definition: CEGUIMultiColumnList.h:53
ListItemGrid d_grid
Holds the list box data.
Definition: CEGUIMultiColumnList.h:1750
uint d_nominatedSelectCol
Nominated column for single column selection.
Definition: CEGUIMultiColumnList.h:1737
Property to access whether the multi-column list will consider the width of the column header segment...
Definition: CEGUIMultiColumnListProperties.h:376
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: CEGUIMultiColumnList.h:1578
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: CEGUIMultiColumnList.h:1736
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: CEGUIInputEvent.h:245
static const String VertScrollbarNameSuffix
Widget name suffix for the vertical scrollbar component.
Definition: CEGUIMultiColumnList.h:179
static const String EventNominatedSelectColumnChanged
Definition: CEGUIMultiColumnList.h:120
Class representing a unified dimension; that is a dimension that has both a relative 'scale' portion ...
Definition: CEGUIUDim.h:47
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: CEGUIInputEvent.h:274
Base class for the multi column list widget.
Definition: CEGUIMultiColumnList.h:99
bool d_fullColSelect
All items in a column are selected.
Definition: CEGUIMultiColumnList.h:1741
Class used to create XML Document.
Definition: CEGUIXMLSerializer.h:86
static const String EventListColumnMoved
Definition: CEGUIMultiColumnList.h:174
static const String EventListColumnSized
Definition: CEGUIMultiColumnList.h:168
bool d_fullRowSelect
All items in a row are selected.
Definition: CEGUIMultiColumnList.h:1740
static const String EventNamespace
Namespace for global events.
Definition: CEGUIMultiColumnList.h:102
bool d_useNominatedRow
true if we use a nominated row to select.
Definition: CEGUIMultiColumnList.h:1742
Property to access the nominated selection row.
Definition: CEGUIMultiColumnListProperties.h:213
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44
String class used within the GUI system.
Definition: CEGUIString.h:57
ListboxItem * d_lastSelected
holds pointer to the last selected item (used in range selections)
Definition: CEGUIMultiColumnList.h:1744