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");
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;
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_