JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Public Member Functions | Static Public Attributes
DrawableText Class Reference

A drawable object which renders a line of text. More...

Inherits Drawable.

List of all members.

Classes

class  ValueTreeWrapper
 Internally-used class for wrapping a DrawableText's state into a ValueTree. More...

Public Member Functions

 DrawableText ()
 Creates a DrawableText object.
 DrawableText (const DrawableText &other)
 ~DrawableText ()
 Destructor.
void setText (const String &newText)
 Sets the text to display.
const StringgetText () const noexcept
 Returns the currently displayed text.
void setColour (const Colour &newColour)
 Sets the colour of the text.
const ColourgetColour () const noexcept
 Returns the current text colour.
void setFont (const Font &newFont, bool applySizeAndScale)
 Sets the font to use.
const FontgetFont () const noexcept
 Returns the current font.
void setJustification (const Justification &newJustification)
 Changes the justification of the text within the bounding box.
const JustificationgetJustification () const noexcept
 Returns the current justification.
const RelativeParallelogramgetBoundingBox () const noexcept
 Returns the parallelogram that defines the text bounding box.
void setBoundingBox (const RelativeParallelogram &newBounds)
 Sets the bounding box that contains the text.
const RelativeCoordinategetFontHeight () const
void setFontHeight (const RelativeCoordinate &newHeight)
const RelativeCoordinategetFontHorizontalScale () const
void setFontHorizontalScale (const RelativeCoordinate &newScale)
void paint (Graphics &g)
DrawablecreateCopy () const
void refreshFromValueTree (const ValueTree &tree, ComponentBuilder &builder)
ValueTree createValueTree (ComponentBuilder::ImageProvider *imageProvider) const
Rectangle< float > getDrawableBounds () const

Static Public Attributes

static const Identifier valueTreeType

Detailed Description

A drawable object which renders a line of text.

See also:
Drawable

Constructor & Destructor Documentation

Creates a DrawableText object.

Destructor.


Member Function Documentation

void DrawableText::setText ( const String newText)

Sets the text to display.

const String& DrawableText::getText ( ) const

Returns the currently displayed text.

void DrawableText::setColour ( const Colour newColour)

Sets the colour of the text.

const Colour& DrawableText::getColour ( ) const

Returns the current text colour.

void DrawableText::setFont ( const Font newFont,
bool  applySizeAndScale 
)

Sets the font to use.

Note that the font height and horizontal scale are set as RelativeCoordinates using setFontHeight and setFontHorizontalScale. If applySizeAndScale is true, then these height and scale values will be changed to match the dimensions of the font supplied; if it is false, then the new font object's height and scale are ignored.

const Font& DrawableText::getFont ( ) const

Returns the current font.

void DrawableText::setJustification ( const Justification newJustification)

Changes the justification of the text within the bounding box.

Returns the current justification.

Returns the parallelogram that defines the text bounding box.

Sets the bounding box that contains the text.

void DrawableText::setFontHeight ( const RelativeCoordinate newHeight)
void DrawableText::paint ( Graphics g) [virtual]

Reimplemented from Component.

Drawable* DrawableText::createCopy ( ) const [virtual]

Implements Drawable.

void DrawableText::refreshFromValueTree ( const ValueTree tree,
ComponentBuilder builder 
)

Implements Drawable.

Rectangle<float> DrawableText::getDrawableBounds ( ) const [virtual]

Implements Drawable.


Member Data Documentation


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