Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/COList.h
Show All 24 Lines | |||||
/** | /** | ||||
* Represents a column. | * Represents a column. | ||||
*/ | */ | ||||
struct COListColumn | struct COListColumn | ||||
{ | { | ||||
// Avoid copying the strings. | // Avoid copying the strings. | ||||
NONCOPYABLE(COListColumn); | NONCOPYABLE(COListColumn); | ||||
MOVABLE(COListColumn); | MOVABLE(COListColumn); | ||||
COListColumn() = default; | COListColumn() : m_Width(0), m_Hidden(false) {} | ||||
CGUIColor m_TextColor; | CGUIColor m_TextColor; | ||||
CStr m_Id; | CStr m_Id; | ||||
float m_Width; | float m_Width; | ||||
CStrW m_Heading; | CStrW m_Heading; // CGUIString?? | ||||
CGUIList m_List; | |||||
bool m_Hidden; | |||||
}; | }; | ||||
/** | /** | ||||
* Multi-column list. One row can be selected by the user. | * Multi-column list. One row can be selected by the user. | ||||
* Individual cells are clipped if the contained text is too long. | * Individual cells are clipped if the contained text is too long. | ||||
* | * | ||||
* The list can be sorted dynamically by JS code when a | * The list can be sorted dynamically by JS code when a | ||||
* heading is clicked. | * heading is clicked. | ||||
Show All 9 Lines | |||||
protected: | protected: | ||||
void SetupText(); | void SetupText(); | ||||
void HandleMessage(SGUIMessage& Message); | void HandleMessage(SGUIMessage& Message); | ||||
/** | /** | ||||
* Handle the \<item\> tag. | * Handle the \<item\> tag. | ||||
*/ | */ | ||||
virtual bool HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile); | virtual bool HandleAdditionalChildren(const XMBElement& child, CXeromyces* pFile); | ||||
virtual void AdditionalChildrenHandled(); | |||||
void DrawList(const int& selected, const CStr& _sprite, const CStr& _sprite_selected, const CStr& _textcolor); | void DrawList(const int& selected, const CGUISpriteInstance& sprite, const CGUISpriteInstance& sprite_selected, const CGUIColor& textcolor); | ||||
virtual CRect GetListRect() const; | virtual CRect GetListRect() const; | ||||
/** | /** | ||||
* Available columns. | * Available columns. | ||||
*/ | */ | ||||
std::vector<COListColumn> m_Columns; | std::vector<COListColumn> m_Columns; | ||||
// Settings | |||||
CGUISpriteInstance m_SpriteHeading; | |||||
bool m_Sortable; | |||||
CStr m_SelectedColumn; | |||||
i32 m_SelectedColumnOrder; | |||||
CGUISpriteInstance m_SpriteAsc; | |||||
CGUISpriteInstance m_SpriteDesc; | |||||
CGUISpriteInstance m_SpriteNotSorted; | |||||
private: | private: | ||||
// Width of space available for columns | // Width of space available for columns | ||||
float m_TotalAvailableColumnWidth; | float m_TotalAvailableColumnWidth; | ||||
float m_HeadingHeight; | float m_HeadingHeight; | ||||
}; | }; | ||||
#endif // INCLUDED_COLIST | #endif // INCLUDED_COLIST |
Wildfire Games · Phabricator