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

ProgressBar Class Reference

ProgressBar Class Reference

ProgressBar class. More...

#include <ProgressBar.h>

Inherits Control.

Public Member Functions

 ProgressBar (int x, int y, int w, int h, Font *fnt)
 Create a ProgressBar object with the specified size, position, and font.
float value ()
 Get the current value of the ProgressBar.
void value (float v)
 Set the value of the ProgressBar.
virtual void paint (Canvas *canvas)
 Paint the ProgressBar 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

ProgressBar class.

Used to a percentage as a bar.

Definition at line 27 of file ProgressBar.h.


Constructor & Destructor Documentation

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

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

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

Definition at line 19 of file ProgressBar.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.

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 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.

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.

void margin ( int  m ) [inherited]

Set the margin width.

Parameters:
mThe new margin width.

Definition at line 113 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 padding ( int  p ) [inherited]

Set the padding width.

Parameters:
pThe new padding width.

Definition at line 141 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 paint ( Canvas canvas ) [virtual]

Paint the ProgressBar on the specified canvas.

Parameters:
canvasPointer to the canvas to paint on.

Reimplemented from Control.

Definition at line 50 of file ProgressBar.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.

void text ( const char *  text ) [inherited]

Set the text of the control.

Parameters:
textThe new text.

Definition at line 203 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 value ( float  v )

Set the value of the ProgressBar.

Parameters:
vThe new progress bar value as a percentage (0.0 to 1.0).

Definition at line 36 of file ProgressBar.cpp.

float value (  )

Get the current value of the ProgressBar.

Returns:
The current value as a percentage (0.0 to 1.0).

Definition at line 30 of file ProgressBar.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.

int width (  ) [inherited]

Get the width of the control.

Returns:
The width of the control.

Definition at line 80 of file Control.cpp.