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 "../utility/utility.hpp"
8#include "../macros.hpp"
9#include <utility>
10
11hi_export_module(hikogui.GUI : keyboard_focus_group);
12
13hi_export namespace hi::inline v1 {
14
21 normal = 1,
22
26 menu = 2,
27
32 toolbar = 4,
33
36 mouse = 8,
37
42 all = normal | menu | toolbar | mouse,
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 keyboard_focus_group operator|(keyboard_focus_group const &lhs, keyboard_focus_group const &rhs) noexcept
51{
52 return static_cast<keyboard_focus_group>(std::to_underlying(lhs) | std::to_underlying(rhs));
53}
54
55[[nodiscard]] constexpr bool to_bool(keyboard_focus_group group) noexcept
56{
57 return to_bool(std::to_underlying(group));
58}
59
60} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
keyboard_focus_group
The keyboard focus group used for finding a widget that will accept a particular focus.
Definition keyboard_focus_group.hpp:17
@ 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.