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
To observe the plugin:
-
Start vrfGui and vrfSim
-
Create an M1A2 entity
-
Select the entity and Set > Location...
-
Observe the combo-box labeled "Example Combo". It should have options "Item 1" and "Item 2"
#include <QtWidgets/QComboBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLayout>
{
public:
: makVrf::DtSetLocationDialog(de, parent, flags)
{
}
protected:
{
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.";
}