HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
dialog_intf.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../macros.hpp"
8#include <string_view>
9#include <iostream>
10#include <format>
11
12hi_export_module(hikogui.console.dialogue : intf);
13
14namespace hi { inline namespace v1 {
15
16hi_export enum class dialog_type { ok, yes_no, yes_no_cancel };
17
25hi_export bool dialog(dialog_type type, std::string_view title, std::string_view text);
26
27hi_export inline void dialog_ok(std::string_view title, std::string_view message) noexcept
28{
29 dialog(dialog_type::ok, title, message);
30}
31
32hi_export [[nodiscard]] inline bool dialog_yes_no(std::string_view title, std::string_view message) noexcept
33{
34 return dialog(dialog_type::yes_no, title, message);
35}
36
37hi_export [[nodiscard]] inline bool dialog_yes_no_cancel(std::string_view title, std::string_view message)
38{
39 return dialog(dialog_type::yes_no_cancel, title, message);
40}
41
42}} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
hi_export bool dialog(dialog_type type, std::string_view title, std::string_view text)
Display a modal dialog.
Definition dialog_win32_impl.hpp:18
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377