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);
1578 virtual bool testClassName_impl(
const String& class_name)
const
1580 if (class_name==
"MultiColumnList")
return true;
1586 virtual bool validateWindowRenderer(
const String& name)
const
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_