Wt  3.2.3
Public Member Functions
Wt::WProgressBar Class Reference

A progress bar. More...

Inheritance diagram for Wt::WProgressBar:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 WProgressBar (WContainerWidget *parent=0)
 Creates a progress bar.
void setMinimum (double minimum)
 Sets the minimum value.
double minimum () const
 Returns the minimum value.
void setMaximum (double maximum)
 Sets the maximum value.
double maximum () const
 Returns the maximum value.
void setRange (double minimum, double maximum)
 Sets the range.
void setValue (double value)
 Sets the current progress.
double value () const
 Returns the current progress.
void setFormat (const WString &format)
 Sets the progress format string.
const WStringformat () const
 Returns the progress format string.
virtual WString text () const
 Returns the text displayed inside the progress bar.
Signal< double > & valueChanged ()
 A signal that indicates when the value has changed.
SignalprogressCompleted ()
 A signal that indicates when 100% is reached.
virtual void resize (const WLength &width, const WLength &height)
 Resizes the widget.

Detailed Description

A progress bar.

The progress bar can be used to indicate the progress of a certain operation. The text displayed in the progress bar can be customized by specializing text().

To use the progress bar, you need to give it a range (minimum and maximum value), and update the progress using setValue().

WProgressBar is an inline widget.

CSS

Using HTML4, the widget is implemented using a set of nested DIVs. The element can be styled using the Wt-progressbar style. It may be styled through the current theme, or you can override the style using internal or external CSS as appropriate.

Note:
With the advent of HTML5, this widget will be implemented using the native HTML5 control when available.

Member Function Documentation

const WString& Wt::WProgressBar::format ( ) const

Returns the progress format string.

See also:
setFormat()
double Wt::WProgressBar::maximum ( ) const

Returns the maximum value.

See also:
setMaximum()
double Wt::WProgressBar::minimum ( ) const

Returns the minimum value.

See also:
setMinimum()
Signal& Wt::WProgressBar::progressCompleted ( )

A signal that indicates when 100% is reached.

This signal is emitted when setValue(maximum()) is called.

See also:
setValue()
void Wt::WProgressBar::resize ( const WLength width,
const WLength height 
) [virtual]

Resizes the widget.

Specifies a fixed size for this widget, setting CSS width and height properties. By default a widget has automatic width and height, which sets a size for the widget following CSS rules.

When the widget is not managed by a layout manager, the automatic (natural) size of a widget depends on whether they widget is a block or inline widget:

  • a block widget takes by default the width of the parent, and the height that it needs based on its contents
  • an inline widget takes the width and height that it needs based on its contents (possibly wrapping over multiple lines). The width and height of an inline widget cannot be changed (by the letter of CSS, although most browsers will react to it in varying ways).

When inserted in a layout manager, the size set will be used as a widget's preferred size, but the widget may be given a different size by the layout manager based on available space and stretch factors. The actual size given by a layout manager may be retrieved by making the widget "layout size aware", using setLayoutSizeAware(). If you have defined a "wtResize()" JavaScript method for the widget, then this method will also be called.

The default width and height of a widget is WLength::Auto.

See also:
width(), height()

Reimplemented from Wt::WWebWidget.

void Wt::WProgressBar::setFormat ( const WString format)

Sets the progress format string.

The format is used by text() to indicate the progress value.

The default value is "%.0f %%"

void Wt::WProgressBar::setMaximum ( double  maximum)

Sets the maximum value.

The maximum value is the value that corresponds to 100%.

The default value is 100.

void Wt::WProgressBar::setMinimum ( double  minimum)

Sets the minimum value.

The minimum value is the value that corresponds to 0%.

The default value is 0.

void Wt::WProgressBar::setRange ( double  minimum,
double  maximum 
)

Sets the range.

See also:
setMinimum(), setMaximum()
void Wt::WProgressBar::setValue ( double  value)

Sets the current progress.

value must be a value between minimum() and maximum().

WString Wt::WProgressBar::text ( ) const [virtual]

Returns the text displayed inside the progress bar.

This text must be an XHTML formatted text fragment. The default text prints the current progress using format(). You may want to reimplement this method to display a different text corresponding to the current value().

Signal<double>& Wt::WProgressBar::valueChanged ( )

A signal that indicates when the value has changed.

This signal is emitted when setValue() is called.

See also:
setValue()
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator

Generated on Thu Nov 1 2012 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1