Loading...
Searching...
No Matches
IGUIContextMenu.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_CONTEXT_MENU_H_INCLUDED__
#define __I_GUI_CONTEXT_MENU_H_INCLUDED__
#include "IGUIElement.h"
namespace irr
{
namespace gui
{
enum ECONTEXT_MENU_CLOSE
{
ECMC_IGNORE = 0,
ECMC_REMOVE = 1,
ECMC_HIDE = 2
// note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.
};
class IGUIContextMenu : public IGUIElement
{
public:
IGUIContextMenu(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_CONTEXT_MENU, environment, parent, id, rectangle) {}
virtual void setCloseHandling(ECONTEXT_MENU_CLOSE onClose) = 0;
virtual ECONTEXT_MENU_CLOSE getCloseHandling() const = 0;
virtual u32 getItemCount() const = 0;
virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true,
bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0;
virtual void addSeparator() = 0;
virtual const wchar_t* getItemText(u32 idx) const = 0;
virtual void setItemText(u32 idx, const wchar_t* text) = 0;
virtual bool isItemEnabled(u32 idx) const = 0;
virtual void setItemEnabled(u32 idx, bool enabled) = 0;
virtual void setItemChecked(u32 idx, bool enabled) = 0;
virtual bool isItemChecked(u32 idx) const = 0;
virtual void removeItem(u32 idx) = 0;
virtual void removeAllItems() = 0;
virtual s32 getSelectedItem() const = 0;
virtual s32 getItemCommandId(u32 idx) const = 0;
virtual void setItemCommandId(u32 idx, s32 id) = 0;
virtual IGUIContextMenu* getSubMenu(u32 idx) const = 0;
virtual void setItemAutoChecking(u32 idx, bool autoChecking) = 0;
virtual bool getItemAutoChecking(u32 idx) const = 0;
virtual void setEventParent(IGUIElement *parent) = 0;
};
} // end namespace gui
} // end namespace irr
#endif
IGUIElement.h
irr::core::rect
Rectangle template.
Definition rect.h:27
irr::gui::IGUIElement::IGUIElement
IGUIElement(EGUI_ELEMENT_TYPE type, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle)
Constructor.
Definition IGUIElement.h:30
irr::gui::IGUIEnvironment
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.h:71
irr::gui
The gui namespace contains useful classes for easy creation of a graphical user interface.
Definition EGUIAlignment.h:11
irr::gui::ECONTEXT_MENU_CLOSE
ECONTEXT_MENU_CLOSE
Definition IGUIContextMenu.h:17
irr::gui::ECMC_HIDE
@ ECMC_HIDE
call setVisible(false)
Definition IGUIContextMenu.h:25
irr::gui::ECMC_IGNORE
@ ECMC_IGNORE
do nothing - menu stays open
Definition IGUIContextMenu.h:19
irr::gui::ECMC_REMOVE
@ ECMC_REMOVE
remove the gui element
Definition IGUIContextMenu.h:22
irr::gui::EGUIET_CONTEXT_MENU
@ EGUIET_CONTEXT_MENU
A context menu (IGUIContextMenu).
Definition EGUIElementTypes.h:29
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0