Main Page Class Hierarchy Compound List File List Compound Members File Members Related Pages Examples

# SDLLabel Class Reference

Text label. More...

`#include <sdllabel.h>`

Inheritance diagram for SDLLabel

[legend]
Collaboration diagram for SDLLabel:

[legend]
List of all members.

## Public Methods
| SDLLabel (SDLWidget* parent, SDL_Rect& r, char* text, bool storebackground = true)
| Only constructor. More...
| ~SDLLabel ()
| Only destructor. More...
void | SetText (char* text)
| Sets text. More...
void | SetTextFormat (char* text, ...)
| Sets formated text (like printf). More...
char* | GetText ()
| Returns text. More...
void | SetAlignment (int a)
| Sets text alignment. More...
void | GetTextExtend (char* text, int& width, int &height)
SDL_Surface* | SetIcon (char* filename)
SDL_Surface* | SetIcon (SDL_Surface* icon)
## Static Public Methods
void | GetTextExtend (char* text, int& width, int &height, TTF_Font* font = NULL)
## Protected Methods
void | eventDraw (SDL_Surface* surface, SDL_Rect* rect)
| Draw event handler. More...
void | eventBlit (SDL_Surface* srf, SDL_Rect* src, SDL_Rect* dst)
## Protected Attributes
SDL_Surface* | my_srfIcon

## Detailed Description

Text label.

Author(s):
  Alexander Pipelka

A text label (unmodifiable by end user). Has attributes for font style, alignment, etc.

Definition at line 52 of file sdllabel.h.

## Constructor & Destructor Documentation

SDLLabel::SDLLabel ( | SDLWidget * parent,
| SDL_Rect & r,
| char * text,
| bool storebackground = true )

  | Only constructor. Parameters:
  parent | Parent widget.
  r | Rectangle to draw in, relative to parent.
  text | Text displayed by label.
  storebackground | Whether or not label has an internal background.

SDLLabel::~SDLLabel ( | )

| Only destructor.

## Member Function Documentation

char * SDLLabel::GetText ( | )

| Returns text.

void SDLLabel::GetTextExtend ( | char * text,
| int & width,
| int & height )

void SDLLabel::GetTextExtend ( | char * text,
| int & width,
| int & height,
| TTF_Font * font = NULL )`[static]`

void SDLLabel::SetAlignment ( | int a )

| Sets text alignment.

SDL_Surface * SDLLabel::SetIcon ( | SDL_Surface * icon )

SDL_Surface * SDLLabel::SetIcon ( | char * filename )

void SDLLabel::SetText ( | char * text )

| Sets text.

void SDLLabel::SetTextFormat ( | char * text,
| ... )

| Sets formated text (like printf).

void SDLLabel::eventBlit ( | SDL_Surface * srf,
| SDL_Rect * src,
| SDL_Rect * dst )`[protected, virtual]`

| Reimplemented from SDLDrawObject. Reimplemented in SDLColumnItem, and SDLListBoxItem.

void SDLLabel::eventDraw ( | SDL_Surface * surface,
| SDL_Rect * rect )`[protected, virtual]`

  | Draw event handler. Parameters:
  SDL_Surface | Surface to draw to.
  rect | Rectangle to draw in, relative to surface.
Reimplemented from SDLDrawObject. Reimplemented in SDLColumnItem.

## Member Data Documentation

SDL_Surface * SDLLabel::my_srfIcon`[protected]`

| Definition at line 103 of file sdllabel.h.

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

- sdllabel.h