- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::GUI::Controls::CTextLabel Class Reference

Inheritance diagram for Exponent::GUI::Controls::CTextLabel:

List of all members.

## Detailed Description

Displays text in a box area.

Date:
  12/04/2005

Author:
  Paul Chana

Version:
  1.0.0 Initial version

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  CTextLabel.hpp,v 1.7 2007/02/08 21:07:54 paul Exp

Definition at line 37 of file CTextLabel.hpp.

## Public Member Functions

- CTextLabel (IControlRoot *root, const long uniqueId, const CRect &area, const CString &text)
- virtual void drawControl (CGraphics &graphics)
- virtual void drawFrameAndBackground (const bool draw=true)
- const CString & getText () const
- virtual void handleFileDrop (const CDropEvent &event)
- virtual void setColours (const CAlphaColour &frameColour=CAlphaColour::CALPHACOLOUR_BLACK, const CAlphaColour &backgroundColour=CAlphaColour::CALPHACOLOUR_WHITE, const CAlphaColour &textColour=CAlphaColour::CALPHACOLOUR_BLACK)
- virtual void setFont (CFont *font)
- virtual void setText (const CString &text)
- virtual void setTextColour (const CAlphaColour &textColour)
- virtual void setTextFormat (const CGraphics::ETextAlignment format)
- virtual ~CTextLabel ()

## Protected Attributes

- bool m_drawFrameAndBackground
- CFont * m_font
- CString m_text
- CAlphaColour m_textColour
- CGraphics::ETextAlignment m_textFormat

## Constructor & Destructor Documentation

Exponent::GUI::Controls::CTextLabel::CTextLabel | ( | IControlRoot * | root,
|  | const long | uniqueId,
|  | const CRect & | area,
|  | const CString & | text |
| ) |  |  |

Construction

Parameters:

  | root | The root control that this control is being added to
  | uniqueId | The unique Identifier of this control or CCONTROL_NO_ID_REQUIRED if no id is required
  | area | The area of this control relative to the root controls top left
  | text | The text to display

virtual Exponent::GUI::Controls::CTextLabel::~CTextLabel | ( |  | ) | `[virtual]`

Destruction

## Member Function Documentation

virtual void Exponent::GUI::Controls::CTextLabel::drawControl | ( | CGraphics & | graphics | ) | `[virtual]`

Draw the controls

Parameters:

  | graphics | The graphics context

Reimplemented from Exponent::GUI::Controls::CControl.

Reimplemented in Exponent::GUI::Controls::CComboBox, Exponent::GUI::Controls::CPresetBrowser::CPresetBrowserSelector::CPresetTextLabel, Exponent::GUI::Controls::CProgressBar, and Exponent::GUI::Controls::CTextEdit.

virtual void Exponent::GUI::Controls::CTextLabel::drawFrameAndBackground | ( | const bool | draw = `true` | ) | `[inline, virtual]`

Should we draw the frame

Parameters:

  | draw | If true then the fram and background will be drawn, if false then nothing except the string and the background image is draw (if applicable)

Definition at line 83 of file CTextLabel.hpp.

References m_drawFrameAndBackground.

const CString& Exponent::GUI::Controls::CTextLabel::getText | ( |  | ) | const`[inline]`

Get the text

Return values:

  | const | CString & The text

Reimplemented in Exponent::GUI::Controls::CPresetBrowser::CPresetBrowserSelector::CPresetTextLabel.

Definition at line 101 of file CTextLabel.hpp.

References m_text.

virtual void Exponent::GUI::Controls::CTextLabel::handleFileDrop | ( | const CDropEvent & | event | ) | `[virtual]`

Handle an object being dropped

Parameters:

  | event | The drop event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::CTextLabel::setColours | ( | const CAlphaColour & | frameColour = `CAlphaColour::CALPHACOLOUR_BLACK`,
|  | const CAlphaColour & | backgroundColour = `CAlphaColour::CALPHACOLOUR_WHITE`,
|  | const CAlphaColour & | textColour = `CAlphaColour::CALPHACOLOUR_BLACK` |
| ) |  |  | `[virtual]`

Set the colours to use

Parameters:

  | frameColour | The colour of the frame
  | backgroundColour | The background colour of the control
  | textColour | The colour of the text

virtual void Exponent::GUI::Controls::CTextLabel::setFont | ( | CFont * | font | ) | `[virtual]`

Set the font

Parameters:

  | font | The font to use

virtual void Exponent::GUI::Controls::CTextLabel::setText | ( | const CString & | text | ) | `[virtual]`

Set the text

Parameters:

  | text | The string to display

virtual void Exponent::GUI::Controls::CTextLabel::setTextColour | ( | const CAlphaColour & | textColour | ) | `[virtual]`

Set the text colour

Parameters:

  | textColour | The colour of the text

virtual void Exponent::GUI::Controls::CTextLabel::setTextFormat | ( | const CGraphics::ETextAlignment | format | ) | `[virtual]`

Set the format to draw with

Parameters:

  | format | The text format to draw with

See also:
  CGraphics

## Member Data Documentation

bool Exponent::GUI::Controls::CTextLabel::m_drawFrameAndBackground`[protected]`

Should we draw the frame and the background?

Definition at line 130 of file CTextLabel.hpp.

Referenced by drawFrameAndBackground().

CFont* Exponent::GUI::Controls::CTextLabel::m_font`[protected]`

The font to draw with

Definition at line 131 of file CTextLabel.hpp.

CString Exponent::GUI::Controls::CTextLabel::m_text`[protected]`

The text to display

Definition at line 133 of file CTextLabel.hpp.

Referenced by Exponent::GUI::Controls::CTextEdit::getString(), getText(), and Exponent::GUI::Controls::CPresetBrowser::CPresetBrowserSelector::CPresetTextLabel::getText().

CAlphaColour Exponent::GUI::Controls::CTextLabel::m_textColour`[protected]`

The colour of the text

Definition at line 132 of file CTextLabel.hpp.

CGraphics::ETextAlignment Exponent::GUI::Controls::CTextLabel::m_textFormat`[protected]`

Format to draw the text

Definition at line 135 of file CTextLabel.hpp.