NovaTK::ProgressBar Class Reference

Inheritance diagram for NovaTK::ProgressBar:
Collaboration diagram for NovaTK::ProgressBar:

List of all members.


Detailed Description

Graphically displays the status of a task. A progress bar simply represents a ratio. It fills a percentage of the horizontal bar corresponding to how complete the task that it represents.

Public Types

enum  TextMode { None, Percentage, Ratio, CustomString }

Public Member Functions

virtual NOVATKAPI NStatus Create (Window *parent, int c_x, int c_y, int c_width, int c_height)
virtual NOVATKAPI int Decrement ()
virtual NOVATKAPI void Destroy ()
virtual NOVATKAPI void Draw ()
virtual NOVATKAPI FontGetFont () const
virtual NOVATKAPI ulong GetForegroundColor () const
virtual NOVATKAPI ushort GetPercentage ()
virtual NOVATKAPI ushort GetValue ()
virtual NOVATKAPI int Increment ()
virtual NOVATKAPI void Set (uint value, uint max)
virtual NOVATKAPI void SetBarColor (ulong fgColor)
virtual NOVATKAPI void SetFont (Font *f)
virtual NOVATKAPI void SetForegroundColor (ulong fgColor)
virtual NOVATKAPI void SetMax (uint max)
virtual NOVATKAPI void SetPercentage (uint percentage)
virtual NOVATKAPI void SetText (const NString &s)

Member Enumeration Documentation

Specifies what type of text will be displayed at the center of the bar.

Enumerator:
None  No text will be displayed.
Percentage  The percentage out of 100 will be displayed(eg. "93%")
Ratio  The current value out of the maximum will be displayed in the format: CURRENT/MAX (eg. "25/66")
CustomString  The string specified by the function SetText will be displayed.


Member Function Documentation

NStatus NovaTK::ProgressBar::Create ( Window parent,
int  c_x,
int  c_y,
int  c_width,
int  c_height 
) [virtual]

This function is used by all widgets for initialization and to specify essential parameters. Each widget will reimplement this function but a few will have different parameters as needed(Such as Label). Most other member functions of all widgets cannot be called before calling this one except generally functions that specify attributes that must be known before creation of the widget.

Parameters:
parent Specifies the parent window.
c_x Specifies the location of the window's top-left corner along the X-axis relative to its parent.
c_y Specifies the location of the window's top-left corner along the Y-axis relative to its parent.
c_width Specifies the width of the window.
c_height Specifies the height of the window.
Returns:
NOVATK_SUCCESS upon successful creation of the widget otherwise returns NOVATK_ERROR_GENERAL_FAILURE.
Note:
By default, the widget has no border. When a widget is given a border, the top-left corner of the border itself will be the window's X and Y position minus its border width. The actual width of the widget with its border will be its width plus the border width and the same for height.

Reimplemented from NovaTK::Widget.

int NovaTK::ProgressBar::Decrement (  )  [virtual]

Decreases the current value by one if it's not already zero.

Returns:
The new value.

void NovaTK::ProgressBar::Destroy (  )  [virtual]

Destroys the widget.

Reimplemented from NovaTK::Widget.

void NovaTK::ProgressBar::Draw (  )  [virtual]

Redraws the widget. This function is called by NovaTK and doesn't normally need to be called outside of the toolkit.

Reimplemented from NovaTK::Widget.

Font * NovaTK::ProgressBar::GetFont (  )  const [virtual]

Note:
This function may be used before creating the widget. It is useful for dynamically determining the size of a widget. HOWEVER, it MAY NOT be used before initializing NovaTK.
Returns:
The primary font used by the widget.

Reimplemented from NovaTK::Widget.

ulong NovaTK::ProgressBar::GetForegroundColor (  )  const [virtual]

Returns:
The color set as the widget's font foreground color if it draws text.

Reimplemented from NovaTK::Widget.

virtual NOVATKAPI ushort NovaTK::ProgressBar::GetPercentage (  )  [inline, virtual]

Returns:
The perctange of the progress bar.

virtual NOVATKAPI ushort NovaTK::ProgressBar::GetValue (  )  [inline, virtual]

Returns:
The current value of the progress bar.

int NovaTK::ProgressBar::Increment (  )  [virtual]

Increases the current value by one if it's not already at the maximum.

Returns:
The new value.

void NovaTK::ProgressBar::Set ( uint  value,
uint  max 
) [virtual]

Specifies the current and maximum values of the progress bar.

void NovaTK::ProgressBar::SetBarColor ( ulong  fgColor  )  [virtual]

Specifies the color of the bar representing the ratio complete.

void NovaTK::ProgressBar::SetFont ( Font f  )  [virtual]

Sets the primary font used by the widget to that specified by f.

Reimplemented from NovaTK::Widget.

void NovaTK::ProgressBar::SetForegroundColor ( ulong  fgColor  )  [virtual]

Sets the primary foreground color for text used by the widget.

Reimplemented from NovaTK::Widget.

void NovaTK::ProgressBar::SetMax ( uint  max  )  [virtual]

Sets the maximum value.

void NovaTK::ProgressBar::SetPercentage ( uint  percentage  )  [virtual]

Sets the value of the progress bar expressed as a ratio out of a hundred. This is relative to the current maximum value

void NovaTK::ProgressBar::SetText ( const NString s  )  [virtual]

Sets the text drawn at the center of the bar if shown text is set to CustomString.

Note:
If the text mode isn't set as CustomString then the string specified here will be ignored.


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

Generated on Sat Sep 13 22:34:21 2008 for NovaTK by  doxygen 1.5.5