Crazy Eddie's GUI System  0.8.4
CEGUI::TextComponent Class Reference

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

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

List of all members.

Public Member Functions

 TextComponent (const TextComponent &obj)
TextComponentoperator= (const TextComponent &other)
const StringgetText () const
 Return the text set for this TextComponent.
String getEffectiveText (const Window &wnd) const
const StringgetTextVisual () const
 return text string with visual ordering of glyphs.
String getEffectiveVisualText (const Window &wnd) const
void setText (const String &text)
 Set the text string for this TextComponent.
const StringgetFont () const
 Return the name of the font set to be used when rendering this TextComponent.
String getEffectiveFont (const Window &wnd) const
void setFont (const String &font)
 Set the name of a font to be used when rendering this TextComponent.
VerticalTextFormatting getVerticalFormatting (const Window &wnd) const
 Return the current vertical formatting setting for this TextComponent.
void setVerticalFormatting (VerticalTextFormatting fmt)
 Set the vertical formatting setting for this TextComponent.
HorizontalTextFormatting getHorizontalFormatting (const Window &wnd) const
 Return the current horizontal formatting setting for this TextComponent.
void setHorizontalFormatting (HorizontalTextFormatting fmt)
 Set the horizontal formatting setting for this TextComponent.
void setHorizontalFormattingPropertySource (const String &property_name)
 Set the name of a property that will be used to obtain the horizontal formatting to use for this ImageryComponent.
void setVerticalFormattingPropertySource (const String &property_name)
 Set the name of a property that will be used to obtain the vertical formatting to use for this ImageryComponent.
void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of this TextComponent to out_stream.
bool isTextFetchedFromProperty () const
 Return whether this TextComponent fetches it's text string via a property on the target window.
const StringgetTextPropertySource () const
 Return the name of the property that will be used to determine the text string to render for this TextComponent.
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.
bool isFontFetchedFromProperty () const
 Return whether this TextComponent fetches it's font via a property on the target window.
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.
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.
float getHorizontalTextExtent (const Window &window) const
 return the horizontal pixel extent of the formatted rendered string.
float getVerticalTextExtent (const Window &window) const
 return the vertical pixel extent of the formatted rendered string.
bool handleFontRenderSizeChange (Window &window, const Font *font) const
 perform any processing required due to the given font having changed.

Protected Member Functions

void render_impl (Window &srcWindow, Rectf &destRect, const CEGUI::ColourRect *modColours, const Rectf *clipper, bool clipToDisplay) const
 Function to do main render caching work.
void setupStringFormatter (const Window &window, const RenderedString &rendered_string) const
 helper to set up an appropriate FormattedRenderedString
const FontgetFontObject (const Window &window) const
 helper to get the font object to use

Detailed Description

Class that encapsulates information for a text component.


Member Function Documentation

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

Note:
This returns the name of the font set directly to the TextComponent, which may or may not be the actual font that will be used - since the actual font may be sourced from a property or the main font setting on a window that the TextComponent is rendered to, or the default font. To get the actual font name that will be used, call the getEffectiveFont function instead.
Returns:
String object containing the name of a font

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.

Return the current horizontal formatting setting for this TextComponent.

Returns:
One of the HorizontalTextFormatting enumerated values.

Return the text set for this TextComponent.

Note:
This returns the text string set directly to the TextComponent, which may or may not be the actual string that will be used - since the actual string may be sourced from a property or the main text string from a window that the TextComponent is rendered to. To get the actual string, call the getEffectiveText function instead.

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.

return text string with visual ordering of glyphs.

Note:
This returns the visual text derived from the string set directly to the TextComponent, which may or may not be the actual string that will be used - since the actual string may be sourced from a property or the main text string from a window that the TextComponent is rendered to. To get the actual visual string, call the getEffectiveVisualText function instead.

Return the current vertical formatting setting for this TextComponent.

Returns:
One of the VerticalTextFormatting enumerated values.

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.

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 a font to be used when rendering this TextComponent.

Note:
Setting this may not set the actual font that will be used when rendering the TextComponent. The acutal font used will depend upon whether a font source property is set and whether the font name set here is set to the empty string or not.
Parameters:
fontString containing name of a font

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.

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 string for this TextComponent.

Note:
Setting this string may not set the actual string that will be used when rendering the TextComponent. The acutal string used will depend upon whether a text source property is set and whether this string is set to the empty string or not.
Parameters:
textString containing text to set on the TextComponent.

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.

Set the vertical formatting setting for this TextComponent.

Parameters:
fmtOne of the VerticalTextFormatting enumerated values.
Returns:
Nothing.

Writes an xml representation of this TextComponent to out_stream.

Parameters:
xml_streamStream where xml data should be output.
Returns:
Nothing.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends