neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
menu_bar.hpp
Go to the documentation of this file.
1
// menu_bar.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <
neogfx/neogfx.hpp
>
23
#include <
neogfx/gui/layout/flow_layout.hpp
>
24
#include "
widget.hpp
"
25
#include "
menu.hpp
"
26
27
namespace
neogfx
28
{
29
class
popup_menu;
30
31
class
menu_bar
:
public
widget
<>,
public
menu
32
{
33
meta_object
(
widget<>
)
34
public
:
35
menu_bar
();
36
menu_bar
(
i_widget
& aParent);
37
menu_bar
(
i_layout
& aLayout);
38
~menu_bar
();
39
public
:
40
const
i_widget
&
as_widget
()
const override
;
41
i_widget
&
as_widget
()
override
;
42
public
:
43
using
widget::find
;
44
using
menu::find
;
45
public
:
46
neogfx::size_policy
size_policy
()
const override
;
47
public
:
48
double
opacity
()
const override
;
49
public
:
50
bool
visible
()
const override
;
51
protected
:
52
bool
key_pressed
(
scan_code_e
aScanCode,
key_code_e
aKeyCode,
key_modifiers_e
aKeyModifiers)
override
;
53
bool
key_released
(
scan_code_e
aScanCode,
key_code_e
aKeyCode,
key_modifiers_e
aKeyModifiers)
override
;
54
bool
text_input
(
i_string
const
& aText)
override
;
55
protected
:
56
widget_part
hit_test
(
const
point
& aPosition)
const override
;
57
private
:
58
void
init();
59
void
close_sub_menu(
bool
aClearSelection =
true
);
60
private
:
61
sink
iSink;
62
sink
iSink2;
63
flow_layout
iLayout;
64
std::unique_ptr<popup_menu> iOpenSubMenu;
65
};
66
}
neogfx::basic_point< coordinate >
neogfx::flow_layout
Definition
flow_layout.hpp:35
neogfx::i_layout
Definition
i_layout.hpp:231
neogfx::i_widget
Definition
i_widget.hpp:50
neogfx::menu_bar
Definition
menu_bar.hpp:32
neogfx::menu_bar::opacity
double opacity() const override
neogfx::menu_bar::text_input
bool text_input(i_string const &aText) override
neogfx::menu_bar::as_widget
const i_widget & as_widget() const override
neogfx::menu_bar::key_pressed
bool key_pressed(scan_code_e aScanCode, key_code_e aKeyCode, key_modifiers_e aKeyModifiers) override
neogfx::menu_bar::hit_test
widget_part hit_test(const point &aPosition) const override
neogfx::menu_bar::visible
bool visible() const override
neogfx::menu_bar::as_widget
i_widget & as_widget() override
neogfx::menu_bar::key_released
bool key_released(scan_code_e aScanCode, key_code_e aKeyCode, key_modifiers_e aKeyModifiers) override
neogfx::menu_bar::size_policy
neogfx::size_policy size_policy() const override
neogfx::menu
Definition
menu.hpp:32
neogfx::menu::find
item_index find(const i_menu_item &aItem) const override
neogfx::widget
Definition
widget.hpp:35
neogfx::widget::find
widget_list::const_iterator find(const i_widget &aChild, bool aThrowIfNotFound=true) const override
Definition
widget.ipp:423
neolib::i_string
Definition
i_string.hpp:49
neolib::sink
Definition
i_event.hpp:255
flow_layout.hpp
menu.hpp
neogfx
Definition
action.hpp:28
neogfx::key_modifiers_e
key_modifiers_e
Definition
i_keyboard.hpp:588
neogfx::key_code_e
key_code_e
Definition
i_keyboard.hpp:331
neogfx::scan_code_e
scan_code_e
Definition
i_keyboard.hpp:54
meta_object
#define meta_object(...)
Definition
i_object.hpp:28
neogfx.hpp
neogfx::widget_part
Definition
widget_bits.hpp:56
widget.hpp
include
neogfx
gui
widget
menu_bar.hpp
Generated by
1.9.8