A simple yet powerful library for controlling graphical displays. Multiple display controllers are supported using inheritance.

Dependents:   mbed_rifletool Hexi_Bubble_Game Hexi_Catch-the-dot_Game Hexi_Acceleromagnetic_Synth

Embed: (wiki syntax)

« Back to documentation index

Label Class Reference

Label Class Reference

Label class. More...

#include <Label.h>

Inherits Control.

Public Member Functions

 Label (int x, int y, int w, int h, Font *fnt)
 Create a Label object with the specified size, position, and font.
virtual void paint (Canvas *canvas)
 Paint the Label on the specified canvas.
int posX ()
 Get the X coordinate of the control.
void posX (int x)
 Set the X coordinate of the control.
int posY ()
 Get the Y coordinate of the control.
void posY (int y)
 Set the Y coordinate of the control.
int width ()
 Get the width of the control.
void width (int w)
 Set the width of the control.
int height ()
 Get the height of the control.
void height (int h)
 Set the height of the control.
int margin ()
 Get the current margin width.
void margin (int m)
 Set the margin width.
int border ()
 Get the current border width.
void border (int b)
 Set the border width.
int padding ()
 Get the current padding width.
void padding (int p)
 Set the padding width.
int contentPosX ()
 Get the X coordinate of the control's content area.
int contentPosY ()
 Get the Y coordinate of the control's content area.
int contentWidth ()
 Get the width of the control's content area.
int contentHeight ()
 Get the height of the control's content area.
unsigned int foreColor ()
 Get the foreground color.
void foreColor (unsigned int c)
 Set the foreground color.
unsigned int backColor ()
 Get the background color.
void backColor (unsigned int c)
 Set the background color.
const char * text ()
 Get the current text of the control.
void text (const char *text)
 Set the text of the control.
Fontfont ()
 Get the current font of the control.
void font (Font *fnt)
 Set the font of the control.
bool invalid ()
 Determine whether the control needs to be repainted.
void invalidate ()
 Mark this control as invalid.

Detailed Description

Label class.

Used to display strings.

Definition at line 27 of file Label.h.


Constructor & Destructor Documentation

Label ( int  x,
int  y,
int  w,
int  h,
Font fnt 
)

Create a Label object with the specified size, position, and font.

Parameters:
xThe X coordinate of the Label.
yThe Y coordinate of the Label.
wThe width of the Label.
hThe height of the Label.
fntThe font to draw text with.

Definition at line 19 of file Label.cpp.


Member Function Documentation

unsigned int backColor (  ) [inherited]

Get the background color.

Returns:
The background color as a 32-bit ARGB value.

Definition at line 184 of file Control.cpp.

void backColor ( unsigned int  c ) [inherited]

Set the background color.

Parameters:
cThe new background color as a 32-bit ARGB value.

Definition at line 189 of file Control.cpp.

int border (  ) [inherited]

Get the current border width.

Returns:
The current border width.

Definition at line 122 of file Control.cpp.

void border ( int  b ) [inherited]

Set the border width.

Parameters:
bThe new border width.

Definition at line 127 of file Control.cpp.

int contentHeight (  ) [inherited]

Get the height of the control's content area.

Returns:
The height of the control's content area.

Definition at line 165 of file Control.cpp.

int contentPosX (  ) [inherited]

Get the X coordinate of the control's content area.

Returns:
The X coordinate of the control's content area.

Definition at line 150 of file Control.cpp.

int contentPosY (  ) [inherited]

Get the Y coordinate of the control's content area.

Returns:
The Y coordinate of the control's content area.

Definition at line 155 of file Control.cpp.

int contentWidth (  ) [inherited]

Get the width of the control's content area.

Returns:
The width of the control's content area.

Definition at line 160 of file Control.cpp.

Font * font (  ) [inherited]

Get the current font of the control.

Returns:
The current font of the control.

Definition at line 212 of file Control.cpp.

void font ( Font fnt ) [inherited]

Set the font of the control.

Parameters:
fntThe new font.

Definition at line 217 of file Control.cpp.

void foreColor ( unsigned int  c ) [inherited]

Set the foreground color.

Parameters:
cThe new foreground color as a 32-bit ARGB value.

Definition at line 175 of file Control.cpp.

unsigned int foreColor (  ) [inherited]

Get the foreground color.

Returns:
The foreground color as a 32-bit ARGB value.

Definition at line 170 of file Control.cpp.

void height ( int  h ) [inherited]

Set the height of the control.

Parameters:
hThe new height for the control.

Definition at line 99 of file Control.cpp.

int height (  ) [inherited]

Get the height of the control.

Returns:
The height of the control.

Definition at line 94 of file Control.cpp.

bool invalid (  ) [inherited]

Determine whether the control needs to be repainted.

Returns:
Whether or not the control needs to be repainted.

Definition at line 226 of file Control.cpp.

void invalidate (  ) [inherited]

Mark this control as invalid.

Definition at line 231 of file Control.cpp.

int margin (  ) [inherited]

Get the current margin width.

Returns:
The current margin width.

Definition at line 108 of file Control.cpp.

void margin ( int  m ) [inherited]

Set the margin width.

Parameters:
mThe new margin width.

Definition at line 113 of file Control.cpp.

int padding (  ) [inherited]

Get the current padding width.

Returns:
The current padding width.

Definition at line 136 of file Control.cpp.

void padding ( int  p ) [inherited]

Set the padding width.

Parameters:
pThe new padding width.

Definition at line 141 of file Control.cpp.

void paint ( Canvas canvas ) [virtual]

Paint the Label on the specified canvas.

Parameters:
canvasPointer to the canvas to paint on.

Reimplemented from Control.

Definition at line 27 of file Label.cpp.

void posX ( int  x ) [inherited]

Set the X coordinate of the control.

Parameters:
xThe new X coordinate for the control.

Definition at line 57 of file Control.cpp.

int posX (  ) [inherited]

Get the X coordinate of the control.

Returns:
The X coordinate of the control.

Definition at line 52 of file Control.cpp.

void posY ( int  y ) [inherited]

Set the Y coordinate of the control.

Parameters:
yThe new Y coordinate for the control.

Definition at line 71 of file Control.cpp.

int posY (  ) [inherited]

Get the Y coordinate of the control.

Returns:
The Y coordinate of the control.

Definition at line 66 of file Control.cpp.

const char * text (  ) [inherited]

Get the current text of the control.

Returns:
The current text of the control.

Definition at line 198 of file Control.cpp.

void text ( const char *  text ) [inherited]

Set the text of the control.

Parameters:
textThe new text.

Definition at line 203 of file Control.cpp.

int width (  ) [inherited]

Get the width of the control.

Returns:
The width of the control.

Definition at line 80 of file Control.cpp.

void width ( int  w ) [inherited]

Set the width of the control.

Parameters:
wThe new width for the control.

Definition at line 85 of file Control.cpp.