The Modify Task example demonstrates the following:
- How to build a plugin module for the VR-Forces Gui
- How to override existing task dialog functionality and replace with your own
- How to register a task dialog to override an existing task dialog
Modifying Task Dialog
This example adds a new label to the dialog called "Modified By Example" to the Move To Waypoint... task in order to show how an existing dialog can be modified.
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 scenario - e.g. Entitylevel SMS on Ground_DB II terrain.
-
Create a ground entity (e.g. M1A2 Abrams MBT) , and a Waypoint.
-
Right click on the entity and select from the context menu the Task -> Movement -> Move to Waypoint... task.
-
In the displayed Move To Waypoint... dialog, notice the "Modified By Example" label at the bottom, which was added by the example plugin.
Plugin Entry Points
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLayout>
{
public:
MyTaskMoveToDialog(
makVrv::DtDe& de, QWidget* parent,
const Qt::WindowFlags& flags = 0)
: makVrf::DtTaskMoveToDialog(de, parent, flags)
{
}
protected:
virtual QWidget*
contents(
const std::vector<makVrv::DtSimEntry*>& data)
{
QLabel* label =
new QLabel(tr(
"Modified By Example"), canvas);
((QVBoxLayout*)canvas->layout())->insertWidget(2, label);
return canvas;
}
};
{
public:
{
}
};
{
return true;
}
{
info.
pluginDescription =
"This example shows how to modify an existing task dialog (Move To Waypoint...) to add your own functionality.";
}