The Interface Manipulation example demonstrates the following:
- How to create a dialog at start-up that gives the option of using VR-Forces GUI in alternate modes
- How to add menus and menu items to the GUI
- How to create a simple scenario player option that limits user capabilities to simply loading and observing scenarios
- How to create a simple scenario viewer option that limits user capabilities to simply observing simulation activity occuring over the network
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, 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 <QtGui/QApplication>
#include <QtGui/QDialog>
#include <QtGui/QLayout>
#include <QtGui/QPushButton>
#include <QtGui/QLabel>
#include <QtGui/QComboBox>
#include <boost/bind.hpp>
static int theUiType = 0;
{
}
{
if (theUiType > 0)
{
if (theUiType == 3)
{
}
}
}
{
(boost::bind(&sessionStartupDialogLoadOnlyMode, _1));
}
{
}
{
}
{
if (!qApp)
{
}
QVBoxLayout* lay = new QVBoxLayout(dlg);
dlg->setWindowTitle("Select User Interface");
lay->setMargin(4);
lay->setSpacing(4);
lay->addWidget(combo);
combo->addItem("Default");
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 = combo->currentIndex();
if (combo->currentIndex() == 1)
{
createSimpleScenarioPlayer(app, de);
}
else if (combo->currentIndex() == 2)
{
createSimpleScenarioViewer(app, de);
}
else if (combo->currentIndex() == 3)
{
showMapAreaOnly(app, de);
}
delete dlg;
}
{
if(igApp)
{
chooseInterface(*igApp, *de);
return true;
}
else
{
return false;
}
}
{
}