VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtBaseSoundEditorWidget Class Reference

A widget for editing the entity sound mappings. More...

Inheritance diagram for makVrv::DtBaseSoundEditorWidget:
Inheritance graph
[legend]

Public Member Functions

 DtBaseSoundEditorWidget (DtDe &de, QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
 CTOR Default CTOR.
virtual ~DtBaseSoundEditorWidget ()
 Virtual DTOR.
virtual int addRecord (const DtEntitySoundMapRecord &rec, int err=0)
 Adds a new record to the widget at the currently selected row.
virtual int changeRecord (const DtEntitySoundMapRecord &rec, int err)=0
 Changes an existing record's row in the widget.
virtual void removeRecord (const DtEntitySoundMapRecord &rec)
 Remove an existing record's row from the widget.
virtual void clearMap ()
 Clear map and reset headers.
- Public Member Functions inherited from makVrv::DtBaseSoundEditorInterface
virtual ~DtBaseSoundEditorInterface ()
 DTOR.

Protected Types

typedef QList< QStandardItem * > RowData

Protected Slots

virtual void onAddEntityClicked ()=0
 Called when user clicks the "Add Entity" button.
virtual void onDeleteEntityClicked ()=0
 Called when user clicks the "Delete Entity" button.
virtual void onItemChanged (QStandardItem *item)=0
 Called when the data in an item changed.

Protected Member Functions

virtual void removeRow (int row)
 Remove an old entity sound row from the model.
virtual int rowIndex (const QString &key, int reserved=0)
 Get a row index from the model keyed from an entity type.
virtual bool getRecordFromRow (int row, DtEntitySoundMapRecord *rec)
 Fill out a sound map record with data from a row.
virtual bool getRecordFromRow (const QModelIndex &index, DtEntitySoundMapRecord *rec)
 Fill out a sound map record with data from a row.
virtual RowData createRowData (const DtEntitySoundMapRecord &rec)
 Create data for inserting a new row into the model.
virtual void setWidgetTitle (const QString &title)
 Set the title for the mapping editor widget.
virtual void setRowError (int row, int err=0)
 Set the color of the row based on an error flag.
virtual void resizeSections ()
 Resize the table sections and headers to fit content.

Protected Attributes

DtDemyDe
 The display engine for this instance.
QStandardItemModel * myEditorModel
 The model of the Entity Type to Sound File mappings for editing.
QTreeViewmyEditorView
 The view of the Entity Type to Sound File mappings for editing.

Private Member Functions

void setupGui ()
 Create the main GUI layout.

Additional Inherited Members

- Public Attributes inherited from makVrv::DtBaseSoundEditorInterface
boost::signal< void(const
DtEntitySoundMapRecord &)> 
signal_SoundMapRecordChanged
 Signal emitted when the user changes data in the widget.
boost::signal< void(const
DtEntitySoundMapRecord &)> 
signal_SoundMapRecordRemoved

Detailed Description

A widget for editing the entity sound mappings.

Member Typedef Documentation

typedef QList<QStandardItem*> makVrv::DtBaseSoundEditorWidget::RowData
protected

Constructor & Destructor Documentation

makVrv::DtBaseSoundEditorWidget::DtBaseSoundEditorWidget ( DtDe de,
QWidget *  parent = 0,
Qt::WindowFlags  f = Qt::Widget 
)

CTOR Default CTOR.

Parameters
[in]deis the display engine for this instance.
[in]parentis the parent widget for this widget.
[in]flagsis an OR'd list of Qt window flags.
virtual makVrv::DtBaseSoundEditorWidget::~DtBaseSoundEditorWidget ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual int makVrv::DtBaseSoundEditorWidget::addRecord ( const DtEntitySoundMapRecord rec,
int  err = 0 
)
virtual

Adds a new record to the widget at the currently selected row.

Parameters
[in]recis the record of data to populate the new row.
[in]erris a flag indicating an error with sound file or data.
Returns
The row index of the new record.
Note
Derived classes may extend but should not override.

Implements makVrv::DtBaseSoundEditorInterface.

Reimplemented in makVrv::DtDetonationSoundEditorWidget, makVrv::DtFireSoundEditorWidget, and makVrv::DtEntitySoundEditorWidget.

virtual int makVrv::DtBaseSoundEditorWidget::changeRecord ( const DtEntitySoundMapRecord rec,
int  err 
)
pure virtual

Changes an existing record's row in the widget.

Parameters
[in]recis the record of data to populate the row.
[in]erris a flag indicating an error with sound file or data.
Returns
The row index of the changed record.
Note
Derived classes must implement.

Implements makVrv::DtBaseSoundEditorInterface.

Implemented in makVrv::DtDetonationSoundEditorWidget, makVrv::DtFireSoundEditorWidget, and makVrv::DtEntitySoundEditorWidget.

virtual void makVrv::DtBaseSoundEditorWidget::removeRecord ( const DtEntitySoundMapRecord rec)
virtual

Remove an existing record's row from the widget.

Parameters
[in]recis the record of data used to locate the row.
Note
Derived classes may extend or override.

Implements makVrv::DtBaseSoundEditorInterface.

Reimplemented in makVrv::DtDetonationSoundEditorWidget.

virtual void makVrv::DtBaseSoundEditorWidget::clearMap ( )
virtual

Clear map and reset headers.

Note
Derived classes should extend but not override.

Implements makVrv::DtBaseSoundEditorInterface.

Reimplemented in makVrv::DtDetonationSoundEditorWidget, makVrv::DtFireSoundEditorWidget, and makVrv::DtEntitySoundEditorWidget.

virtual void makVrv::DtBaseSoundEditorWidget::onAddEntityClicked ( )
protectedpure virtualslot

Called when user clicks the "Add Entity" button.

Note
Derived classes must implement.
virtual void makVrv::DtBaseSoundEditorWidget::onDeleteEntityClicked ( )
protectedpure virtualslot

Called when user clicks the "Delete Entity" button.

Note
Derived classes must implement.
virtual void makVrv::DtBaseSoundEditorWidget::onItemChanged ( QStandardItem *  item)
protectedpure virtualslot

Called when the data in an item changed.

Note
Automatically called. Do not directly call this function.
virtual void makVrv::DtBaseSoundEditorWidget::removeRow ( int  row)
protectedvirtual

Remove an old entity sound row from the model.

Parameters
[in]rowis the index of the row to remove.
virtual int makVrv::DtBaseSoundEditorWidget::rowIndex ( const QString &  key,
int  reserved = 0 
)
protectedvirtual

Get a row index from the model keyed from an entity type.

Parameters
[in]keyis the entity type to search for.
[in]reservedis reserved for future use.
Returns
the index of the row or -1 if not found.

Reimplemented in makVrv::DtDetonationSoundEditorWidget.

virtual bool makVrv::DtBaseSoundEditorWidget::getRecordFromRow ( int  row,
DtEntitySoundMapRecord rec 
)
protectedvirtual

Fill out a sound map record with data from a row.

Parameters
[in]rowis the row to get the data from.
[out]recis a pointer to a record to fill out.
Return values
truerecord was successfully filled out.
falseotherwise.
Note
Derived classes may extend, but should not overwrite.

Reimplemented in makVrv::DtDetonationSoundEditorWidget, and makVrv::DtFireSoundEditorWidget.

virtual bool makVrv::DtBaseSoundEditorWidget::getRecordFromRow ( const QModelIndex &  index,
DtEntitySoundMapRecord rec 
)
protectedvirtual

Fill out a sound map record with data from a row.

Parameters
[in]indexis the index to one piece of data in the row.
[out]recis a pointer to a record to fill out.
Return values
truerecord was successfully filled out.
falseotherwise.
Note
Derived classes may extend, but should not overwrite.
virtual RowData makVrv::DtBaseSoundEditorWidget::createRowData ( const DtEntitySoundMapRecord rec)
protectedvirtual

Create data for inserting a new row into the model.

Note
Derived classes may extend, but should not overwrite.

Reimplemented in makVrv::DtDetonationSoundEditorWidget, and makVrv::DtFireSoundEditorWidget.

virtual void makVrv::DtBaseSoundEditorWidget::setWidgetTitle ( const QString &  title)
protectedvirtual

Set the title for the mapping editor widget.

Parameters
[in]titleis the new title for the widget.
Note
This sets the title for the widget, not the page.
virtual void makVrv::DtBaseSoundEditorWidget::setRowError ( int  row,
int  err = 0 
)
protectedvirtual

Set the color of the row based on an error flag.

Parameters
[in]rowis the index of the row for the error.
[in]erris the error flag (0 means 'no-error').
Note
If there is no error the row will be displayed in the default color (white). If there is an error of any kind, the row will be displayed in the error color (red).
virtual void makVrv::DtBaseSoundEditorWidget::resizeSections ( )
protectedvirtual

Resize the table sections and headers to fit content.

void makVrv::DtBaseSoundEditorWidget::setupGui ( )
private

Create the main GUI layout.

Member Data Documentation

DtDe& makVrv::DtBaseSoundEditorWidget::myDe
protected

The display engine for this instance.

QStandardItemModel* makVrv::DtBaseSoundEditorWidget::myEditorModel
protected

The model of the Entity Type to Sound File mappings for editing.

QTreeView* makVrv::DtBaseSoundEditorWidget::myEditorView
protected

The view of the Entity Type to Sound File mappings for editing.


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

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)