Class that represents a dialog, which is a simple way to show a message and various options to the user and get a response.
More...
#include <ui_Dialog.hpp>
|
| static constexpr Color | DefaultTitleColor = { 0xA, 0xA, 0xA, 0xFF } |
| |
| static constexpr Color | DefaultContentColor = { 0x14, 0x14, 0x14, 0xFF } |
| |
| static constexpr Color | DefaultOptionColor = { 0xA, 0xA, 0xA, 0xFF } |
| |
| static constexpr u32 | DefaultDialogBorderRadius = 52 |
| |
| static constexpr u32 | DefaultSpaceBetweenOptions = 30 |
| |
| static constexpr u32 | DefaultSpaceBetweenOptionRows = 15 |
| |
| static constexpr u32 | DefaultTitleExtraWidth = 135 |
| |
| static constexpr u32 | DefaultContentExtraWidth = 135 |
| |
| static constexpr u32 | DefaultSpaceBetweenContentAndOptions = 210 |
| |
| static constexpr u32 | DefaultTitleTopMargin = 30 |
| |
| static constexpr u32 | DefaultTitleX = 67 |
| |
| static constexpr u32 | DefaultTitleY = 82 |
| |
| static constexpr u32 | DefaultContentX = 67 |
| |
| static constexpr u32 | DefaultContentY = 210 |
| |
| static constexpr u32 | DefaultIconExtraHeight = 37 |
| |
| static constexpr u32 | DefaultOptionsBaseHorizontalMargin = 67 |
| |
| static constexpr u32 | DefaultOptionHeight = 90 |
| |
| static constexpr u32 | DefaultOptionHorizontalMargin = 45 |
| |
| static constexpr u32 | DefaultOptionBorderRadius = DefaultOptionHeight / 3 |
| |
| static constexpr u32 | DefaultOptionBottomMargin = 37 |
| |
| static constexpr u8 | DefaultMaxScreenFadeAlpha = 125 |
| |
| static constexpr u32 | DefaultIconMargin = 45 |
| |
| static constexpr u8 | DefaultOverAlphaIncrementSteps = 12 |
| |
| static constexpr u8 | DefaultFadeAlphaIncrementSteps = 18 |
| |
| static constexpr Color | DefaultDialogColor = { 0xE1, 0xE1, 0xE1, 0xFF } |
| |
| static constexpr Color | DefaultOverColor = { 0xB4, 0xB4, 0xC8, 0xFF } |
| |
Class that represents a dialog, which is a simple way to show a message and various options to the user and get a response.
- Note
- A Dialog is rendered over the current Layout, in a similar (but different) way to Overlay.
◆ Dialog()
| pu::ui::Dialog::Dialog |
( |
const std::string & | title, |
|
|
const std::string & | content ) |
Creates a new Dialog with the specified title and content.
- Parameters
-
◆ ~Dialog()
| pu::ui::Dialog::~Dialog |
( |
| ) |
|
◆ AddOption()
| void pu::ui::Dialog::AddOption |
( |
const std::string & | opt_name | ) |
|
Adds an option to the Dialog.
- Parameters
-
| opt_name | Name of the option to add. |
◆ HasCancelOption()
| bool pu::ui::Dialog::HasCancelOption |
( |
| ) |
|
|
inline |
Checks whether the Dialog has a cancel option.
- Returns
- Whether the Dialog has a cancel option.
◆ HasIcon()
| bool pu::ui::Dialog::HasIcon |
( |
| ) |
|
|
inline |
Checks whether the Dialog has an icon.
- Returns
- Whether the Dialog has an icon.
◆ IsOk()
| bool pu::ui::Dialog::IsOk |
( |
| ) |
|
|
inline |
Gets whether the Dialog has been shown and the user selected an option.
- Note
- If the Dialog has not been shown yet, this will always return false.
- Returns
- Whether the Dialog has been shown and the user selected an option.
◆ RemoveCancelOption()
| void pu::ui::Dialog::RemoveCancelOption |
( |
| ) |
|
|
inline |
Removes the cancel option from the Dialog.
◆ SetCancelOption()
| void pu::ui::Dialog::SetCancelOption |
( |
const std::string & | opt_name | ) |
|
|
inline |
Sets the option that will cancel the Dialog.
- Note
- If this option is selected, the Dialog will be cancelled.
-
This option will always be the last one.
- Parameters
-
| opt_name | Name of the option that will cancel the Dialog. |
◆ SetContent()
| void pu::ui::Dialog::SetContent |
( |
const std::string & | new_content | ) |
|
Sets the content of the Dialog.
- Parameters
-
| new_content | New content of the Dialog. |
◆ SetContentColor()
| void pu::ui::Dialog::SetContentColor |
( |
const Color | clr | ) |
|
Sets the color of the content.
- Parameters
-
| clr | New color of the content. |
◆ SetIcon()
| void pu::ui::Dialog::SetIcon |
( |
sdl2::TextureHandle::Ref | tex | ) |
|
Sets the icon of the Dialog.
- Parameters
-
◆ SetTitle()
| void pu::ui::Dialog::SetTitle |
( |
const std::string & | new_title | ) |
|
Sets the title of the Dialog.
- Parameters
-
| new_title | New title of the Dialog. |
◆ SetTitleColor()
| void pu::ui::Dialog::SetTitleColor |
( |
const Color | clr | ) |
|
Sets the color of the title.
- Parameters
-
| clr | New color of the title. |
◆ Show()
◆ UserCancelled()
| bool pu::ui::Dialog::UserCancelled |
( |
| ) |
|
|
inlineconstexpr |
Gets whether the user cancelled the Dialog.
- Note
- If the Dialog has not been shown yet, this will always return false.
- Returns
- Whether the user cancelled the Dialog.
◆ DefaultContentColor
| Color pu::ui::Dialog::DefaultContentColor = { 0x14, 0x14, 0x14, 0xFF } |
|
staticconstexpr |
◆ DefaultContentExtraWidth
| u32 pu::ui::Dialog::DefaultContentExtraWidth = 135 |
|
staticconstexpr |
◆ DefaultContentX
| u32 pu::ui::Dialog::DefaultContentX = 67 |
|
staticconstexpr |
◆ DefaultContentY
| u32 pu::ui::Dialog::DefaultContentY = 210 |
|
staticconstexpr |
◆ DefaultDialogBorderRadius
| u32 pu::ui::Dialog::DefaultDialogBorderRadius = 52 |
|
staticconstexpr |
◆ DefaultDialogColor
| Color pu::ui::Dialog::DefaultDialogColor = { 0xE1, 0xE1, 0xE1, 0xFF } |
|
staticconstexpr |
◆ DefaultFadeAlphaIncrementSteps
| u8 pu::ui::Dialog::DefaultFadeAlphaIncrementSteps = 18 |
|
staticconstexpr |
◆ DefaultIconExtraHeight
| u32 pu::ui::Dialog::DefaultIconExtraHeight = 37 |
|
staticconstexpr |
◆ DefaultIconMargin
| u32 pu::ui::Dialog::DefaultIconMargin = 45 |
|
staticconstexpr |
◆ DefaultMaxScreenFadeAlpha
| u8 pu::ui::Dialog::DefaultMaxScreenFadeAlpha = 125 |
|
staticconstexpr |
◆ DefaultOptionBorderRadius
◆ DefaultOptionBottomMargin
| u32 pu::ui::Dialog::DefaultOptionBottomMargin = 37 |
|
staticconstexpr |
◆ DefaultOptionColor
| Color pu::ui::Dialog::DefaultOptionColor = { 0xA, 0xA, 0xA, 0xFF } |
|
staticconstexpr |
◆ DefaultOptionHeight
| u32 pu::ui::Dialog::DefaultOptionHeight = 90 |
|
staticconstexpr |
◆ DefaultOptionHorizontalMargin
| u32 pu::ui::Dialog::DefaultOptionHorizontalMargin = 45 |
|
staticconstexpr |
◆ DefaultOptionsBaseHorizontalMargin
| u32 pu::ui::Dialog::DefaultOptionsBaseHorizontalMargin = 67 |
|
staticconstexpr |
◆ DefaultOverAlphaIncrementSteps
| u8 pu::ui::Dialog::DefaultOverAlphaIncrementSteps = 12 |
|
staticconstexpr |
◆ DefaultOverColor
| Color pu::ui::Dialog::DefaultOverColor = { 0xB4, 0xB4, 0xC8, 0xFF } |
|
staticconstexpr |
◆ DefaultSpaceBetweenContentAndOptions
| u32 pu::ui::Dialog::DefaultSpaceBetweenContentAndOptions = 210 |
|
staticconstexpr |
◆ DefaultSpaceBetweenOptionRows
| u32 pu::ui::Dialog::DefaultSpaceBetweenOptionRows = 15 |
|
staticconstexpr |
◆ DefaultSpaceBetweenOptions
| u32 pu::ui::Dialog::DefaultSpaceBetweenOptions = 30 |
|
staticconstexpr |
◆ DefaultTitleColor
| Color pu::ui::Dialog::DefaultTitleColor = { 0xA, 0xA, 0xA, 0xFF } |
|
staticconstexpr |
◆ DefaultTitleExtraWidth
| u32 pu::ui::Dialog::DefaultTitleExtraWidth = 135 |
|
staticconstexpr |
◆ DefaultTitleTopMargin
| u32 pu::ui::Dialog::DefaultTitleTopMargin = 30 |
|
staticconstexpr |
◆ DefaultTitleX
| u32 pu::ui::Dialog::DefaultTitleX = 67 |
|
staticconstexpr |
◆ DefaultTitleY
| u32 pu::ui::Dialog::DefaultTitleY = 82 |
|
staticconstexpr |
The documentation for this class was generated from the following file: