#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) |
Change the message that you want to be displayed. |
This loading indicator uses a gray semi-transparent overlay to darken the window contents, and centers a loading icon (with some text).
To use the overloading indicator:
WApplication::instance()->setLoadingIndicator(new WOverlayLoadingIndicator());
The overlay loading indicator
WApplication::instance()->styleSheet().addRule("body", "margin: 0px");
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 |
background: white; border: 3px solid #333333; z-index: 10001; visibility: visible; position: absolute; left: 50%; top: 50%; margin-left: -50px; margin-top: -40px; width: 100px; height: 80px; font-family: arial,sans-serif; text-align: center
if backgroundStyleClass is not set, the background gets the CSS style elements
virtual WWidget* Wt::WOverlayLoadingIndicator::widget | ( | ) | [inline, 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. You should position the widget on the screen 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 these 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.
void Wt::WOverlayLoadingIndicator::setMessage | ( | const WString & | text | ) | [virtual] |
Change 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.