Jamba C++ API  5.1.1
IDialogHandler Class Referenceabstract

Defines the interface to show or dismiss a modal/dialog window which is a window that captures all events and must be dismissed (by calling IDialogHandler::dismissDialog). More...

#include <IDialogHandler.h>

Inherited by GUIController, and GUIState.

Public Member Functions

virtual bool dismissDialog ()=0
 Dismisses the currently shown dialog. More...
 
virtual bool showDialog (std::string iTemplateName)=0
 This method is called with the name of the template to use for the dialog. More...
 
virtual ~IDialogHandler ()=default
 Destructor. More...
 

Detailed Description

Defines the interface to show or dismiss a modal/dialog window which is a window that captures all events and must be dismissed (by calling IDialogHandler::dismissDialog).

Typical usages are for About windows or alert messages.

The primary way to use it in the code is via the gui state (which implements this interface)

// Example from some controller (aboutButton is a TextButtonView)
aboutButton->setOnClickListener([this] {
fState->showDialog("about_dialog");
});
// From another controller tied to the about_dialog view (set via the sub-controller attribute)
dismissButton->setOnClickListener([this] {
fState->dismissDialog();
});

Constructor & Destructor Documentation

◆ ~IDialogHandler()

virtual ~IDialogHandler ( )
virtualdefault

Destructor.

Member Function Documentation

◆ dismissDialog()

virtual bool dismissDialog ( )
pure virtual

Dismisses the currently shown dialog.

Returns
true if there was a dialog shown or false otherwise

Implemented in GUIState, and GUIController.

◆ showDialog()

virtual bool showDialog ( std::string  iTemplateName)
pure virtual

This method is called with the name of the template to use for the dialog.

It should be a template defined in the xml file (.uidesc) as a top level template.

Note
Because the view is modal it must include a way for the user to dismiss it, like a button.
Parameters
iTemplateNamethe name of the top level template to use
Returns
true if the dialog was shown and false if there was a problem (for example iTemplateName does not refer to a valid top level template name)

Implemented in GUIState, and GUIController.


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