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/*
3neogfx C++ App/Game Engine
4Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6This program is free software: you can redistribute it and / or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
24#include "widget.hpp"
25#include "menu.hpp"
26
27namespace neogfx
28{
29 class popup_menu;
30
31 class menu_bar : public widget<>, public menu
32 {
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}
double opacity() const override
bool text_input(i_string const &aText) override
const i_widget & as_widget() const override
bool key_pressed(scan_code_e aScanCode, key_code_e aKeyCode, key_modifiers_e aKeyModifiers) override
widget_part hit_test(const point &aPosition) const override
bool visible() const override
i_widget & as_widget() override
bool key_released(scan_code_e aScanCode, key_code_e aKeyCode, key_modifiers_e aKeyModifiers) override
neogfx::size_policy size_policy() const override
item_index find(const i_menu_item &aItem) const override
widget_list::const_iterator find(const i_widget &aChild, bool aThrowIfNotFound=true) const override
Definition widget.ipp:423
#define meta_object(...)
Definition i_object.hpp:28