![]() |
1.12 |
A dialog is a widget that allows user to make a decision. More...
#include <dialog.h>

Public Types | |
| enum class | ButtonId { button1 , button2 } |
| Used to identify the button on the dialog. More... | |
Public Member Functions | |
| Dialog (const Rect &rect={}) noexcept | |
| Create a dialog with two buttons to handle decision. | |
| Dialog (Serializer::Properties &props) noexcept | |
| void | button (ButtonId button, const std::string &text) |
| Set Button details for this dialog. | |
| void | icon (const Image &icon) |
| Set a icon in a title area of a dialog. | |
| void | layout () override |
| Perform layout on dialog Widget. | |
| Size | min_size_hint () const override |
| Get a minimum size hint of the Dialog Widget. | |
| void | resize (const Size &size) override |
| Resize the Dialog Widget. | |
| void | title (const Image &icon, const std::string &title) |
| Set the title info for this dialog. | |
| void | title (const std::string &title) |
| Set a title text for this dialog. | |
| void | widget (const std::shared_ptr< Widget > &widget) |
| Set a widget for this dialog. | |
Public Member Functions inherited from PopupType< T > | |
| PopupType (const Size &size={}, const Point &point={}) noexcept | |
| PopupType (Serializer::Properties &props) noexcept | |
| void | hide () override |
| Hide the Widget. | |
| void | show () override |
| Show the Widget. | |
| virtual void | show_centered () |
| Show the window centered. | |
| virtual void | show_modal (bool center=false) |
| Show the window in modal mode. | |
Public Attributes | |
| Signal | on_button1_click |
| Event signal. | |
| Signal | on_button2_click |
| Signal when button2 is clicked. | |
Protected Member Functions | |
| Dialog (Serializer::Properties &props, bool is_derived) noexcept | |
| void | initialize (bool init_inherited_properties=true) |
Protected Member Functions inherited from PopupType< T > | |
| PopupType (Serializer::Properties &props, bool is_derived) noexcept | |
Protected Attributes | |
| Button | m_button1 |
| Button for okay or cancel. | |
| Button | m_button2 |
| Button for okay or cancel. | |
| VerticalBoxSizer | m_content |
| Content sizer. | |
| std::shared_ptr< StaticGrid > | m_grid |
| Grid for organizing okay & cancel Buttons. | |
| VerticalBoxSizer | m_layout |
| Layout sizer. | |
| ImageLabel | m_title |
| Dialog title. | |
A dialog is a widget that allows user to make a decision.
A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed further.
A basic dialog contains three regions:
Title: Title of a dialog. Content: a message text or an widget. Buttons: two buttons to make a decision.
|
strong |
Create a dialog with two buttons to handle decision.
| [in] | rect | Initial rectangle of the widget. |
|
inlineexplicitnoexcept |
| [in] | props | list of widget argument and its properties. |
|
explicitprotectednoexcept |
| void button | ( | ButtonId | button, |
| const std::string & | text | ||
| ) |
Set Button details for this dialog.
| [in] | button | is buttonid |
| [in] | text | is a text to display on button. |
| void icon | ( | const Image & | icon | ) |
Set a icon in a title area of a dialog.
|
protected |
|
override |
Perform layout on dialog Widget.
|
override |
| void title | ( | const Image & | icon, |
| const std::string & | title | ||
| ) |
Set the title info for this dialog.
| [in] | icon | set the icon in a title. |
| [in] | title | set the title text. |
| void title | ( | const std::string & | title | ) |
Set a title text for this dialog.
| void widget | ( | const std::shared_ptr< Widget > & | widget | ) |
Set a widget for this dialog.
| [in] | widget |
|
protected |
Content sizer.
|
protected |
Grid for organizing okay & cancel Buttons.
|
protected |
Layout sizer.
|
protected |
Dialog title.