Changeset View
Changeset View
Standalone View
Standalone View
source/gui/ObjectTypes/CText.h
Show All 22 Lines | |||||
#include "gui/ObjectBases/IGUITextOwner.h" | #include "gui/ObjectBases/IGUITextOwner.h" | ||||
#include "gui/SettingTypes/CGUIString.h" | #include "gui/SettingTypes/CGUIString.h" | ||||
/** | /** | ||||
* 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, "text") | GUI_OBJECT(CText, "text", TextObjectFactory) | ||||
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(); | ||||
/** | CSize GetTextSize() | ||||
* Script accessors to this GUI object. | { | ||||
*/ | return m_GeneratedTexts[0].GetSize(); | ||||
static JSFunctionSpec JSI_methods[]; | } | ||||
static bool GetTextSize(JSContext* cx, uint argc, JS::Value* vp); | |||||
/** | /** | ||||
* 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; | ||||
Show All 18 Lines |
Wildfire Games · Phabricator