7#include "../macros.hpp"
13#include <system_error>
16hi_export_module(hikogui.utility.dialog : intf);
18hi_export
namespace hi {
21enum class dialog_button {no, yes, cancel, ok, retry, _continue};
23template<std::
integral T>
24[[nodiscard]]
constexpr unsigned long long operator<<(T
const &lhs, dialog_button
const &rhs)
noexcept
26 return 1ULL << std::to_underlying(rhs);
30 no = 1 << dialog_button::no,
31 yes = 1 << dialog_button::yes,
33 cancel = 1 << dialog_button::cancel,
42 ok = 1 << dialog_button::ok,
43 retry = 1 << dialog_button::retry,
44 _continue = 1 << dialog_button::_continue,
101 return std::to_underlying(rhs) != 0;
106 return static_cast<dialog_button_mask>(std::to_underlying(lhs) & std::to_underlying(rhs));
111 return static_cast<dialog_button_mask>(std::to_underlying(lhs) | std::to_underlying(rhs));
116 return lhs = lhs & rhs;
121 return lhs = lhs | rhs;
136 return lhs = lhs & rhs;
141 return lhs = lhs | rhs;
The HikoGUI namespace.
Definition array_generic.hpp:21
The HikoGUI API version 1.
Definition array_generic.hpp:22
std::expected< dialog_button, std::error_code > dialog(std::string_view title, std::string_view text, dialog_button_mask button_mask=dialog_button_mask::ok) noexcept
Display a modal dialog.
Definition dialog_win32_impl.hpp:20
dialog_button_mask
Definition dialog_intf.hpp:29
@ yes_no
A dialog box with "yes" and "no" buttons.
Definition dialog_intf.hpp:65
@ ok
A dialog box with just a "ok" button.
Definition dialog_intf.hpp:42
@ yes_no_cancel
A dialog box with "yes", "no" and "cancel" buttons.
Definition dialog_intf.hpp:96
@ retry_cancel
A dialog box with "retry" and "cancel" buttons.
Definition dialog_intf.hpp:85
@ ok_cancel
A dialog box with "ok" and "cancel" buttons.
Definition dialog_intf.hpp:75
@ cancel_retry_continue
A dialog box with "cancel", "retry" and "continue" buttons.
Definition dialog_intf.hpp:55