Changeset View
Changeset View
Standalone View
Standalone View
source/gui/ObjectTypes/CList.h
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
Stan: Copyright | |||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 21 Lines | |||||
* text-object for each element, which will be managed | * text-object for each element, which will be managed | ||||
* by the IGUITextOwner structure. | * by the IGUITextOwner structure. | ||||
* | * | ||||
* A scroll-bar will appear when needed. This will be | * A scroll-bar will appear when needed. This will be | ||||
* achieved with the IGUIScrollBarOwner structure. | * achieved with the IGUIScrollBarOwner structure. | ||||
*/ | */ | ||||
class CList : public IGUIObject, public IGUIScrollBarOwner, public IGUITextOwner | class CList : public IGUIObject, public IGUIScrollBarOwner, public IGUITextOwner | ||||
{ | { | ||||
GUI_OBJECT(CList, "list", GUIObjectFactory) | GUI_OBJECT(CList, "list", ListObjectFactory) | ||||
public: | public: | ||||
CList(CGUI& pGUI); | CList(CGUI& pGUI); | ||||
virtual ~CList(); | virtual ~CList(); | ||||
/** | /** | ||||
* @see IGUIObject#ResetStates() | * @see IGUIObject#ResetStates() | ||||
*/ | */ | ||||
virtual void ResetStates(); | virtual void ResetStates(); | ||||
/** | /** | ||||
* @see IGUIObject#UpdateCachedSize() | * @see IGUIObject#UpdateCachedSize() | ||||
*/ | */ | ||||
virtual void UpdateCachedSize(); | virtual void UpdateCachedSize(); | ||||
/** | /** | ||||
* Adds an item last to the list. | * Adds an item last to the list. | ||||
*/ | */ | ||||
virtual void AddItem(const CStrW& str, const CStrW& data); | virtual void AddItem(const CGUIString& str, const CGUIString& data); | ||||
protected: | protected: | ||||
/** | /** | ||||
* Sets up text, should be called every time changes has been | * Sets up text, should be called every time changes has been | ||||
* made that can change the visual. | * made that can change the visual. | ||||
* @param appendMode - if true, we assume we only need to render the new element at the end of the list. | |||||
*/ | */ | ||||
virtual void SetupText(); | virtual void SetupText(); | ||||
virtual void SetupText(bool appendMode); | |||||
Not Done Inline ActionsWe don't support optionnal parameters? appendMode kind of suggest it is some kind of enum, maybe just append? Stan: We don't support optionnal parameters?
appendMode kind of suggest it is some kind of enum… | |||||
Done Inline ActionsI kinda like the overload paradigm for this. wraitii: I kinda like the overload paradigm for this. | |||||
/** | /** | ||||
* @see IGUIObject#HandleMessage() | * @see IGUIObject#HandleMessage() | ||||
*/ | */ | ||||
virtual void HandleMessage(SGUIMessage& Message); | virtual void HandleMessage(SGUIMessage& Message); | ||||
/** | /** | ||||
* Handle events manually to catch keyboard inputting. | * Handle events manually to catch keyboard inputting. | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Copyright