The Menu Manipulation example demonstrates the following:
- How to build a plugin module for the VR-Forces Gui
- How to remove menu items from the GUI
- How to add menu items to the GUI
- How to add menus to the gui
- How to remove menus from the gui
The Menu Manipulation example demonstrates how to manipulate the menu, changing it from the system default.
This example shows you how to modify the following menus:
- The Task menu by removing the embark, disembark, DI-Guy animation and radio menus
- Moving Task menu items (embarkation) to a new sub-menu in the Task menu
- Adds a new item to the Create menu
- Reorganizes Set menu by removing the setting of location, heading and ordered speed to a new sub-menu
- Shows how to add a new menu to the main menu bar
- Modified the entities right click menu to add a new menu item
using namespace makVrf;
{
virtual bool shouldAddCreationItem(
const DtEntityPaletteItem& item,
const QString& category,
const QString& deployedCountry,
int force)
const
{
if ((force == DtForceFriendly) && (item.myMapperKey == DtEntityType(1, 1, 225, 1, 1, 3, 0)))
{
return false;
}
return true;
}
};
{
DtListItem* item = copySet.first();
while (item)
{
{
}
else if (entry->
label() ==
"Route")
{
}
item = item->next();
}
}
{
removeInformationItemFromSection("DtEntityInformation", "DtEntityCompactData", "DtEntityAltitude");
addInformationItemToSection("DtEntityInformation", "DtEntityCompactData", "DtEntityHeadingPitchRoll", 1, 3, 1, 1, 128);
}
{
(
boost::bind(&DtCreateMenuConfigurationLoaded, &de, _1, _2));
}
{
}
{
}
{
QMessageBox::information(NULL, QObject::tr("Example Menu Item Pressed"), QObject::tr("Your menu item works!"));
}
{
}
{
}
{
}
{
&exampleMenuItemTrigger);
}
{
}
{
removeMenuItems(*de);
reorganizeTaskMenuItems(*de);
reorganizeSetMenuItems(*de);
addToCreateMenu(*de);
addMenu(*de);
modifyRightClick(*de);
modifyInformationSection(*de);
return true;
}
{
}