VR-Forces 4.1.1 Class Documentation
List of all members | Public Types | Public Member Functions | Protected Attributes
DtUiElementEvent Class Reference

The DtUiElement class is the base for which all UI elements are defined. More...

Public Types

enum  DtUiElementEventTypes {
  DtUiElementTypeUnknown = 0, DtUiElementItemExpand = 1, DtUiElementItemCollapse = 2, DtUiElementHierarchySelectionChanged = 3,
  DtUiElementSaveStateChanged = 4, DtUiElementAddedToHierarchy = 5, DtUiElementRemovedFromHierarchy = 6, DtUiElementMovedInHierarchy = 7,
  DtUiElementReplacedInHierarchy = 8, DtUiElementForceChanged = 9, DtUiElementConfigureDiGuyOn = 10, DtUiElementConfigureDiGuyOff = 11,
  DtUiElementPositionModified = 12, DtUiElementPositionDestroyed = 13, DtUiBoundingVolumeModified = 14, DtUiCanvasInitialized = 15,
  DtUiDiGuyDataChanged = 16, DtUiRequestDiGuyData = 17, DtUiDiGuyDataResponse = 18, DtUiCreateController = 19,
  DtUiCleanup = 20, DtUiElementHierarchyChanged = 21
}

Public Member Functions

 DtUiElementEvent (DtUiElement *owner=0, DtUiElementEventTypes type=DtUiElementTypeUnknown)
 DtUiElementEvent (const DtUiElementEvent &orig)
DtUiElementEventoperator= (const DtUiElementEvent &rhs)
DtUiElementowner () const
DtUiElementEventTypes type () const
void setType (DtUiElementEventTypes t)
void setValue (const QVariant &val)
const QVariant & value () const

Protected Attributes

DtUiElementmyOwner
QVariant myValue
DtUiElementEventTypes myType

Detailed Description

The DtUiElement class is the base for which all UI elements are defined.

If you wish to create a new UI element, you must subclass this item and:

1) Register is i the uiElement factory: DtUiElement()::elementFactory()->registerType<MyNewUiElement>("my-ui-element");

2) Your new UI element will have to create some content. Override the createDataEntryElement() method for this:

QWidget* DtUiStringElement::createDataEntryElement(QWidget* parent) { myLineEdit = new QLineEdit(parent); myLineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);

QObject::connect(myLineEdit, SIGNAL(textChanged(const QString&)), &mySignalHandler, SLOT(elementChanged()));

return myLineEdit; }

3) Add code to take information from the descriptor and place it into your element void DtUiStringElement::setFromParameters(DtReaderWriter* parentRw) { DtReaderWriterRegistryData* val = value(parentRw);

if (val) { DtRwString* str = dynamic_cast<DtRwString*>(val->readerWriter());

if (str) { myLineEdit->blockSignals(true); myLineEdit->setText(QString::fromLocal8Bit(str->c_str())); myLineEdit->blockSignals(false); } }

DtUiElement::setFromParameters(parentRw); }

4) Create code to update the parameter descriptor element when your element changes void DtUiStringElement::elementChanged() { if (myValue) { DtRwString* str = dynamic_cast<DtRwString*>(myValue->readerWriter());

if (str) { str = (const char)myLineEdit->text().toLocal8Bit(); } }

DtUiElement::elementChanged(); }

5) Implement a clone and copy constructor method to be able to duplicate your ui element This class is used for signalling events up/down the chain

Member Enumeration Documentation

Enumerator:
DtUiElementTypeUnknown 
DtUiElementItemExpand 
DtUiElementItemCollapse 
DtUiElementHierarchySelectionChanged 
DtUiElementSaveStateChanged 
DtUiElementAddedToHierarchy 
DtUiElementRemovedFromHierarchy 
DtUiElementMovedInHierarchy 
DtUiElementReplacedInHierarchy 
DtUiElementForceChanged 
DtUiElementConfigureDiGuyOn 
DtUiElementConfigureDiGuyOff 
DtUiElementPositionModified 
DtUiElementPositionDestroyed 
DtUiBoundingVolumeModified 
DtUiCanvasInitialized 
DtUiDiGuyDataChanged 
DtUiRequestDiGuyData 
DtUiDiGuyDataResponse 
DtUiCreateController 
DtUiCleanup 
DtUiElementHierarchyChanged 

Constructor & Destructor Documentation

DtUiElementEvent::DtUiElementEvent ( DtUiElement owner = 0,
DtUiElementEventTypes  type = DtUiElementTypeUnknown 
)
inline
DtUiElementEvent::DtUiElementEvent ( const DtUiElementEvent orig)
inline

Member Function Documentation

DtUiElementEvent& DtUiElementEvent::operator= ( const DtUiElementEvent rhs)
inline

References myOwner, myType, and myValue.

DtUiElement* DtUiElementEvent::owner ( ) const
inline
DtUiElementEventTypes DtUiElementEvent::type ( ) const
inline
void DtUiElementEvent::setType ( DtUiElementEventTypes  t)
inline
void DtUiElementEvent::setValue ( const QVariant &  val)
inline
const QVariant& DtUiElementEvent::value ( ) const
inline

Member Data Documentation

DtUiElement* DtUiElementEvent::myOwner
protected

Referenced by operator=().

QVariant DtUiElementEvent::myValue
protected

Referenced by operator=().

DtUiElementEventTypes DtUiElementEvent::myType
protected

Referenced by operator=().


The documentation for this class was generated from the following file:

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)