IGUIContextMenu Class Reference

#include <IGUIContextMenu.h>

Inheritance diagram for IGUIContextMenu:

IGUIElement IrrUnknown IEventReceiver CGUIContextMenu CGUIMenu

Public Member Functions

Protected Member Functions

Protected Attributes


Constructor & Destructor Documentation

IGUIContextMenu ( IGUIEnvironment environment,
IGUIElement parent,
s32  id,
core::rect< s32 rectangle 
) [inline]

~IGUIContextMenu (  )  [inline]


Member Function Documentation

virtual void addChild ( IGUIElement child  )  [inline, virtual, inherited]

virtual s32 addItem ( const wchar_t *  text,
s32  commandId = -1,
bool  enabled = true,
bool  hasSubMenu = false 
) [pure virtual]

Parameters:
text,: Text of menu item. Set this to 0 to create an separator instead of a real item, which is the same like calling addSeparator();
commandId,: Command id of menu item, a simple id you may set to whatever you want.
enabled,: Specifies if the menu item should be enabled.
hasSubMenu,: Set this to true if there should be a submenu at this item. You can acess this submenu via getSubMenu().
Returns:
Returns the index of the new item

Implemented in CGUIContextMenu.

virtual void addSeparator (  )  [pure virtual]

Implemented in CGUIContextMenu.

virtual void animateMoveToPoint ( const core::position2d< s32 > &  destination,
const u32 timeToMove 
) [inline, virtual, inherited]

Reimplemented in CGUIImage, CGUIStaticText, and IGUIImage.

virtual bool bringToFront ( IGUIElement element  )  [inline, virtual, inherited]

Returns:
Returns true if successful, false if not.

virtual void draw (  )  [inline, virtual, inherited]

Reimplemented in CGUIAnimatedImage, CGUIButton, CGUICheckBox, CGUIColorSelectDialog, CGUIComboBox, CGUIContextMenu, CGUIEditBox, CGUIFileOpenDialog, CGUIImage, CGUIInOutFader, CGUIListBox, CGUIMenu, CGUIMeshViewer, CGUIModalScreen, CGUIScrollBar, CGUISlider, CGUIStaticText, CGUITab, CGUITabControl, CGUIToolBar, and CGUIWindow.

bool drop (  )  [inline, inherited]

Drops the object. Decrements the reference counter by one. Returns true, if the object was deleted. The IrrUnknown class provides a basic reference counting mechanism with its methods grab() and drop(). Most objects of the Irrlicht Engine are derived from IrrUnknown, and so they are reference counted.

When you create an object in the Irrlicht engine, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.

A simple example:

If you want to create a texture, you may want to call an imaginable method IDriver::createTexture. You call ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128)); If you no longer need the texture, call texture->drop(). If you want to load a texture, you may want to call imaginable method IDriver::loadTexture. You do this like ITexture* texture = driver->loadTexture("example.jpg"); You will not have to drop the pointer to the loaded texture, because the name of the method does not start with 'create'. The texture is stored somewhere by the driver.

core::rect<s32> getAbsolutePosition (  )  [inline, inherited]

virtual const core::list<IGUIElement*>& getChildren (  )  const [inline, virtual, inherited]

const c8* getDebugName (  )  const [inline, inherited]

Returns the debug name of the object. The Debugname may only be set and changed by the object itself. This method should only be used in Debug mode.

Returns:
Returns a string, previously set by setDebugName();

* virtual IGUIElement* getElementFromId ( s32  id,
bool  searchchildren = false 
) const [inline, virtual, inherited]

Finds the first element with the given id.

Parameters:
id,: Id to search for.
searchchildren,: Set this to true, if you want to search this elements children.
Returns:
Returns the first element with the given id. If no element with this id was found, 0 is returned.

IGUIElement* getElementFromPoint ( const core::position2d< s32 > &  point  )  [inline, inherited]

virtual s32 getID (  )  [inline, virtual, inherited]

virtual s32 getItemCommandId ( s32  idx  )  [pure virtual]

Parameters:
idx,: Zero based index of the menu item

Implemented in CGUIContextMenu.

virtual s32 getItemCount (  )  const [pure virtual]

Implemented in CGUIContextMenu.

virtual const wchar_t* getItemText ( s32  idx  )  [pure virtual]

Parameters:
idx,: Zero based index of the menu item

Implemented in CGUIContextMenu.

IGUIElement* getParent (  )  [inline, inherited]

core::rect<s32> getRelativePosition (  )  [inline, inherited]

virtual s32 getSelectedItem (  )  [pure virtual]

Returns:
Index of the selected item, -1 if none selected.

Implemented in CGUIContextMenu.

virtual IGUIContextMenu* getSubMenu ( s32  idx  )  [pure virtual]

0 is returned if there is no submenu

Parameters:
idx,: Zero based index of the menu item

Implemented in CGUIContextMenu.

virtual const wchar_t* getText (  )  [inline, virtual, inherited]

virtual core::stringw& getToolTipText (  )  [inline, virtual, inherited]

EGUI_ELEMENT_TYPE getType (  )  [inline, inherited]

This is needed for the .NET wrapper but will be used later for serializing and deserializing. If you wrote your own GUIElements, you need to set the type for your element as first parameter in the constructor of IGUIElement. For own (=unknown) elements, simply use EGUIET_ELEMENT as type

void grab (  )  [inline, inherited]

Grabs the object. Increments the reference counter by one. Someone who calls grab() to an object, should later also call drop() to it. If an object never gets as much drop() as grab() calls, it will never be destroyed. The IrrUnknown class provides a basic reference counting mechanism with its methods grab() and drop(). Most objects of the Irrlicht Engine are derived from IrrUnknown, and so they are reference counted.

When you create an object in the Irrlicht engine, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.

A simple example:

If you want to create a texture, you may want to call an imaginable method IDriver::createTexture. You call ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128)); If you no longer need the texture, call texture->drop(). If you want to load a texture, you may want to call imaginable method IDriver::loadTexture. You do this like ITexture* texture = driver->loadTexture("example.jpg"); You will not have to drop the pointer to the loaded texture, because the name of the method does not start with 'create'. The texture is stored somewhere by the driver.

virtual bool isEnabled (  )  [inline, virtual, inherited]

virtual bool isItemEnabled ( s32  idx  )  [pure virtual]

Parameters:
idx,: Zero based index of the menu item

Implemented in CGUIContextMenu.

virtual bool isVisible (  )  [inline, virtual, inherited]

virtual void move ( core::position2d< s32 absoluteMovement  )  [inline, virtual, inherited]

virtual bool OnEvent ( const SEvent event  )  [inline, virtual, inherited]

Implements IEventReceiver.

Reimplemented in CGUIButton, CGUICheckBox, CGUIColorSelectDialog, CGUIComboBox, CGUIContextMenu, CGUIEditBox, CGUIEnvironment, CGUIFileOpenDialog, CGUIListBox, CGUIMenu, CGUIMeshViewer, CGUIMessageBox, CGUIModalScreen, CGUIScrollBar, CGUISlider, CGUITabControl, and CGUIWindow.

virtual void OnPostRender ( u32  timeMs  )  [inline, virtual, inherited]

Reimplemented in CGUIEnvironment.

virtual void overrideDefaultClipping ( const core::rect< s32 > &  clipRect  )  [inline, virtual, inherited]

virtual void remove (  )  [inline, virtual, inherited]

virtual void removeAllItems (  )  [pure virtual]

Implemented in CGUIContextMenu.

virtual void removeChild ( IGUIElement child  )  [inline, virtual, inherited]

Reimplemented in CGUIModalScreen, and CGUITabControl.

virtual void removeItem ( s32  idx  )  [pure virtual]

Parameters:
idx,: Zero based index of the menu item

Implemented in CGUIContextMenu.

void setDebugName ( const c8 newName  )  [inline, protected, inherited]

Sets the debug name of the object. The Debugname may only be set and changed by the object itself. This method should only be used in Debug mode.

Parameters:
newName,: New debug name to set.

virtual void setEnabled ( bool  enabled  )  [inline, virtual, inherited]

virtual void setID ( s32  id  )  [inline, virtual, inherited]

virtual void setItemCommandId ( s32  idx,
s32  id 
) [pure virtual]

Parameters:
idx,: Zero based index of the menu item
id,: Command id of menu item, a simple id you may set to whatever you want.

Implemented in CGUIContextMenu.

virtual void setItemEnabled ( s32  idx,
bool  enabled 
) [pure virtual]

Parameters:
idx,: Zero based index of the menu item
enabled,: True if it is enabled, otherwise false.

Implemented in CGUIContextMenu.

virtual void setItemText ( s32  idx,
const wchar_t *  text 
) [pure virtual]

Parameters:
idx,: Zero based index of the menu item
text,: New text of the item.

Implemented in CGUIContextMenu.

void setRelativePosition ( const core::rect< s32 > &  r  )  [inline, inherited]

virtual void setText ( const wchar_t *  text  )  [inline, virtual, inherited]

Reimplemented in CGUIEditBox, and CGUIStaticText.

virtual void setToolTipText ( const wchar_t *  text  )  [inline, virtual, inherited]

virtual void setVisible ( bool  visible  )  [inline, virtual, inherited]

Reimplemented in CGUIContextMenu.

virtual void updateAbsolutePosition (  )  [inline, virtual, inherited]

Reimplemented in CGUIMenu, CGUIModalScreen, and CGUIToolBar.


Field Documentation

core::rect<s32> AbsoluteClippingRect [protected, inherited]

core::rect<s32> AbsoluteRect [protected, inherited]

core::list<IGUIElement*> Children [protected, inherited]

IGUIEnvironment* Environment [protected, inherited]

s32 ID [protected, inherited]

bool IsEnabled [protected, inherited]

bool IsVisible [protected, inherited]

bool OverrideDefaultClippingRectBehavior [protected, inherited]

IGUIElement* Parent [protected, inherited]

core::rect<s32> RelativeRect [protected, inherited]

core::stringw Text [protected, inherited]

core::stringw ToolTipText [protected, inherited]

EGUI_ELEMENT_TYPE Type [protected, inherited]


Generated on Fri Apr 27 14:47:08 2007 for IrrSpintz by  doxygen 1.5.1-p1