Implements the right-mouse popup menus in the editor in SDL to make it match to Windows.

This commit is contained in:
Areloch 2016-07-04 16:01:49 -05:00
parent 95c0bcd411
commit 818b617972
5 changed files with 442 additions and 26 deletions

View file

@ -31,6 +31,8 @@
#include "platformSDL/menus/PlatformSDLPopupMenuData.h"
#include "platformSDL/menus/guiPlatformGenericMenuBar.h"
#ifdef TORQUE_SDL
//-----------------------------------------------------------------------------
@ -44,30 +46,6 @@
Map<GuiMenuBar::Menu*, PopupMenu*> PlatformPopupMenuData::mMenuMap;
class GuiPlatformGenericMenuBar : public GuiMenuBar
{
typedef GuiMenuBar Parent;
public:
DECLARE_CONOBJECT(GuiPlatformGenericMenuBar);
virtual void menuItemSelected(Menu *menu, MenuItem *item)
{
AssertFatal(menu && item, "");
PopupMenu *popupMenu = PlatformPopupMenuData::mMenuMap[ menu ];
AssertFatal(popupMenu, "");
popupMenu->handleSelect( item->id );
Parent::menuItemSelected(menu, item);
}
protected:
/// menu id / item id
Map<CompoundKey<U32, U32>, String> mCmds;
};
IMPLEMENT_CONOBJECT(GuiPlatformGenericMenuBar);
//-----------------------------------------------------------------------------