Changeset View
Changeset View
Standalone View
Standalone View
source/gui/ObjectTypes/CText.h
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | |||||||
SilierUnsubmitted Not Done Inline Actions
Silier: | ||||||||
* 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 15 Lines | ||||||||
/** | /** | |||||||
* Text field that just displays static text. | * Text field that just displays static text. | |||||||
*/ | */ | |||||||
class CText : public IGUIObject, public IGUIScrollBarOwner, public IGUITextOwner | class CText : public IGUIObject, public IGUIScrollBarOwner, public IGUITextOwner | |||||||
{ | { | |||||||
GUI_OBJECT(CText) | GUI_OBJECT(CText) | |||||||
friend JSI_GUIProxy<CText>; | ||||||||
public: | public: | |||||||
CText(CGUI& pGUI); | CText(CGUI& pGUI); | |||||||
virtual ~CText(); | virtual ~CText(); | |||||||
/** | /** | |||||||
* @see IGUIObject#ResetStates() | * @see IGUIObject#ResetStates() | |||||||
*/ | */ | |||||||
virtual void ResetStates(); | virtual void ResetStates(); | |||||||
Show All 10 Lines | ||||||||
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. | |||||||
*/ | */ | |||||||
void SetupText(); | void SetupText(); | |||||||
virtual void RegisterScriptFunctions(); | ||||||||
/** | /** | |||||||
* @see IGUIObject#HandleMessage() | * @see IGUIObject#HandleMessage() | |||||||
*/ | */ | |||||||
virtual void HandleMessage(SGUIMessage& Message); | virtual void HandleMessage(SGUIMessage& Message); | |||||||
/** | /** | |||||||
* Draws the Text | * Draws the Text | |||||||
*/ | */ | |||||||
virtual void Draw(); | virtual void Draw(); | |||||||
/** | virtual void CreateJSObject(); | |||||||
* Script accessors to this GUI object. | ||||||||
*/ | ||||||||
static JSFunctionSpec JSI_methods[]; | ||||||||
static bool GetTextSize(JSContext* cx, uint argc, JS::Value* vp); | bool getTextSize(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | |||||||
Not Done Inline ActionsWhy is this missing the call to UpdateText from the previous function? Itms: Why is this missing the call to `UpdateText` from the previous function? | ||||||||
Done Inline ActionsThink I just missed that when moving code ;) wraitii: Think I just missed that when moving code ;) | ||||||||
/** | /** | |||||||
* Placement of text. Ignored when scrollbars are active. | * Placement of text. Ignored when scrollbars are active. | |||||||
*/ | */ | |||||||
CPos m_TextPos; | CPos m_TextPos; | |||||||
// Settings | // Settings | |||||||
float m_BufferZone; | float m_BufferZone; | |||||||
CGUIString m_Caption; | CGUIString m_Caption; | |||||||
Show All 17 Lines |
Wildfire Games · Phabricator