The Modify Set example demonstrates the following:
- How to build a plugin module for the VR-Forces Gui
- How to override existing set dialog functionality and replace with your own
How to Run the Example
Usage
In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the plugin.
To view the new behavior:
-
Start VR-Forces GUI and SIM.
-
Create a new scneario - e.g EntityLevel SMS on a Ground_DB II terrain.
-
Create an M1A2 entity.
-
Select the entity and Set -> Position -> Location... context menu item.
-
Observe that a new combo-box labeled "Example Combo" has been added to the Location dialog. It should have options "Item 1" and "Item 2".
Plugin Entry Points
#include <QtWidgets/QComboBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLayout>
{
public:
MySetLocationDialog(
makVrv::DtDe& de, QWidget* parent,
const Qt::WindowFlags& flags = 0)
: makVrf::DtSetLocationDialog(de, parent, flags)
{
}
protected:
virtual QWidget*
contents(
const std::vector<makVrv::DtSimEntry*>& data)
{
QHBoxLayout* comboLayout = new QHBoxLayout;
comboLayout->setMargin(0);
comboLayout->setSpacing(2);
comboLayout->addWidget(label);
comboLayout->addWidget(combo);
combo->addItem(tr("Item 1"));
combo->addItem(tr("Item 2"));
myContentLayout->addLayout(comboLayout);
return canvas;
}
};
{
public:
{
}
};
{
return true;
}
{
info.
pluginDescription =
"This example shows how to modify an existing set dialog (set location) to add your own functionality.";
}