📄 ceguimulticolumnlist.h
字号:
\brief
Set whether user manipulation of the sort column and direction are enabled.
\param setting
- true if the user may interactively modify the sort column and direction.
- false if the user may not modify the sort column and direction (these can still be set programmatically).
\return
Nothing.
*/
void setUserSortControlEnabled(bool setting);
/*!
\brief
Set whether the user may size column segments.
\param setting
- true if the user may interactively modify the width of columns.
- false if the user may not change the width of the columns.
\return
Nothing.
*/
void setUserColumnSizingEnabled(bool setting);
/*!
\brief
Set whether the user may modify the order of the columns.
\param setting
- true if the user may interactively modify the order of the columns.
- false if the user may not modify the order of the columns.
*/
void setUserColumnDraggingEnabled(bool setting);
/*!
\brief
Automatically determines the "best fit" size for the specified column and sets
the column width to the same.
\param col_idx
Zero based index of the column to be sized.
\return
Nothing.
\exception InvalidRequestException thrown if \a col_idx is out of range.
*/
void autoSizeColumnHeader(uint col_idx);
/*!
\brief
Set the ID code assigned to a given row.
\param row_idx
Zero based index of the row who's ID code is to be set.
\param row_id
ID code to be assigned to the row at the requested index.
\return
Nothing.
\exception InvalidRequestException thrown if \a row_idx is out of range
*/
void setRowID(uint row_idx, uint row_id);
/*************************************************************************
Construction and Destruction
*************************************************************************/
/*!
\brief
Constructor for the Multi-column list base class
*/
MultiColumnList(const String& type, const String& name);
/*!
\brief
Destructor for the multi-column list base class.
*/
virtual ~MultiColumnList(void);
protected:
/*************************************************************************
Implementation Functions (abstract interface)
*************************************************************************/
/*!
\brief
Return a Rect object describing, in un-clipped pixels, the window relative area
that is to be used for rendering list items.
\return
Rect object describing the area of the Window to be used for rendering
list box items.
*/
//virtual Rect getListRenderArea_impl(void) const = 0;
/*************************************************************************
Implementation Functions
*************************************************************************/
/*!
\brief
display required integrated scroll bars according to current state of the list box and update their values.
*/
void configureScrollbars(void);
/*!
\brief
select all strings between positions \a start and \a end. (inclusive). Returns true if something was modified.
*/
bool selectRange(const MCLGridRef& start, const MCLGridRef& end);
/*!
\brief
Clear the selected state for all items (implementation)
\return
true if some selections were cleared, false nothing was changed.
*/
bool clearAllSelections_impl(void);
/*!
\brief
Return the ListboxItem under the given window local pixel co-ordinate.
\return
ListboxItem that is under window pixel co-ordinate \a pt, or NULL if no
item is under that position.
*/
ListboxItem* getItemAtPoint(const Point& pt) const;
/*!
\brief
Set select state for the given item. This appropriately selects other
items depending upon the select mode. Returns true if something is
changed, else false.
*/
bool setItemSelectState_impl(const MCLGridRef grid_ref, bool state);
/*!
\brief
Set select state for all items in the given row
*/
void setSelectForItemsInRow(uint row_idx, bool state);
/*!
\brief
Set select state for all items in the given column
*/
void setSelectForItemsInColumn(uint col_idx, bool state);
/*!
\brief
Move the column at index \a col_idx so it is at index \a position. Implementation version which does not move the
header segment (since that may have already happened).
\exception InvalidRequestException thrown if \a col_idx is invalid.
*/
void moveColumn_impl(uint col_idx, uint position);
/*!
\brief
Remove all items from the list.
\note
Note that this will cause 'AutoDelete' items to be deleted.
\return
- true if the list contents were changed.
- false if the list contents were not changed (list already empty).
*/
bool resetList_impl(void);
/*!
\brief
Return whether this window was inherited from the given class name at some point in the inheritance hierarchy.
\param class_name
The class name that is to be checked.
\return
true if this window was inherited from \a class_name. false if not.
*/
virtual bool testClassName_impl(const String& class_name) const
{
if (class_name=="MultiColumnList") return true;
return Window::testClassName_impl(class_name);
}
// overrides function in base class.
virtual bool validateWindowRenderer(const String& name) const
{
return (name == "MultiColumnList");
}
// overrides function in base class.
int writePropertiesXML(XMLSerializer& xml_stream) const;
/*************************************************************************
New event handlers for multi column list
*************************************************************************/
/*!
\brief
Handler called when the selection mode of the list box changes
*/
virtual void onSelectionModeChanged(WindowEventArgs& e);
/*!
\brief
Handler called when the nominated selection column changes
*/
virtual void onNominatedSelectColumnChanged(WindowEventArgs& e);
/*!
\brief
Handler called when the nominated selection row changes.
*/
virtual void onNominatedSelectRowChanged(WindowEventArgs& e);
/*!
\brief
Handler called when the vertical scroll bar 'force' mode is changed.
*/
virtual void onVertScrollbarModeChanged(WindowEventArgs& e);
/*!
\brief
Handler called when the horizontal scroll bar 'force' mode is changed.
*/
virtual void onHorzScrollbarModeChanged(WindowEventArgs& e);
/*!
\brief
Handler called when the current selection changes.
*/
virtual void onSelectionChanged(WindowEventArgs& e);
/*!
\brief
Handler called when the list contents is changed.
*/
virtual void onListContentsChanged(WindowEventArgs& e);
/*!
\brief
Handler called when the sort column changes.
*/
virtual void onSortColumnChanged(WindowEventArgs& e);
/*!
\brief
Handler called when the sort direction changes.
*/
virtual void onSortDirectionChanged(WindowEventArgs& e);
/*!
\brief
Handler called when a column is sized.
*/
virtual void onListColumnSized(WindowEventArgs& e);
/*!
\brief
Handler called when the column order is changed.
*/
virtual void onListColumnMoved(WindowEventArgs& e);
/*************************************************************************
Overridden Event handlers
*************************************************************************/
virtual void onSized(WindowEventArgs& e);
virtual void onMouseButtonDown(MouseEventArgs& e);
virtual void onMouseWheel(MouseEventArgs& e);
/*************************************************************************
Handlers for subscribed events
*************************************************************************/
bool handleHeaderScroll(const EventArgs& e);
bool handleHeaderSegMove(const EventArgs& e);
bool handleColumnSizeChange(const EventArgs& e);
bool handleHorzScrollbar(const EventArgs& e);
bool handleVertScrollbar(const EventArgs& e);
bool handleSortColumnChange(const EventArgs& e);
bool handleSortDirectionChange(const EventArgs& e);
bool handleHeaderSegDblClick(const EventArgs& e);
/*!
\brief
Struct used internally to represent a row in the list and also to ease
sorting of the rows.
*/
struct ListRow
{
typedef std::vector<ListboxItem*> RowItems;
RowItems d_items;
uint d_sortColumn;
uint d_rowID;
// operators
ListboxItem* const& operator[](uint idx) const {return d_items[idx];}
ListboxItem*& operator[](uint idx) {return d_items[idx];}
bool operator<(const ListRow& rhs) const;
bool operator>(const ListRow& rhs) const;
};
/*!
\brief
std algorithm predicate used for sorting in descending order
*/
static bool pred_descend(const ListRow& a, const ListRow& b);
/*************************************************************************
Implementation Data
*************************************************************************/
// scrollbar settings.
bool d_forceVertScroll; //!< true if vertical scrollbar should always be displayed
bool d_forceHorzScroll; //!< true if horizontal scrollbar should always be displayed
// selection abilities.
SelectionMode d_selectMode; //!< Holds selection mode (represented by settings below).
uint d_nominatedSelectCol; //!< Nominated column for single column selection.
uint d_nominatedSelectRow; //!< Nominated row for single row selection.
bool d_multiSelect; //!< Allow multiple selections.
bool d_fullRowSelect; //!< All items in a row are selected.
bool d_fullColSelect; //!< All items in a column are selected.
bool d_useNominatedRow; //!< true if we use a nominated row to select.
bool d_useNominatedCol; //!< true if we use a nominated col to select.
ListboxItem* d_lastSelected; //!< holds pointer to the last selected item (used in range selections)
uint d_columnCount; //!< keeps track of the number of columns.
// storage of items in the list box.
typedef std::vector<ListRow> ListItemGrid;
ListItemGrid d_grid; //!< Holds the list box data.
friend class MultiColumnListWindowRenderer;
private:
/*************************************************************************
Static Properties for this class
*************************************************************************/
static MultiColumnListProperties::ColumnsMovable d_columnsMovableProperty;
static MultiColumnListProperties::ColumnsSizable d_columnsSizableProperty;
static MultiColumnListProperties::ForceHorzScrollbar d_forceHorzScrollProperty;
static MultiColumnListProperties::ForceVertScrollbar d_forceVertScrollProperty;
static MultiColumnListProperties::NominatedSelectionColumnID d_nominatedSelectColProperty;
static MultiColumnListProperties::NominatedSelectionRow d_nominatedSelectRowProperty;
static MultiColumnListProperties::SelectionMode d_selectModeProperty;
static MultiColumnListProperties::SortColumnID d_sortColumnIDProperty;
static MultiColumnListProperties::SortDirection d_sortDirectionProperty;
static MultiColumnListProperties::SortSettingEnabled d_sortSettingProperty;
static MultiColumnListProperties::ColumnHeader d_columnHeaderProperty;
static MultiColumnListProperties::RowCount d_rowCountProperty;
/*************************************************************************
Private methods
*************************************************************************/
void addMultiColumnListProperties(void);
};
} // End of CEGUI namespace section
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#endif // end of guard _CEGUIMultiColumnList_h_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -