GlistEngine
Loading...
Searching...
No Matches
gGUIText Class Reference

#include <gGUIText.h>

Inheritance diagram for gGUIText:
Collaboration diagram for gGUIText:

Public Member Functions

 gGUIText ()
virtual ~gGUIText ()
void set (gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h)
void setText (std::string text)
std::string getText ()
std::string getPlainText ()
void setTextAlignment (int textAligment)
void setTextVerticalAlignment (int verticalTextAlignment)
int getTextAlignment ()
int getVerticalTextAlignment ()
void setTextColor (const gColor &color)
gColor * getTextColor ()
void draw () override
void setDisabled (bool isDisabled)
bool isDisabled () const
bool getHasContent ()
void enableBBCode (bool isEnabled=true)
bool isBBCodeEnabled () const
void setBBCodeBoldFont (gFont *font)
void setBBCodeItalicFont (gFont *font)
void setBBCodeBoldItalicFont (gFont *font)
void setBBCodeCodeFont (gFont *font)
void setBBCodeCodeBackgroundColor (const gColor &color)
void setBBCodeCodeTextColor (const gColor &color)
void setLinkColor (const gColor &color)
gColor * getLinkColor ()
void setLinkHoverColor (const gColor &color)
gColor * getLinkHoverColor ()
void setLinkVisitedColor (const gColor &color)
gColor * getLinkVisitedColor ()
void setLinkUnderline (bool isEnabled)
bool isLinkUnderlineEnabled () const
void setAutoOpenUrl (bool isEnabled)
bool isAutoOpenUrlEnabled () const
void setUrlClickCallback (std::function< void(const std::string &url, const std::string &label)> callback)
std::string getHoveredUrl () const
std::string getLastClickedUrl () const
std::string getUrlAt (int x, int y)
bool isUrlVisited (const std::string &url) const
void clearVisitedUrls ()
int getCursor (int x, int y) override
void mouseMoved (int x, int y) override
void mousePressed (int x, int y, int button) override
void mouseDragged (int x, int y, int button) override
void mouseReleased (int x, int y, int button) override
void mouseExited () override
int calculateContentHeight () override
Public Member Functions inherited from gGUIControl
 gGUIControl ()
virtual ~gGUIControl () override
void update () override
virtual bool countAsSpace ()
void setCountAsSpace (bool isSpace)
void setFont (gFont *font)
gFont * getFont ()
Public Member Functions inherited from gBaseGUIObject
 gBaseGUIObject ()
virtual ~gBaseGUIObject ()
int getId ()
int getType ()
void setEnabled (bool isEnabled)
bool isEnabled ()
void setVisible (bool isVisible)
bool isVisible ()
void setTitleOn (bool isTitleOn)
bool isTitleOn ()
virtual void setTopParent (gBaseGUIObject *parentGUIObject)
gBaseGUIObject * getTopParent ()
virtual void setParent (gBaseGUIObject *parentGUIObject)
gBaseGUIObject * getParent ()
void setParentSlotNo (int parentSlotLineNo, int parentSlotColumnNo)
int getParentSlotLineNo ()
int getParentSlotColumnNo ()
void setTitle (std::string title)
std::string getTitle ()
virtual void keyPressed (int key)
virtual void keyReleased (int key)
virtual void charPressed (unsigned int codepoint)
virtual void mouseScrolled (int x, int y)
virtual void mouseEntered ()
virtual void windowResized (int w, int h)
virtual void onGUIEvent (int guiObjectId, int eventType, int sourceEventType, std::string value1="", std::string value2="")
void setRootApp (gBaseApp *root)
virtual void setCursorOn (bool isOn)
virtual void unfocus ()
Public Member Functions inherited from gRenderObject
 gRenderObject ()
int getScreenWidth ()
int getScreenHeight ()
void pushMatrix ()
void popMatrix ()
Public Member Functions inherited from gObject
 gObject ()
void logi (std::string message)
void logd (std::string message)
void logw (std::string message)
void loge (std::string message)
void logi (std::string tag, std::string message)
void logd (std::string tag, std::string message)
void logw (std::string tag, std::string message)
void loge (std::string tag, std::string message)

Static Public Attributes

static const int TEXTALIGNMENT_LEFT = 0
static const int TEXTALIGNMENT_CENTER = 1
static const int TEXTALIGNMENT_RIGHT = 2
static const int TEXTALIGNMENT_JUSTIFY = 3
static const int TEXTVERTICALALIGNMENT_TOP = 0
static const int TEXTVERTICALALIGNMENT_CENTER = 1
static const int TEXTVERTICALALIGNMENT_BOTTOM = 2
Static Public Attributes inherited from gBaseGUIObject
static const int GUIEVENT_FOCUSED = -1
static const int GUIEVENT_UNFOCUSED = -2
static const int CURSOR_ARROW = 0
static const int CURSOR_IBEAM = 1
static const int CURSOR_CROSSHAIR = 2
static const int CURSOR_HAND = 3
static const int CURSOR_HRESIZE = 4
static const int CURSOR_VRESIZE = 5
static int focusid
static int previousfocusid
Static Public Attributes inherited from gObject
static const int LOGLEVEL_SILENT
static const int LOGLEVEL_DEBUG
static const int LOGLEVEL_INFO
static const int LOGLEVEL_WARNING
static const int LOGLEVEL_ERROR

Additional Inherited Members

Public Types inherited from gBaseGUIObject
enum  { TEXTALIGNMENT_LEFT , TEXTALIGNMENT_MIDDLE , TEXTALIGNMENT_RIGHT }
Static Public Member Functions inherited from gBaseGUIObject
static void setBackgroundColor (gColor *backgroundColor)
static gColor * getBackgroundColor ()
static void setMiddlegroundColor (gColor *middlegroundColor)
static gColor * getMiddlegroundColor ()
static void setForegroundColor (gColor *foregroundColor)
static gColor * getForegroundColor ()
static void setTextBackgroundColor (gColor *textBackgroundColor)
static gColor * getTextBackgroundColor ()
static void setNavigationBackgroundColor (gColor *navigationBackgroundColor)
static gColor * getNavigationBackgroundColor ()
static void setFont (gFont *font)
static gFont * getFont ()
static void setFontColor (gColor *fontColor)
static gColor * getFontColor ()
static void setNavigationFontColor (gColor *navigationFontColor)
static gColor * getNavigationFontColor ()
static void setButtonColor (gColor *color)
static gColor * getButtonColor ()
static void setPressedButtonColor (gColor *color)
static gColor * getPressedButtonColor ()
static void setDisabledButtonColor (gColor *color)
static gColor * getDisabledButtonColor ()
static void setButtonFontColor (gColor *color)
static gColor * getButtonFontColor ()
static void setPressedButtonFontColor (gColor *color)
static gColor * getPressedButtonFontColor ()
static void setDisabledButtonFontColor (gColor *color)
static gColor * getDisabledButtonFontColor ()
Static Public Member Functions inherited from gRenderObject
static void setScreenSize (int screenWidth, int screenHeight)
static void setUnitScreenSize (int unitWidth, int unitHeight)
static void setScreenScaling (int screenScaling)
static void enableShadowMapping ()
static void disableShadowMapping ()
static bool isShadowMappingEnabled ()
static void enableExtraShaders (bool isEnabled=true)
static void disableExtraShaders ()
static bool isExtraShadersEnabled ()
static gRenderer * getRenderer ()
static void destroyRenderer ()
static void createRenderer (int renderEngine=G_RENDERER_GL)
Static Public Member Functions inherited from gObject
static std::string gGetAppDir ()
static std::string gGetAssetsDir ()
static void gSetAssetsDir (std::string assetsDir)
static std::string gGetFilesDir ()
static std::string gGetImagesDir ()
static std::string gGetFontsDir ()
static std::string gGetModelsDir ()
static std::string gGetTexturesDir ()
static std::string gGetShadersDir ()
static std::string gGetSoundsDir ()
static std::string gGetDatabasesDir ()
static std::string gGetVideosDir ()
static void setCurrentResolution (int scalingNo, int currentResolutionNo)
Public Attributes inherited from gBaseGUIObject
int id
int type
int left
int top
int right
int bottom
int width
int height
int titlex
int titley
int titleheight
bool isfocused
bool iscursoron
bool issizer
bool iscontainer
bool isresizable
Protected Attributes inherited from gGUIControl
bool countasspace
int oldwidth
int oldheight
gFont * localfont
Protected Attributes inherited from gBaseGUIObject
std::string title
gBaseApp * root
gBaseGUIObject * topparent
gBaseGUIObject * parent
bool isenabled
bool isvisible
bool istitleon
int parentslotlineno
int parentslotcolumnno
Static Protected Attributes inherited from gBaseGUIObject
static gColor * backgroundcolor
static gColor * middlegroundcolor
static gColor * foregroundcolor
static gColor * textbackgroundcolor
static gColor * navigationbackgroundcolor
static gFont * font
static gColor * fontcolor
static gColor * navigationfontcolor
static gColor * buttoncolor
static gColor * pressedbuttoncolor
static gColor * disabledbuttoncolor
static gColor * buttonfontcolor
static gColor * pressedbuttonfontcolor
static gColor * disabledbuttonfontcolor
static gGUIActionManager actionmanager
static gGUIResources res
Static Protected Attributes inherited from gRenderObject
static bool isshadowmappingenabled
static bool isextrashadersenabled
Static Protected Attributes inherited from gObject
static int renderpassnum
static int renderpassno
static int releasescaling
static int releaseresolution

Constructor & Destructor Documentation

◆ gGUIText()

gGUIText::gGUIText ( )

◆ ~gGUIText()

virtual gGUIText::~gGUIText ( )
virtual

Member Function Documentation

◆ calculateContentHeight()

int gGUIText::calculateContentHeight ( )
overridevirtual

Reimplemented from gGUIControl.

◆ clearVisitedUrls()

void gGUIText::clearVisitedUrls ( )

◆ draw()

void gGUIText::draw ( )
overridevirtual

Reimplemented from gGUIControl.

◆ enableBBCode()

void gGUIText::enableBBCode ( bool isEnabled = true)

Enables or disables BBCode rich-text rendering for this text control. Disabled by default to preserve 100% plain-text backward compatibility.

Supported tags include [b], [i], [u], [s], [color], [bgcolor], [size], [url]...[/url], [url=...]...[/url], [code], [noparse], and [br].

◆ getCursor()

int gGUIText::getCursor ( int x,
int y )
overridevirtual

Reimplemented from gGUIControl.

◆ getHasContent()

bool gGUIText::getHasContent ( )

◆ getHoveredUrl()

std::string gGUIText::getHoveredUrl ( ) const

◆ getLastClickedUrl()

std::string gGUIText::getLastClickedUrl ( ) const

◆ getLinkColor()

gColor * gGUIText::getLinkColor ( )

◆ getLinkHoverColor()

gColor * gGUIText::getLinkHoverColor ( )

◆ getLinkVisitedColor()

gColor * gGUIText::getLinkVisitedColor ( )

◆ getPlainText()

std::string gGUIText::getPlainText ( )

◆ getText()

std::string gGUIText::getText ( )

◆ getTextAlignment()

int gGUIText::getTextAlignment ( )

◆ getTextColor()

gColor * gGUIText::getTextColor ( )

◆ getUrlAt()

std::string gGUIText::getUrlAt ( int x,
int y )

◆ getVerticalTextAlignment()

int gGUIText::getVerticalTextAlignment ( )

◆ isAutoOpenUrlEnabled()

bool gGUIText::isAutoOpenUrlEnabled ( ) const

◆ isBBCodeEnabled()

bool gGUIText::isBBCodeEnabled ( ) const

◆ isDisabled()

bool gGUIText::isDisabled ( ) const

◆ isLinkUnderlineEnabled()

bool gGUIText::isLinkUnderlineEnabled ( ) const

◆ isUrlVisited()

bool gGUIText::isUrlVisited ( const std::string & url) const

◆ mouseDragged()

void gGUIText::mouseDragged ( int x,
int y,
int button )
overridevirtual

Reimplemented from gBaseGUIObject.

◆ mouseExited()

void gGUIText::mouseExited ( )
overridevirtual

Reimplemented from gBaseGUIObject.

◆ mouseMoved()

void gGUIText::mouseMoved ( int x,
int y )
overridevirtual

Reimplemented from gBaseGUIObject.

◆ mousePressed()

void gGUIText::mousePressed ( int x,
int y,
int button )
overridevirtual

Reimplemented from gBaseGUIObject.

◆ mouseReleased()

void gGUIText::mouseReleased ( int x,
int y,
int button )
overridevirtual

Reimplemented from gBaseGUIObject.

◆ set()

void gGUIText::set ( gBaseApp * root,
gBaseGUIObject * topParentGUIObject,
gBaseGUIObject * parentGUIObject,
int parentSlotLineNo,
int parentSlotColumnNo,
int x,
int y,
int w,
int h )
virtual

Reimplemented from gGUIControl.

◆ setAutoOpenUrl()

void gGUIText::setAutoOpenUrl ( bool isEnabled)

Controls whether clicking a [url] link automatically opens it in the system default browser via gOpenUrlInDefaultBrowser(). Enabled by default. Regardless of this setting, clicking a URL also dispatches G_GUIEVENT_URLCLICKED and invokes any registered URL click callback.

◆ setBBCodeBoldFont()

void gGUIText::setBBCodeBoldFont ( gFont * font)

◆ setBBCodeBoldItalicFont()

void gGUIText::setBBCodeBoldItalicFont ( gFont * font)

◆ setBBCodeCodeBackgroundColor()

void gGUIText::setBBCodeCodeBackgroundColor ( const gColor & color)

◆ setBBCodeCodeFont()

void gGUIText::setBBCodeCodeFont ( gFont * font)

◆ setBBCodeCodeTextColor()

void gGUIText::setBBCodeCodeTextColor ( const gColor & color)

◆ setBBCodeItalicFont()

void gGUIText::setBBCodeItalicFont ( gFont * font)

◆ setDisabled()

void gGUIText::setDisabled ( bool isDisabled)

◆ setLinkColor()

void gGUIText::setLinkColor ( const gColor & color)

◆ setLinkHoverColor()

void gGUIText::setLinkHoverColor ( const gColor & color)

◆ setLinkUnderline()

void gGUIText::setLinkUnderline ( bool isEnabled)

◆ setLinkVisitedColor()

void gGUIText::setLinkVisitedColor ( const gColor & color)

◆ setText()

void gGUIText::setText ( std::string text)

◆ setTextAlignment()

void gGUIText::setTextAlignment ( int textAligment)

◆ setTextColor()

void gGUIText::setTextColor ( const gColor & color)

◆ setTextVerticalAlignment()

void gGUIText::setTextVerticalAlignment ( int verticalTextAlignment)

◆ setUrlClickCallback()

void gGUIText::setUrlClickCallback ( std::function< void(const std::string &url, const std::string &label)> callback)

Member Data Documentation

◆ TEXTALIGNMENT_CENTER

const int gGUIText::TEXTALIGNMENT_CENTER = 1
static

◆ TEXTALIGNMENT_JUSTIFY

const int gGUIText::TEXTALIGNMENT_JUSTIFY = 3
static

◆ TEXTALIGNMENT_LEFT

const int gGUIText::TEXTALIGNMENT_LEFT = 0
static

◆ TEXTALIGNMENT_RIGHT

const int gGUIText::TEXTALIGNMENT_RIGHT = 2
static

◆ TEXTVERTICALALIGNMENT_BOTTOM

const int gGUIText::TEXTVERTICALALIGNMENT_BOTTOM = 2
static

◆ TEXTVERTICALALIGNMENT_CENTER

const int gGUIText::TEXTVERTICALALIGNMENT_CENTER = 1
static

◆ TEXTVERTICALALIGNMENT_TOP

const int gGUIText::TEXTVERTICALALIGNMENT_TOP = 0
static

The documentation for this class was generated from the following file: