Nui
|
Examplary dialog class for the most simple kinds of dialogs. More...
#include <dialog.hpp>
Classes | |
struct | ConstructionArgs |
Public Types | |
enum class | Button { Ok , Cancel , Yes , No } |
enum class | ButtonConfiguration { Ok , OkCancel , YesNo , None } |
Public Member Functions | |
DialogController (ConstructionArgs &&args) | |
Constructs a new DialogController. More... | |
void | showModal () |
Shows the dialog as a modal dialog (blocks the UI). More... | |
void | show () |
Shows the dialog as a non-modal dialog (does not block the UI). More... | |
void | hide () |
Hides the dialog. More... | |
bool | isOpen () const |
Returns true if the dialog is open. More... | |
void | setClassName (std::string const &className) |
Sets the class name of the dialog. More... | |
void | setButtonClassName (std::string const &className) |
Sets the class name of the dialog buttons. More... | |
void | setTitle (std::string const &title) |
Sets the title of the dialog. More... | |
void | setBody (std::string const &body) |
Sets the body of the dialog. More... | |
void | setButtonConfiguration (ButtonConfiguration buttons) |
Sets the button configuration of the dialog. More... | |
void | setOnButtonClicked (std::function< void(Button)> const &onButtonClicked) |
Sets the callback that is called when a button is clicked. More... | |
Friends | |
Nui::ElementRenderer | Dialog (DialogController &controller) |
Creates a dialog element with the specified controller. More... | |
Examplary dialog class for the most simple kinds of dialogs.
|
strong |
Nui::Components::DialogController::DialogController | ( | ConstructionArgs && | args | ) |
Constructs a new DialogController.
args | The intial values for the dialog. |
void Nui::Components::DialogController::hide | ( | ) |
Hides the dialog.
bool Nui::Components::DialogController::isOpen | ( | ) | const |
Returns true if the dialog is open.
void Nui::Components::DialogController::setBody | ( | std::string const & | body | ) |
Sets the body of the dialog.
void Nui::Components::DialogController::setButtonClassName | ( | std::string const & | className | ) |
Sets the class name of the dialog buttons.
void Nui::Components::DialogController::setButtonConfiguration | ( | ButtonConfiguration | buttons | ) |
Sets the button configuration of the dialog.
void Nui::Components::DialogController::setClassName | ( | std::string const & | className | ) |
Sets the class name of the dialog.
void Nui::Components::DialogController::setOnButtonClicked | ( | std::function< void(Button)> const & | onButtonClicked | ) |
Sets the callback that is called when a button is clicked.
void Nui::Components::DialogController::setTitle | ( | std::string const & | title | ) |
Sets the title of the dialog.
void Nui::Components::DialogController::show | ( | ) |
Shows the dialog as a non-modal dialog (does not block the UI).
void Nui::Components::DialogController::showModal | ( | ) |
Shows the dialog as a modal dialog (blocks the UI).
|
friend |
Creates a dialog element with the specified controller.
controller | An instance of DialogController. |