GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
Menu.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace gui_framework
6{
9 {
10 private:
11 std::wstring name;
12 HMENU handle;
13 HWND parent;
14 std::vector<std::unique_ptr<interfaces::IMenuItem>> items;
15
16 public:
17 Menu();
18
19 Menu(const std::wstring& name, HWND parent);
20
21 Menu(const Menu&) = delete;
22
23 Menu(Menu&& other) noexcept;
24
25 Menu& operator = (const Menu&) = delete;
26
27 Menu& operator = (Menu&& other) noexcept;
28
31 Menu& addMenuItem(std::unique_ptr<interfaces::IMenuItem>&& item);
32
33 void removeMenuItem(uint32_t index);
34
35 void handleMessage(uint32_t index);
36
37 void updateMenu() const;
38
39 const std::wstring& getName() const;
40
41 const std::vector<std::unique_ptr<interfaces::IMenuItem>>& getItems() const;
42
43 HMENU getHandle() const;
44
45 json::JSONBuilder getStructure() const override;
46
47 ~Menu();
48 };
49}
#define GUI_FRAMEWORK_API
Menu class.
Definition Menu.h:9
Menu(const Menu &)=delete
Menu(const std::wstring &name, HWND parent)
Provides interface for serializable to JSON format.