neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
context_menu.hpp
Go to the documentation of this file.
1
// context_menu.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 "
popup_menu.hpp
"
24
25
namespace
neogfx
26
{
27
class
context_menu
28
{
29
public
:
30
define_event
(PopupCreated, popup_created,
popup_menu
&)
31
public
:
32
struct
widget_not_created_yet : std::logic_error { widget_not_created_yet() : std::logic_error(
"neogfx::context_menu::widget_not_created_yet"
) {} };
33
public
:
34
context_menu
(
const
point
& aPosition,
window_style
aStyle = popup_menu::DEFAULT_STYLE |
window_style::DismissOnParentClick
);
35
context_menu
(
i_widget
& aParent,
const
point
& aPosition,
window_style
aStyle = popup_menu::DEFAULT_STYLE |
window_style::DismissOnParentClick
);
36
~context_menu
();
37
public
:
38
i_menu
&
menu
();
39
popup_menu
&
root_widget
();
40
void
exec
();
41
private
:
42
std::unique_ptr<i_menu> iMenu;
43
i_widget
* iParent;
44
point
iPosition;
45
window_style
iStyle;
46
static
std::unique_ptr<popup_menu> sWidget;
47
};
48
}
neogfx::basic_point< coordinate >
neogfx::context_menu
Definition
context_menu.hpp:28
neogfx::context_menu::~context_menu
~context_menu()
neogfx::context_menu::menu
i_menu & menu()
neogfx::context_menu::context_menu
context_menu(const point &aPosition, window_style aStyle=popup_menu::DEFAULT_STYLE|window_style::DismissOnParentClick)
neogfx::context_menu::context_menu
context_menu(i_widget &aParent, const point &aPosition, window_style aStyle=popup_menu::DEFAULT_STYLE|window_style::DismissOnParentClick)
neogfx::context_menu::exec
void exec()
neogfx::context_menu::root_widget
popup_menu & root_widget()
neogfx::i_menu
Definition
i_menu.hpp:36
neogfx::i_widget
Definition
i_widget.hpp:50
neogfx::popup_menu
Definition
popup_menu.hpp:30
neogfx
Definition
action.hpp:28
neogfx::window_style
window_style
Definition
window_bits.hpp:29
neogfx::window_style::DismissOnParentClick
@ DismissOnParentClick
neogfx.hpp
define_event
#define define_event(name, declName,...)
Definition
event.hpp:200
popup_menu.hpp
include
neogfx
gui
window
context_menu.hpp
Generated by
1.9.8