Crazy Eddies GUI System  0.7.2
Public Member Functions | Protected Member Functions | List of all members
CEGUI::TextComponent Class Reference

Class that encapsulates information for a text component. More...

+ Inheritance diagram for CEGUI::TextComponent:
+ Collaboration diagram for CEGUI::TextComponent:

Public Member Functions

 TextComponent ()
 Constructor.
 
 ~TextComponent ()
 Destructor.
 
 TextComponent (const TextComponent &obj)
 Copy constructor.
 
TextComponentoperator= (const TextComponent &other)
 Assignment.
 
const StringgetText () const
 Return the text object that will be rendered by this TextComponent. More...
 
const StringgetTextVisual () const
 return text string with visual ordering of glyphs.
 
void setText (const String &text)
 Set the text that will be rendered by this TextComponent. More...
 
const StringgetFont () const
 Return the name of the font to be used when rendering this TextComponent. More...
 
void setFont (const String &font)
 Set the name of the font to be used when rendering this TextComponent. More...
 
VerticalTextFormatting getVerticalFormatting () const
 Return the current vertical formatting setting for this TextComponent. More...
 
void setVerticalFormatting (VerticalTextFormatting fmt)
 Set the vertical formatting setting for this TextComponent. More...
 
HorizontalTextFormatting getHorizontalFormatting () const
 Return the current horizontal formatting setting for this TextComponent. More...
 
void setHorizontalFormatting (HorizontalTextFormatting fmt)
 Set the horizontal formatting setting for this TextComponent. More...
 
void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of this TextComponent to out_stream. More...
 
bool isTextFetchedFromProperty () const
 Return whether this TextComponent fetches it's text string via a property on the target window. More...
 
const StringgetTextPropertySource () const
 Return the name of the property that will be used to determine the text string to render for this TextComponent. More...
 
void setTextPropertySource (const String &property)
 Set the name of the property that will be used to determine the text string to render for this TextComponent. More...
 
bool isFontFetchedFromProperty () const
 Return whether this TextComponent fetches it's font via a property on the target window. More...
 
const StringgetFontPropertySource () const
 Return the name of the property that will be used to determine the font to use for rendering the text string for this TextComponent. More...
 
void setFontPropertySource (const String &property)
 Set the name of the property that will be used to determine the font to use for rendering the text string of this TextComponent. More...
 
- Public Member Functions inherited from CEGUI::FalagardComponentBase
 FalagardComponentBase ()
 Constructor.
 
virtual ~FalagardComponentBase ()
 Destructor.
 
void render (Window &srcWindow, const CEGUI::ColourRect *modColours=0, const Rect *clipper=0, bool clipToDisplay=false) const
 Render this component. More correctly, the component is cached for rendering. More...
 
void render (Window &srcWindow, const Rect &baseRect, const CEGUI::ColourRect *modColours=0, const Rect *clipper=0, bool clipToDisplay=false) const
 Render this component. More correctly, the component is cached for rendering. More...
 
const ComponentAreagetComponentArea () const
 Return the ComponentArea of this ImageryComponent. More...
 
void setComponentArea (const ComponentArea &area)
 Set the ImageryComponent's ComponentArea. More...
 
const ColourRectgetColours () const
 Return the ColourRect set for use by this ImageryComponent. More...
 
void setColours (const ColourRect &cols)
 Set the colours to be used by this ImageryComponent. More...
 
void setColoursPropertySource (const String &property)
 Set the name of the property where colour values can be obtained. More...
 
void setColoursPropertyIsColourRect (bool setting=true)
 Set whether the colours property source represents a full ColourRect. More...
 
void setVertFormattingPropertySource (const String &property)
 Set the name of the property where vertical formatting option can be obtained. More...
 
void setHorzFormattingPropertySource (const String &property)
 Set the name of the property where horizontal formatting option can be obtained. More...
 

Protected Member Functions

void render_impl (Window &srcWindow, Rect &destRect, const CEGUI::ColourRect *modColours, const Rect *clipper, bool clipToDisplay) const
 Method to do main render caching work.
 
void setupStringFormatter (const Window &window, const RenderedString &rendered_string) const
 helper to set up an appropriate FormattedRenderedString
 
- Protected Member Functions inherited from CEGUI::FalagardComponentBase
void initColoursRect (const Window &wnd, const ColourRect *modCols, ColourRect &cr) const
 Helper method to initialise a ColourRect with appropriate values according to the way the ImageryComponent is set up. More...
 
bool writeColoursXML (XMLSerializer &xml_stream) const
 Writes xml for the colours to a OutStream. Will prefer property colours before explicit. More...
 
bool writeVertFormatXML (XMLSerializer &xml_stream) const
 Writes xml for the vertical formatting to a OutStream if such a property is defined. More...
 
bool writeHorzFormatXML (XMLSerializer &xml_stream) const
 Writes xml for the horizontal formatting to a OutStream if such a property is defined. More...
 

Additional Inherited Members

- Protected Attributes inherited from CEGUI::FalagardComponentBase
ComponentArea d_area
 Destination area for this component.
 
ColourRect d_colours
 base colours to be applied when rendering the image component.
 
String d_colourPropertyName
 name of property to fetch colours from.
 
bool d_colourProperyIsRect
 true if the colour property will fetch a full ColourRect.
 
String d_vertFormatPropertyName
 name of property to fetch vertical formatting setting from.
 
String d_horzFormatPropertyName
 name of property to fetch horizontal formatting setting from.
 

Detailed Description

Class that encapsulates information for a text component.

Member Function Documentation

const String& CEGUI::TextComponent::getFont ( ) const

Return the name of the font to be used when rendering this TextComponent.

Returns
String object containing the name of a font, or "" if the window font is to be used.
const String& CEGUI::TextComponent::getFontPropertySource ( ) const

Return the name of the property that will be used to determine the font to use for rendering the text string for this TextComponent.

Returns
String object holding the name of a Propery.
HorizontalTextFormatting CEGUI::TextComponent::getHorizontalFormatting ( ) const

Return the current horizontal formatting setting for this TextComponent.

Returns
One of the HorizontalTextFormatting enumerated values.
const String& CEGUI::TextComponent::getText ( ) const

Return the text object that will be rendered by this TextComponent.

Returns
String object containing the text that will be rendered.
const String& CEGUI::TextComponent::getTextPropertySource ( ) const

Return the name of the property that will be used to determine the text string to render for this TextComponent.

Returns
String object holding the name of a Propery.
VerticalTextFormatting CEGUI::TextComponent::getVerticalFormatting ( ) const

Return the current vertical formatting setting for this TextComponent.

Returns
One of the VerticalTextFormatting enumerated values.
bool CEGUI::TextComponent::isFontFetchedFromProperty ( ) const

Return whether this TextComponent fetches it's font via a property on the target window.

Returns
  • true if the font comes via a Propery.
  • false if the font is defined explicitly, or will come from the target window.
bool CEGUI::TextComponent::isTextFetchedFromProperty ( ) const

Return whether this TextComponent fetches it's text string via a property on the target window.

Returns
  • true if the text string comes via a Propery.
  • false if the text string is defined explicitly, or will come from the target window.
void CEGUI::TextComponent::setFont ( const String font)

Set the name of the font to be used when rendering this TextComponent.

Note that setting this to the empty string ("") will cause the font from the
base window passed when rendering to be used instead.
Parameters
fontString containing name of a font
Returns
Nothing.
void CEGUI::TextComponent::setFontPropertySource ( const String property)

Set the name of the property that will be used to determine the font to use for rendering the text string of this TextComponent.

Parameters
propertyString object holding the name of a Propery. The property should access a valid font name.
Returns
Nothing.
void CEGUI::TextComponent::setHorizontalFormatting ( HorizontalTextFormatting  fmt)

Set the horizontal formatting setting for this TextComponent.

Parameters
fmtOne of the HorizontalTextFormatting enumerated values.
Returns
Nothing.
void CEGUI::TextComponent::setText ( const String text)

Set the text that will be rendered by this TextComponent.

Note that setting this to the empty string ("") will cause the text from the
base window passed when rendering to be used instead.
Parameters
textString containing text to render, or "" to render text from window.
Returns
Nothing.
void CEGUI::TextComponent::setTextPropertySource ( const String property)

Set the name of the property that will be used to determine the text string to render for this TextComponent.

Parameters
propertyString object holding the name of a Propery. The property can contain any text string to render.
Returns
Nothing.
void CEGUI::TextComponent::setVerticalFormatting ( VerticalTextFormatting  fmt)

Set the vertical formatting setting for this TextComponent.

Parameters
fmtOne of the VerticalTextFormatting enumerated values.
Returns
Nothing.
void CEGUI::TextComponent::writeXMLToStream ( XMLSerializer xml_stream) const

Writes an xml representation of this TextComponent to out_stream.

Parameters
xml_streamStream where xml data should be output.
Returns
Nothing.