VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Modify Task (modifyTask)

The Modify Task example demonstrates the following:

This example adds a new label to the dialog called "Modified By Example" to the Move To... task in order to show how an existing dialog can be modified.

/*******************************************************************************
** Copyright (c) 2011 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//\file modifyTaskPlugin.cxx
//This file defines the generic DT_DLL_VRF_PLUGIN_EXPORT_MACRO. Use that macro when
//you want to export symbols. Also, in your CMakeLists.txt file, make sure to
//define the VRFPLUGIN_EXPORTS define to tell the compiler to define the macro as an
//export
#include <vrvCore/DtDe.h>
#include <QtGui/QGroupBox>
#include <QtGui/QLabel>
#include <QtGui/QLayout>
//Override of task move to dialog. Will show how to add a new UI element to the existing dialog
class MyTaskMoveToDialog : public makVrf::DtTaskMoveToDialog
{
public:
MyTaskMoveToDialog(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0)
: makVrf::DtTaskMoveToDialog(de, parent, flags)
{
}
protected:
//Override the contents method, calling the parent method first to create the contents, then
//hide the movement box
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;
}
};
//Override of creator for task move to dialog. Will create new instance
//of the move to dialog
class MyTaskMoveToDialogCreator : public makVrf::DtTaskMoveToDialogCreator
{
public:
{
return new MyTaskMoveToDialog(de, parent, theTaskSetCreationFlags);
}
};
{
//The DtVrfTaskSetDialogManager is the class that holds all the creators
//for task and set dialogs. Install an override creator here to create
//an instance of the move to dialog
//And add the new creator
manager.addTaskDialogCreator(DtTaskMoveToAction, new MyTaskMoveToDialogCreator);
return true;
}
{
info.pluginName = "Modify Task";
info.pluginDescription = "This example shows how to modify an existing task dialog (Move To Waypoint...) to add your own functionality.";
info.pluginVersion = "1.00";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 USA";
info.pluginContactPhone = "(617) 876 8085";
}

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)