Wt
3.2.1
|
A more obvious loading indicator that grays the window. More...
#include <Wt/WOverlayLoadingIndicator>
Public Member Functions | |
WOverlayLoadingIndicator (const WString &styleClass=WString(), const WString &backgroundStyleClass=WString(), const WString &textStyleClass=WString()) | |
Construct the loading indicator. | |
virtual WWidget * | widget () |
Returns the widget that visually represents the indicator. | |
virtual void | setMessage (const WString &text) |
Sets the message that you want to be displayed. |
A more obvious loading indicator that grays the window.
This loading indicator uses a gray semi-transparent overlay to darken the window contents, and centers a loading icon (with some text).
Usage example:
Wt::WApplication *app = Wt::WApplication::instance(); app->setLoadingIndicator(new Wt::WOverlayLoadingIndicator());
WApplication::instance()->styleSheet().addRule("body", "margin: 0px");
This widget does not provide styling, and can be styled using inline or external CSS as appropriate.
The strings used in this class can be translated by overriding the default values for the following localization keys:
Wt::WOverlayLoadingIndicator::WOverlayLoadingIndicator | ( | const WString & | styleClass = WString() , |
const WString & | backgroundStyleClass = WString() , |
||
const WString & | textStyleClass = WString() |
||
) |
Construct the loading indicator.
styleClass | the style class for the central box |
backgroundStyleClass | the style class for the "background" part of the indicator |
textStyleClass | the style class for the text that is displayed |
void Wt::WOverlayLoadingIndicator::setMessage | ( | const WString & | text | ) | [virtual] |
Sets the message that you want to be displayed.
If the indicator is capable of displaying a text message, then you should reimplement this method to allow this message to be modified.
Implements Wt::WLoadingIndicator.
virtual WWidget* Wt::WOverlayLoadingIndicator::widget | ( | ) | [virtual] |
Returns the widget that visually represents the indicator.
You should reimplement this method to return a widget that will be shown to indicate that a response is pending. The widget should be positioned using CSS.
The widget will be shown and hidden using WWidget::show() and WWidget::hide(). If you want to customize this behaviour, you should reimplement the WWidget::setHidden() method. Note that show() and hide() are stateless slots, and thus you need to make sure that your implementation comforms to that contract, so that it may be optimized to JavaScript (the server-side implementation will only be called during stateless slot prelearning).
Implements Wt::WLoadingIndicator.