Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
IGUIContextMenu.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_GUI_CONTEXT_MENU_H_INCLUDED__
6 #define __I_GUI_CONTEXT_MENU_H_INCLUDED__
7 
8 #include "IGUIElement.h"
9 
10 namespace irr
11 {
12 namespace gui
13 {
17  {
20 
23 
26 
27  // note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.
28  };
29 
32  {
33  public:
34 
36  IGUIContextMenu(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
37  : IGUIElement(EGUIET_CONTEXT_MENU, environment, parent, id, rectangle) {}
38 
40  virtual void setCloseHandling(ECONTEXT_MENU_CLOSE onClose) = 0;
41 
43  virtual ECONTEXT_MENU_CLOSE getCloseHandling() const = 0;
44 
46  virtual u32 getItemCount() const = 0;
47 
49 
60  virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
61  bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
62 
64 
77  virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true,
78  bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
79 
81 
85  virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0;
86 
88  virtual void addSeparator() = 0;
89 
91 
92  virtual const wchar_t* getItemText(u32 idx) const = 0;
93 
95 
97  virtual void setItemText(u32 idx, const wchar_t* text) = 0;
98 
100 
101  virtual bool isItemEnabled(u32 idx) const = 0;
102 
104 
106  virtual void setItemEnabled(u32 idx, bool enabled) = 0;
107 
109 
111  virtual void setItemChecked(u32 idx, bool enabled) = 0;
112 
114 
115  virtual bool isItemChecked(u32 idx) const = 0;
116 
118 
119  virtual void removeItem(u32 idx) = 0;
120 
122  virtual void removeAllItems() = 0;
123 
125 
126  virtual s32 getSelectedItem() const = 0;
127 
129 
130  virtual s32 getItemCommandId(u32 idx) const = 0;
131 
133 
136  virtual void setItemCommandId(u32 idx, s32 id) = 0;
137 
139 
142  virtual IGUIContextMenu* getSubMenu(u32 idx) const = 0;
143 
145  virtual void setItemAutoChecking(u32 idx, bool autoChecking) = 0;
146 
148  virtual bool getItemAutoChecking(u32 idx) const = 0;
149 
151  virtual void setEventParent(IGUIElement *parent) = 0;
152  };
153 
154 } // end namespace gui
155 } // end namespace irr
156 
157 #endif
158 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Fri Mar 21 2014 04:40:16 by Doxygen (1.8.1.2)