|
IrrlichtEngine
|
00001 // Copyright (C) 2002-2011 Nikolaus Gebhardt 00002 // This file is part of the "Irrlicht Engine". 00003 // For conditions of distribution and use, see copyright notice in irrlicht.h 00004 00005 #ifndef __I_GUI_CONTEXT_MENU_H_INCLUDED__ 00006 #define __I_GUI_CONTEXT_MENU_H_INCLUDED__ 00007 00008 #include "IGUIElement.h" 00009 00010 namespace irr 00011 { 00012 namespace gui 00013 { 00016 enum ECONTEXT_MENU_CLOSE 00017 { 00019 ECMC_IGNORE = 0, 00020 00022 ECMC_REMOVE = 1, 00023 00025 ECMC_HIDE = 2 00026 00027 // note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags. 00028 }; 00029 00031 class IGUIContextMenu : public IGUIElement 00032 { 00033 public: 00034 00036 IGUIContextMenu(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 00037 : IGUIElement(EGUIET_CONTEXT_MENU, environment, parent, id, rectangle) {} 00038 00040 virtual void setCloseHandling(ECONTEXT_MENU_CLOSE onClose) = 0; 00041 00043 virtual ECONTEXT_MENU_CLOSE getCloseHandling() const = 0; 00044 00046 virtual u32 getItemCount() const = 0; 00047 00049 00060 virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true, 00061 bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0; 00062 00064 00077 virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true, 00078 bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0; 00079 00081 00085 virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0; 00086 00088 virtual void addSeparator() = 0; 00089 00091 00092 virtual const wchar_t* getItemText(u32 idx) const = 0; 00093 00095 00097 virtual void setItemText(u32 idx, const wchar_t* text) = 0; 00098 00100 00101 virtual bool isItemEnabled(u32 idx) const = 0; 00102 00104 00106 virtual void setItemEnabled(u32 idx, bool enabled) = 0; 00107 00109 00111 virtual void setItemChecked(u32 idx, bool enabled) = 0; 00112 00114 00115 virtual bool isItemChecked(u32 idx) const = 0; 00116 00118 00119 virtual void removeItem(u32 idx) = 0; 00120 00122 virtual void removeAllItems() = 0; 00123 00125 00126 virtual s32 getSelectedItem() const = 0; 00127 00129 00130 virtual s32 getItemCommandId(u32 idx) const = 0; 00131 00133 00136 virtual void setItemCommandId(u32 idx, s32 id) = 0; 00137 00139 00142 virtual IGUIContextMenu* getSubMenu(u32 idx) const = 0; 00143 00145 virtual void setItemAutoChecking(u32 idx, bool autoChecking) = 0; 00146 00148 virtual bool getItemAutoChecking(u32 idx) const = 0; 00149 00151 virtual void setEventParent(IGUIElement *parent) = 0; 00152 }; 00153 00154 } // end namespace gui 00155 } // end namespace irr 00156 00157 #endif 00158