The Interface Manipulation example creates a starting dialog that allows different options for the GUI to be entered into. One is the normal VRF GUI but with a new toobar, one is a "Simple Scenario Player" that allows the user to load terrains or scenarios and observe them - but not interact with them. The other option created by this example is a "Simple Scenario Viewer" that allows the user only to observe simulation activity, but not to interact with it in any way.
#include <QtWidgets/QApplication>
#include <QtWidgets/QDialog>
#include <QtWidgets/QLayout>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QLabel>
#include <QtWidgets/QComboBox>
#include <boost/bind.hpp>
#include <QtWidgets/QToolBar>
#include <vlpi/entityType.h>
DtCmdLine::ValueArg<int>* theUiType;
{
public:
virtual ~newToolbarClass();
};
: makVrv::DtToolbar(de, std::string("NewToolbar") )
{
}
newToolbarClass::~newToolbarClass()
{
}
{
tb->setWindowTitle("New Toolbar");
return tb;
}
const QString & text, QWidget* parent )
, myDe(de)
{
connect(
this, SIGNAL(clicked()),
this, SLOT(slot_onClicked()) );
}
{
DtWarn("Button clicked\n");
DtEntityType(17, 0, 0, 2, 0, 0, 0), 1);
}
{
public:
virtual ~MyButtonWidgetBuilder();
const Qt::WindowFlags& flags = 0);
};
MyButtonWidgetBuilder::MyButtonWidgetBuilder(
makVrv::DtDe& de)
: DtWidgetBuilder()
{
}
MyButtonWidgetBuilder::~MyButtonWidgetBuilder()
{
}
const Qt::WindowFlags& flags)
{
}
{
MyButtonWidgetBuilder* bwb = new MyButtonWidgetBuilder(de);
"CreateRouteButton", bwb);
}
{
}
{
theUiType = new ValueArg<int>("", "uiType",
"Type of UI to use (0 - Normal, 1 - Simple Scenario, 2 - Scenario Viewer, 3 - Map Area Only",false,-1,"int");
}
{
if (theUiType->getValue() > 0)
{
if (theUiType->getValue() == 3)
{
}
}
}
{
}
{
}
{
}
{
if (!qApp)
{
}
if (!theUiType->isSet())
{
QVBoxLayout* lay = new QVBoxLayout(dlg);
dlg->setWindowTitle("Select User Interface");
lay->setMargin(4);
lay->setSpacing(4);
lay->addWidget(combo);
combo->addItem("Normal With New Toolbar");
combo->addItem("Simple Scenario Player");
combo->addItem("Simple Scenario Viewer");
combo->addItem("Map Area Only");
QSpacerItem* item = new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding);
QHBoxLayout* hLay = new QHBoxLayout;
hLay->setMargin(0);
hLay->setSpacing(0);
lay->addLayout(hLay);
hLay->addItem(item);
QObject::connect(ok, SIGNAL(released()), dlg, SLOT(accept()));
hLay->addWidget(ok);
dlg->exec();
theUiType->setValue(combo->currentIndex());
delete dlg;
}
if (theUiType->getValue() == 0)
{
setupNewToolbar(app, de);
}
else if (theUiType->getValue() == 1)
{
createSimpleScenarioPlayer(app, de);
}
else if (theUiType->getValue() == 2)
{
createSimpleScenarioViewer(app, de);
}
else if (theUiType->getValue() == 3)
{
showMapAreaOnly(app, de);
}
}
{
if(igApp)
{
chooseInterface(*igApp, *de);
return true;
}
else
{
return false;
}
}
{
}