diff -r c2ffd3273739 lib/irrlicht/include/IGUIContextMenu.h --- a/lib/irrlicht/include/IGUIContextMenu.h Tue Sep 02 14:12:33 2008 +0200 +++ b/lib/irrlicht/include/IGUIContextMenu.h Tue Sep 02 14:26:17 2008 +0200 @@ -61,6 +61,10 @@ bool hasSubMenu=false, bool checked=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 c2ffd3273739 lib/irrlicht/source/Irrlicht/CGUIContextMenu.cpp --- a/lib/irrlicht/source/Irrlicht/CGUIContextMenu.cpp Tue Sep 02 14:12:33 2008 +0200 +++ b/lib/irrlicht/source/Irrlicht/CGUIContextMenu.cpp Tue Sep 02 14:26:17 2008 +0200 @@ -95,6 +95,19 @@ recalculateSize(); return Items.size() - 1; +} + + +s32 CGUIContextMenu::findItemWithCommandId(s32 commandId, u32 idxStartSearch) const +{ + for ( u32 i=idxStartSearch; i