83 void setTitle(std::string
const& title);
88 void setBody(std::string
const& body);
109 std::weak_ptr<Dom::Element> element_;
115 std::function<void(
Button)> onButtonClicked_;
Examplary dialog class for the most simple kinds of dialogs.
Definition: dialog.hpp:16
friend Nui::ElementRenderer Dialog(DialogController &controller)
Creates a dialog element with the specified controller.
Definition: dialog.cpp:90
void setClassName(std::string const &className)
Sets the class name of the dialog.
Definition: dialog.cpp:60
DialogController(ConstructionArgs &&args)
Constructs a new DialogController.
Definition: dialog.cpp:23
void setTitle(std::string const &title)
Sets the title of the dialog.
Definition: dialog.cpp:70
void setOnButtonClicked(std::function< void(Button)> const &onButtonClicked)
Sets the callback that is called when a button is clicked.
Definition: dialog.cpp:85
void setButtonConfiguration(ButtonConfiguration buttons)
Sets the button configuration of the dialog.
Definition: dialog.cpp:80
void hide()
Hides the dialog.
Definition: dialog.cpp:48
void setBody(std::string const &body)
Sets the body of the dialog.
Definition: dialog.cpp:75
void showModal()
Shows the dialog as a modal dialog (blocks the UI).
Definition: dialog.cpp:34
bool isOpen() const
Returns true if the dialog is open.
Definition: dialog.cpp:55
void show()
Shows the dialog as a non-modal dialog (does not block the UI).
Definition: dialog.cpp:41
void setButtonClassName(std::string const &className)
Sets the class name of the dialog buttons.
Definition: dialog.cpp:65
Button
Definition: dialog.hpp:19
ButtonConfiguration
Definition: dialog.hpp:26
Definition: observed_value.hpp:1202
Definition: dialog.hpp:11
std::function< std::shared_ptr< Dom::Element >(Dom::Element &, Renderer const &)> ElementRenderer
Definition: element_renderer.hpp:11
Definition: dialog.hpp:34
std::optional< std::string > className
Definition: dialog.hpp:35
std::string title
Definition: dialog.hpp:36
ButtonConfiguration buttonConfiguration
Definition: dialog.hpp:39
std::string body
Definition: dialog.hpp:37
std::function< void(Button)> onButtonClicked
Definition: dialog.hpp:40
std::string buttonClassName
Definition: dialog.hpp:38