neoWidgets
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
Menu.h
1 #ifndef NEO_MENU_H
2 #define NEO_MENU_H
3 
4 namespace neo
5 {
6 
7 class Menu
8 {
9 public:
10  Menu();
11  Menu(HMENU freeHandle);
12  Menu(Menu&& rhs);
13  Menu& operator=(Menu&& rhs);
14  ~Menu();
15 
16  HMENU GetHandle() const { return handle; }
17  operator HMENU() const { return handle; }
18 
19  void Create();
20  void CreatePopupMenu();
21  HMENU Detach();
22 
23  int GetItemCount() const;
24 
25  void AppendString(UINT id, const tstring& text);
26  void AppendMenu(HMENU menu, const tstring& text);
27  void AppendSeparator();
28 
29  void InsertString(UINT index, UINT id, const tstring& text);
30  void InsertMenu(UINT index, HMENU menu, const tstring& text);
31  void InsertSeparator(UINT index);
32 
33  void EnableMenuItem(UINT index, bool enable);
34  void EnableMenuCommand(UINT command, bool enable);
35 private:
36  Menu(const Menu& rhs) {}
37  Menu& operator=(const Menu& rhs) { return *this; }
38 
39  HMENU handle;
40 };
41 
42 } // neo
43 
44 #endif
Definition: Menu.h:7