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;
141 NominatedColumnSingle,
142 NominatedColumnMultiple,
161 bool isUserSortControlEnabled(
void)
const;
171 bool isUserColumnSizingEnabled(
void)
const;
181 bool isUserColumnDraggingEnabled(
void)
const;
191 uint getColumnCount(
void)
const;
201 uint getRowCount(
void)
const;
214 uint getSortColumn(
void)
const;
229 uint getColumnWithID(uint col_id)
const;
244 uint getColumnWithHeaderText(
const String& text)
const;
254 UDim getTotalColumnHeadersWidth(
void)
const;
269 UDim getColumnHeaderWidth(uint col_idx)
const;
309 uint getItemRowIndex(
const ListboxItem* item)
const;
324 uint getItemColumnIndex(
const ListboxItem* item)
const;
373 bool isListboxItemInColumn(
const ListboxItem* item, uint col_idx)
const;
392 bool isListboxItemInRow(
const ListboxItem* item, uint row_idx)
const;
406 bool isListboxItemInList(
const ListboxItem* item)
const;
510 uint getSelectedCount(
void)
const;
526 bool isItemSelected(
const MCLGridRef& grid_ref)
const;
540 uint getNominatedSelectionColumnID(
void)
const;
551 uint getNominatedSelectionColumn(
void)
const;
562 uint getNominatedSelectionRow(
void)
const;
583 bool isVertScrollbarAlwaysShown(
void)
const;
594 bool isHorzScrollbarAlwaysShown(
void)
const;
609 uint getColumnID(uint col_idx)
const;
624 uint getRowID(uint row_idx)
const;
639 uint getRowWithID(uint row_id)
const;
651 Rect getListRenderArea(
void)
const;
697 float getTotalRowsHeight(
void)
const;
703 float getWidestColumnItemWidth(uint col_idx)
const;
709 float getHighestRowItemHeight(uint row_idx)
const;
724 virtual void initialiseComponents(
void);
733 void resetList(
void);
752 void addColumn(
const String& text, uint col_id,
const UDim& width);
775 void insertColumn(
const String& text, uint col_id,
const UDim& width, uint position);
790 void removeColumn(uint col_idx);
805 void removeColumnWithID(uint col_id);
823 void moveColumn(uint col_idx, uint position);
841 void moveColumnWithID(uint col_id, uint position);
858 uint addRow(uint row_id = 0);
883 uint addRow(
ListboxItem* item, uint col_id, uint row_id = 0);
904 uint insertRow(uint row_idx, uint row_id = 0);
933 uint insertRow(
ListboxItem* item, uint col_id, uint row_idx, uint row_id = 0);
948 void removeRow(uint row_idx);
987 void setItem(
ListboxItem* item, uint col_id, uint row_idx);
1017 void setNominatedSelectionColumnID(uint col_id);
1032 void setNominatedSelectionColumn(uint col_idx);
1047 void setNominatedSelectionRow(uint row_idx);
1075 void setSortColumn(uint col_idx);
1090 void setSortColumnByID(uint col_id);
1104 void setShowVertScrollbar(
bool setting);
1118 void setShowHorzScrollbar(
bool setting);
1128 void clearAllSelections(
void);
1151 void setItemSelectState(
ListboxItem* item,
bool state);
1174 void setItemSelectState(
const MCLGridRef& grid_ref,
bool state);
1185 void handleUpdatedItemData(
void);
1203 void setColumnHeaderWidth(uint col_idx,
const UDim& width);
1217 void setUserSortControlEnabled(
bool setting);
1231 void setUserColumnSizingEnabled(
bool setting);
1242 void setUserColumnDraggingEnabled(
bool setting);
1258 void autoSizeColumnHeader(uint col_idx);
1276 void setRowID(uint row_idx, uint row_id);
1319 void configureScrollbars(
void);
1336 bool clearAllSelections_impl(
void);
1356 bool setItemSelectState_impl(
const MCLGridRef grid_ref,
bool state);
1363 void setSelectForItemsInRow(uint row_idx,
bool state);
1370 void setSelectForItemsInColumn(uint col_idx,
bool state);
1380 void moveColumn_impl(uint col_idx, uint position);
1394 bool resetList_impl(
void);
1407 virtual bool testClassName_impl(
const String& class_name)
const
1409 if (class_name==
"MultiColumnList")
return true;
1415 virtual bool validateWindowRenderer(
const String& name)
const
1417 return (name ==
"MultiColumnList");
1521 bool handleHeaderScroll(
const EventArgs& e);
1522 bool handleHeaderSegMove(
const EventArgs& e);
1523 bool handleColumnSizeChange(
const EventArgs& e);
1524 bool handleHorzScrollbar(
const EventArgs& e);
1525 bool handleVertScrollbar(
const EventArgs& e);
1526 bool handleSortColumnChange(
const EventArgs& e);
1527 bool handleSortDirectionChange(
const EventArgs& e);
1528 bool handleHeaderSegDblClick(
const EventArgs& e);
1537 typedef std::vector<ListboxItem*> RowItems;
1543 ListboxItem*
const& operator[](uint idx)
const {
return d_items[idx];}
1544 ListboxItem*& operator[](uint idx) {
return d_items[idx];}
1578 typedef std::vector<ListRow> ListItemGrid;
1605 void addMultiColumnListProperties(
void);
1610 #if defined(_MSC_VER)
1611 # pragma warning(pop)
1614 #endif // end of guard _CEGUIMultiColumnList_h_