#include <Popup.h>
Public Member Functions | |
void | setMessage (const WString &message) |
Change the message. | |
void | setDefaultValue (const std::string defaultValue) |
Change the default value for a prompt dialog. | |
const WMessage & | message () const |
Get the current message. | |
const std::string & | defaultValue () const |
Get the default value for a prompt dialog. | |
Static Public Member Functions | |
static Popup * | createConfirm (const WString &message, WObject *parent=0) |
Create a confirm dialog. | |
static Popup * | createPrompt (const WString &message, const std::string defaultValue, WObject *parent=0) |
Create a prompt dialog with the given default value. | |
static Popup * | createAlert (const WString &message, WObject *parent=0) |
Create an alert dialog. | |
Public Attributes | |
JSlot | show |
Show the dialog. | |
JSignal< std::string > | okPressed |
Signal emitted when ok pressed. | |
JSignal< void > | cancelPressed |
Signal emitted when cancel is pressed. | |
Private Types | |
enum | Type { Confirm, Alert, Prompt } |
Popup type. More... | |
Private Member Functions | |
Popup (Type t, const WString &message, const std::string defaultValue, WObject *parent) | |
Popup constructor. | |
void | setJavaScript () |
Update the javascript code. | |
Private Attributes | |
Type | t_ |
WString | message_ |
std::string | defaultValue_ |
Use one of the create static methods to create a popup. This will not display the popup, until either the show slot is triggered from an event handler, or is executed using it's exec() method.
When the user closes the popup, either the okPressed or cancelPressed signal is emitted. For a prompt dialog, the value is passed as a parameter to the okPressed signal.
Definition at line 32 of file Popup.h.
enum Popup::Type [private] |
void Popup::setMessage | ( | const WString & | message | ) |
void Popup::setDefaultValue | ( | const std::string | defaultValue | ) |
const WMessage& Popup::message | ( | ) | const [inline] |
const std::string& Popup::defaultValue | ( | ) | const [inline] |
void Popup::setJavaScript | ( | ) | [private] |
JSignal<std::string> Popup::okPressed |
JSignal<void> Popup::cancelPressed |
WString Popup::message_ [private] |
std::string Popup::defaultValue_ [private] |