30 #ifndef _CEGUIMultiColumnList_h_
31 #define _CEGUIMultiColumnList_h_
34 #include "../Window.h"
35 #include "./ListHeader.h"
38 # pragma warning(push)
39 # pragma warning(disable : 4251)
53 MCLGridRef(uint r, uint c) : row(r), column(c) {}
59 MCLGridRef& operator=(
const MCLGridRef& rhs);
60 bool operator<(
const MCLGridRef& rhs)
const;
62 bool operator>(
const MCLGridRef& rhs)
const;
90 virtual Rectf getListRenderArea(
void)
const = 0;
194 NominatedColumnSingle,
195 NominatedColumnMultiple,
214 bool isUserSortControlEnabled(
void)
const;
224 bool isUserColumnSizingEnabled(
void)
const;
234 bool isUserColumnDraggingEnabled(
void)
const;
244 uint getColumnCount(
void)
const;
254 uint getRowCount(
void)
const;
267 uint getSortColumn(
void)
const;
268 uint getSortColumnID(
void)
const;
282 uint getColumnWithID(uint col_id)
const;
297 uint getColumnWithHeaderText(
const String& text)
const;
307 UDim getTotalColumnHeadersWidth(
void)
const;
322 UDim getColumnHeaderWidth(uint col_idx)
const;
362 uint getItemRowIndex(
const ListboxItem* item)
const;
377 uint getItemColumnIndex(
const ListboxItem* item)
const;
426 bool isListboxItemInColumn(
const ListboxItem* item, uint col_idx)
const;
445 bool isListboxItemInRow(
const ListboxItem* item, uint row_idx)
const;
459 bool isListboxItemInList(
const ListboxItem* item)
const;
563 uint getSelectedCount(
void)
const;
579 bool isItemSelected(
const MCLGridRef& grid_ref)
const;
593 uint getNominatedSelectionColumnID(
void)
const;
604 uint getNominatedSelectionColumn(
void)
const;
615 uint getNominatedSelectionRow(
void)
const;
636 bool isVertScrollbarAlwaysShown(
void)
const;
647 bool isHorzScrollbarAlwaysShown(
void)
const;
662 uint getColumnID(uint col_idx)
const;
677 uint getRowID(uint row_idx)
const;
692 uint getRowWithID(uint row_id)
const;
704 Rectf getListRenderArea(
void)
const;
750 float getTotalRowsHeight(
void)
const;
756 float getWidestColumnItemWidth(uint col_idx)
const;
762 float getHighestRowItemHeight(uint row_idx)
const;
773 bool getAutoSizeColumnUsesHeader()
const;
788 virtual void initialiseComponents(
void);
797 void resetList(
void);
816 void addColumn(
const String& text, uint col_id,
const UDim& width);
817 void addColumn(
const String& value);
839 void insertColumn(
const String& text, uint col_id,
const UDim& width, uint position);
854 void removeColumn(uint col_idx);
869 void removeColumnWithID(uint col_id);
887 void moveColumn(uint col_idx, uint position);
905 void moveColumnWithID(uint col_id, uint position);
922 uint addRow(uint row_id = 0);
947 uint addRow(
ListboxItem* item, uint col_id, uint row_id = 0);
968 uint insertRow(uint row_idx, uint row_id = 0);
997 uint insertRow(
ListboxItem* item, uint col_id, uint row_idx, uint row_id = 0);
1012 void removeRow(uint row_idx);
1051 void setItem(
ListboxItem* item, uint col_id, uint row_idx);
1081 void setNominatedSelectionColumnID(uint col_id);
1096 void setNominatedSelectionColumn(uint col_idx);
1111 void setNominatedSelectionRow(uint row_idx);
1139 void setSortColumn(uint col_idx);
1154 void setSortColumnByID(uint col_id);
1168 void setShowVertScrollbar(
bool setting);
1182 void setShowHorzScrollbar(
bool setting);
1192 void clearAllSelections(
void);
1215 void setItemSelectState(
ListboxItem* item,
bool state);
1238 void setItemSelectState(
const MCLGridRef& grid_ref,
bool state);
1249 void handleUpdatedItemData(
void);
1267 void setColumnHeaderWidth(uint col_idx,
const UDim& width);
1281 void setUserSortControlEnabled(
bool setting);
1295 void setUserColumnSizingEnabled(
bool setting);
1306 void setUserColumnDraggingEnabled(
bool setting);
1322 void autoSizeColumnHeader(uint col_idx);
1340 void setRowID(uint row_idx, uint row_id);
1357 void ensureItemIsVisible(
const ListboxItem* item);
1371 void ensureItemIsVisible(
const MCLGridRef& grid_ref);
1388 void ensureItemRowIsVisible(
const ListboxItem* item);
1405 void ensureItemColumnIsVisible(
const ListboxItem* item);
1418 void ensureRowIsVisible(uint row_idx);
1431 void ensureColumnIsVisible(uint column_idx);
1445 void setAutoSizeColumnUsesHeader(
bool include_header);
1488 void configureScrollbars(
void);
1505 bool clearAllSelections_impl(
void);
1525 bool setItemSelectState_impl(
const MCLGridRef grid_ref,
bool state);
1532 void setSelectForItemsInRow(uint row_idx,
bool state);
1539 void setSelectForItemsInColumn(uint col_idx,
bool state);
1549 void moveColumn_impl(uint col_idx, uint position);
1563 bool resetList_impl(
void);
1566 virtual bool validateWindowRenderer(
const WindowRenderer* renderer)
const;
1669 bool handleHeaderScroll(
const EventArgs& e);
1670 bool handleHeaderSegMove(
const EventArgs& e);
1671 bool handleColumnSizeChange(
const EventArgs& e);
1672 bool handleHorzScrollbar(
const EventArgs& e);
1673 bool handleVertScrollbar(
const EventArgs& e);
1674 bool handleSortColumnChange(
const EventArgs& e);
1675 bool handleSortDirectionChange(
const EventArgs& e);
1676 bool handleHeaderSegDblClick(
const EventArgs& e);
1692 ListboxItem*
const& operator[](uint idx)
const {
return d_items[idx];}
1693 ListboxItem*& operator[](uint idx) {
return d_items[idx];}
1728 CEGUI_VECTOR_ALLOC(
ListRow)> ListItemGrid;
1741 void addMultiColumnListProperties(
void);
1754 static const String& getDataTypeName()
1756 static String type(
"SelectionMode");
1765 if (str ==
"RowMultiple")
1767 mode = MultiColumnList::RowMultiple;
1769 else if (str ==
"ColumnSingle")
1771 mode = MultiColumnList::ColumnSingle;
1773 else if (str ==
"ColumnMultiple")
1775 mode = MultiColumnList::ColumnMultiple;
1777 else if (str ==
"CellSingle")
1779 mode = MultiColumnList::CellSingle;
1781 else if (str ==
"CellMultiple")
1783 mode = MultiColumnList::CellMultiple;
1785 else if (str ==
"NominatedColumnSingle")
1787 mode = MultiColumnList::NominatedColumnSingle;
1789 else if (str ==
"NominatedColumnMultiple")
1791 mode = MultiColumnList::NominatedColumnMultiple;
1793 else if (str ==
"NominatedRowSingle")
1795 mode = MultiColumnList::NominatedRowSingle;
1797 else if (str ==
"NominatedRowMultiple")
1799 mode = MultiColumnList::NominatedRowMultiple;
1803 mode = MultiColumnList::RowSingle;
1812 case MultiColumnList::RowMultiple:
1813 return String(
"RowMultiple");
1816 case MultiColumnList::ColumnSingle:
1817 return String(
"ColumnSingle");
1820 case MultiColumnList::ColumnMultiple:
1821 return String(
"ColumnMultiple");
1824 case MultiColumnList::CellSingle:
1825 return String(
"CellSingle");
1828 case MultiColumnList::CellMultiple:
1829 return String(
"CellMultiple");
1832 case MultiColumnList::NominatedColumnSingle:
1833 return String(
"NominatedColumnSingle");
1836 case MultiColumnList::NominatedColumnMultiple:
1837 return String(
"NominatedColumnMultiple");
1840 case MultiColumnList::NominatedRowSingle:
1841 return String(
"NominatedRowSingle");
1844 case MultiColumnList::NominatedRowMultiple:
1845 return String(
"NominatedRowMultiple");
1849 return String(
"RowSingle");
1858 #if defined(_MSC_VER)
1859 # pragma warning(pop)
1862 #endif // end of guard _CEGUIMultiColumnList_h_