HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
keyboard_focus_group.hpp
1// Copyright Take Vos 2021.
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"
8namespace hi::inline v1 {
9
16 normal = 1,
17
21 menu = 2,
22
27 toolbar = 4,
28
31 mouse = 8,
32
37 all = normal | menu | toolbar | mouse,
38};
39
40[[nodiscard]] constexpr keyboard_focus_group operator&(keyboard_focus_group const &lhs, keyboard_focus_group const &rhs) noexcept
41{
42 return static_cast<keyboard_focus_group>(std::to_underlying(lhs) & std::to_underlying(rhs));
43}
44
45[[nodiscard]] constexpr keyboard_focus_group operator|(keyboard_focus_group const &lhs, keyboard_focus_group const &rhs) noexcept
46{
47 return static_cast<keyboard_focus_group>(std::to_underlying(lhs) | std::to_underlying(rhs));
48}
49
50[[nodiscard]] constexpr bool to_bool(keyboard_focus_group group) noexcept
51{
52 return to_bool(std::to_underlying(group));
53}
54
55} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:16
keyboard_focus_group
The keyboard focus group used for finding a widget that will accept a particular focus.
Definition keyboard_focus_group.hpp:12
@ menu
A menu item in a popup overlay Menu item widget accepts keyboard focus from the up/down cursor keys.
@ toolbar
A menu item in the toolbar of the window.
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377