Nui
Classes | Public Types | Public Member Functions | Friends | List of all members
Nui::Components::DialogController Class Reference

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...
 

Detailed Description

Examplary dialog class for the most simple kinds of dialogs.

Member Enumeration Documentation

◆ Button

Enumerator
Ok 
Cancel 
Yes 
No 

◆ ButtonConfiguration

Enumerator
Ok 
OkCancel 
YesNo 
None 

Constructor & Destructor Documentation

◆ DialogController()

Nui::Components::DialogController::DialogController ( ConstructionArgs &&  args)

Constructs a new DialogController.

Parameters
argsThe intial values for the dialog.

Member Function Documentation

◆ hide()

void Nui::Components::DialogController::hide ( )

Hides the dialog.

◆ isOpen()

bool Nui::Components::DialogController::isOpen ( ) const

Returns true if the dialog is open.

◆ setBody()

void Nui::Components::DialogController::setBody ( std::string const &  body)

Sets the body of the dialog.

◆ setButtonClassName()

void Nui::Components::DialogController::setButtonClassName ( std::string const &  className)

Sets the class name of the dialog buttons.

◆ setButtonConfiguration()

void Nui::Components::DialogController::setButtonConfiguration ( ButtonConfiguration  buttons)

Sets the button configuration of the dialog.

◆ setClassName()

void Nui::Components::DialogController::setClassName ( std::string const &  className)

Sets the class name of the dialog.

◆ setOnButtonClicked()

void Nui::Components::DialogController::setOnButtonClicked ( std::function< void(Button)> const &  onButtonClicked)

Sets the callback that is called when a button is clicked.

◆ setTitle()

void Nui::Components::DialogController::setTitle ( std::string const &  title)

Sets the title of the dialog.

◆ show()

void Nui::Components::DialogController::show ( )

Shows the dialog as a non-modal dialog (does not block the UI).

◆ showModal()

void Nui::Components::DialogController::showModal ( )

Shows the dialog as a modal dialog (blocks the UI).

Friends And Related Function Documentation

◆ Dialog

Nui::ElementRenderer Dialog ( DialogController controller)
friend

Creates a dialog element with the specified controller.

Parameters
controllerAn instance of DialogController.

The documentation for this class was generated from the following files: