#include <window_classes.hpp>
◆ ButtonHandler
◆ AlertWindow() [1/2]
| pulp::view::AlertWindow::AlertWindow |
( |
const std::string & | title, |
|
|
const std::string & | message, |
|
|
AlertIcon | icon = AlertIcon::info ) |
◆ ~AlertWindow()
| pulp::view::AlertWindow::~AlertWindow |
( |
| ) |
|
◆ AlertWindow() [2/2]
| pulp::view::AlertWindow::AlertWindow |
( |
const AlertWindow & | | ) |
|
|
delete |
◆ add_button()
| std::size_t pulp::view::AlertWindow::add_button |
( |
std::string | label | ) |
|
Append a button. Returns the index assigned to this button (0-based).
◆ button_count()
| std::size_t pulp::view::AlertWindow::button_count |
( |
| ) |
const |
|
inline |
◆ button_label()
| const std::string & pulp::view::AlertWindow::button_label |
( |
std::size_t | i | ) |
const |
|
inline |
◆ click_button()
| void pulp::view::AlertWindow::click_button |
( |
std::size_t | index | ) |
|
Programmatic button click — fires the handler with index and tears the alert down.
◆ confirm()
| std::unique_ptr< AlertWindow > pulp::view::AlertWindow::confirm |
( |
const std::string & | title, |
|
|
const std::string & | message, |
|
|
ButtonHandler | handler = {} ) |
|
static |
"Question" alert with Cancel (0) and OK (1) buttons.
◆ error()
| std::unique_ptr< AlertWindow > pulp::view::AlertWindow::error |
( |
const std::string & | title, |
|
|
const std::string & | message, |
|
|
ButtonHandler | handler = {} ) |
|
static |
"Error" alert with a single OK button.
◆ host()
◆ icon()
| AlertIcon pulp::view::AlertWindow::icon |
( |
| ) |
const |
|
inline |
◆ info()
| std::unique_ptr< AlertWindow > pulp::view::AlertWindow::info |
( |
const std::string & | title, |
|
|
const std::string & | message, |
|
|
ButtonHandler | handler = {} ) |
|
static |
"Info" alert with a single OK button.
The handler fires with index = 0 when the user dismisses it.
◆ is_dismissed()
| bool pulp::view::AlertWindow::is_dismissed |
( |
| ) |
const |
|
inline |
◆ message()
| const std::string & pulp::view::AlertWindow::message |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ set_button_handler()
| void pulp::view::AlertWindow::set_button_handler |
( |
ButtonHandler | handler | ) |
|
|
inline |
Install a handler invoked with the index of the chosen button.
Fires at most once.
◆ show()
| bool pulp::view::AlertWindow::show |
( |
| ) |
|
◆ style_tokens()
| StyleTokens pulp::view::AlertWindow::style_tokens |
( |
| ) |
const |
|
inline |
Convenience that returns this alert's styled tokens.
◆ style_tokens_for()
Returns the style tokens for an icon.
The host can use these to paint the alert chrome in a theme-driven color without baking a specific palette into the alert window itself.
info → "alert.info.icon" + "alert.info.accent" + glyph "i" warning → "alert.warning.icon" + "alert.warning.accent" + glyph "!" error → "alert.error.icon" + "alert.error.accent" + glyph "x" question → "alert.question.icon" + "alert.question.accent" + "?" none → empty tokens.
◆ title()
| const std::string & pulp::view::AlertWindow::title |
( |
| ) |
const |
|
inline |
◆ warning()
| std::unique_ptr< AlertWindow > pulp::view::AlertWindow::warning |
( |
const std::string & | title, |
|
|
const std::string & | message, |
|
|
ButtonHandler | handler = {} ) |
|
static |
"Warning" alert with a single OK button — sibling of info / error.
The documentation for this class was generated from the following file: