diff -r 14121b8153b5 lib/irrlicht/include/IGUIContextMenu.h --- a/lib/irrlicht/include/IGUIContextMenu.h Wed Jun 03 21:40:17 2009 +0200 +++ b/lib/irrlicht/include/IGUIContextMenu.h Wed Jun 03 21:42:12 2009 +0200 @@ -59,6 +59,10 @@ \return Returns the index of the new item */ virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true, bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0; + + //! Find a item which has the given CommandId starting from given index + //! return -1 if no such item was found + virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0; //! Adds a separator item to the menu virtual void addSeparator() = 0; diff -r 14121b8153b5 lib/irrlicht/source/Irrlicht/CGUIContextMenu.cpp --- a/lib/irrlicht/source/Irrlicht/CGUIContextMenu.cpp Wed Jun 03 21:40:17 2009 +0200 +++ b/lib/irrlicht/source/Irrlicht/CGUIContextMenu.cpp Wed Jun 03 21:42:12 2009 +0200 @@ -96,6 +96,17 @@ return Items.size() - 1; } +s32 CGUIContextMenu::findItemWithCommandId(s32 commandId, u32 idxStartSearch) const +{ + for ( u32 i=idxStartSearch; i