Wt 3.1.10
|
A progress bar. More...
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 WString & | format () 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. | |
Signal & | progressCompleted () |
A signal that indicates when 100% is reached. | |
virtual void | resize (const WLength &width, const WLength &height) |
Resizes the widget. |
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.
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.
const WString& Wt::WProgressBar::format | ( | ) | const |
Returns the progress format string.
double Wt::WProgressBar::maximum | ( | ) | const |
Returns the maximum value.
double Wt::WProgressBar::minimum | ( | ) | const |
Returns the minimum value.
Signal& Wt::WProgressBar::progressCompleted | ( | ) |
A signal that indicates when 100% is reached.
This signal is emitted when setValue(maximum()) is called.
Resizes the widget.
Specify a new size for this widget, by specifying width and height. By default a widget has automatic width and height, see WLength::isAuto().
This applies to CSS-based layout, and only block widgets can be given a size reliably.
When inserted in a layout manager, the widget may be informed about its current size using setLayoutSizeAware(). If you have defined a "wtResize()"
JavaScript method for the widget, then this method will also be called. operation.
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 0%.
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.
void Wt::WProgressBar::setValue | ( | double | value | ) |
WString Wt::WProgressBar::text | ( | ) | const [virtual] |
Signal<double>& Wt::WProgressBar::valueChanged | ( | ) |
A signal that indicates when the value has changed.
This signal is emitted when setValue() is called.