Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CDropDown.h
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
class CDropDown : public CList | class CDropDown : public CList | ||||
{ | { | ||||
GUI_OBJECT(CDropDown) | GUI_OBJECT(CDropDown) | ||||
public: | public: | ||||
CDropDown(CGUI* pGUI); | CDropDown(CGUI* pGUI); | ||||
virtual ~CDropDown(); | virtual ~CDropDown(); | ||||
// virtual void ResetStates() { IGUIButtonBehavior::ResetStates(); } | |||||
/** | /** | ||||
* @see IGUIObject#HandleMessage() | * @see IGUIObject#HandleMessage() | ||||
*/ | */ | ||||
virtual void HandleMessage(SGUIMessage& Message); | virtual void HandleMessage(SGUIMessage& Message) override; | ||||
/** | /** | ||||
* Handle events manually to catch keyboard inputting. | * Handle events manually to catch keyboard inputting. | ||||
*/ | */ | ||||
virtual InReaction ManuallyHandleEvent(const SDL_Event_* ev); | virtual InReaction ManuallyHandleEvent(const SDL_Event_* ev) override; | ||||
/** | /** | ||||
* Draws the Button | * Draws the Button | ||||
*/ | */ | ||||
virtual void Draw(); | virtual void Draw() override; | ||||
// This is one of the few classes we actually need to redefine this function | // This is one of the few classes we actually need to redefine this function | ||||
// this is because the size of the control changes whether it is open | // this is because the size of the control changes whether it is open | ||||
// or closed. | // or closed. | ||||
virtual bool MouseOver(); | virtual bool MouseOver() override; | ||||
virtual float GetBufferedZ() const override; | |||||
virtual float GetBufferedZ() const; | virtual void AddSettings() override; | ||||
protected: | protected: | ||||
/** | /** | ||||
* If the size changed, the texts have to be updated as | * If the size changed, the texts have to be updated as | ||||
* the word wrapping depends on the size. | * the word wrapping depends on the size. | ||||
*/ | */ | ||||
virtual void UpdateCachedSize(); | virtual void UpdateCachedSize() override; | ||||
/** | /** | ||||
* 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. | ||||
*/ | */ | ||||
void SetupText(); | virtual void SetupText() override; | ||||
// Sets up the cached GetListRect. Decided whether it should | // Sets up the cached GetListRect. Decided whether it should | ||||
// have a scrollbar, and so on. | // have a scrollbar, and so on. | ||||
virtual void SetupListRect(); | virtual void SetupListRect(); | ||||
// Specify a new List rectangle. | // Specify a new List rectangle. | ||||
virtual CRect GetListRect() const; | virtual CRect GetListRect() const override; | ||||
/** | /** | ||||
* Placement of text. | * Placement of text. | ||||
*/ | */ | ||||
CPos m_TextPos; | CPos m_TextPos; | ||||
// Is the dropdown opened? | // Is the dropdown opened? | ||||
bool m_Open; | bool m_Open; | ||||
Show All 24 Lines |
Wildfire Games · Phabricator