VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
makVrf::DtCreateMenu Class Reference
Inheritance diagram for makVrf::DtCreateMenu:
Inheritance graph
[legend]

Classes

struct  AdditionalItem

Public Types

typedef std::vector
< AdditionalItem
AdditionalItems
typedef
DtOrderedEntityTypeList
< DtCreateObjectActionCreator * > 
ObjectActionCreators

Public Member Functions

 DtCreateMenu (makVrv::DtDe &, const QString &createName=DtCreateMenuId)
 CTOR.
virtual ~DtCreateMenu ()
 DTOR.
virtual QMenucreateMenu (makVrv::DtDe &, QWidget *parent)
 Build a menu.
virtual void setUseGlobalMenuManager (bool)
 The useGlobalMenuManager should only be used for the first instance of the create menu.
virtual bool useGlobalMenuManager () const
virtual DtCreateMenunewInstance ()
virtual DtCreateMenuclone () const
 Returns a duplicate of this menu.
virtual DtCreateMenuduplicate (QMenu *&, QWidget *parent, makVrf::DtMenu *menu=0)
 If menu is specified, uses that rather than scenario default.
void setTearOffsEnabled (bool b)
virtual void setBaseCreateMenu (makVrf::DtMenu *)
virtual DtEntityType nameToType (const QString &) const
 Given a name of a menu item (e.g. M1A2) return the entity type that represents that.
virtual bool triggerAction (const DtEntityMapperKey &key)
 Given an entity key, trigger that action to create it. Return true if action is found.
bool tearOffsEnabled () const
virtual void setSignalCreation (bool)
 Set to true to signal creation rather than creating immediately. Will send boost signal_createObject signal if true.
bool signalCreation () const
const AdditionalItemsadditionalItems () const
 Returns items that are scheduled to be added to new create menus.
AdditionalItemsadditionalItems ()
virtual void setCreateObjectActionCreatorFor (const DtEntityType &, DtCreateObjectActionCreator *)
 Add/replace the object action creator for the specified entity mapper key.
virtual
DtCreateObjectActionCreator
createObjectActionCreatorFor (const DtEntityType &) const
 Return the object action creator for the specified type.
const
DtVrfCreateMenu::MappedActions
mappedActions () const
virtual DtCreateMenuFlags menuFlags () const
bool removePaletteItems () const
bool removeExtraCreateItems () const
virtual void setMenuFlags (DtCreateMenuFlags b)
 When creating the menu, set to true to remove the "Entity Palette..." and other palette related items item.
virtual DtSubMenuConfigurationmenuConfiguration ()
 Returns the configuration for the menu to be used in the master mode.
virtual
DtConfigurableMenuAssembler
menuAssembler ()
 Returns the configuration for the menu to be used in the master mode. May be effected directly.
virtual void addItemToCreate (const makVrv::DtMenuPath &path, const DtEntityMapperKey &key, const DtString &keywords="", const DtString &menuIcon="")
 Routines to add items to the menu to create.
virtual void removeItemToCreate (const makVrv::DtMenuPath &)
 Call to remove an additional item to create.
virtual void addItemToCreateBefore (const makVrv::DtMenuPath &path, const makVrv::DtMenuPath &before, const DtEntityMapperKey &key, const DtString &keywords="", const DtString &menuIcon="")
 Same as above, except adds before specified path.
virtual void addItemToCreateAfter (const makVrv::DtMenuPath &path, const makVrv::DtMenuPath &after, const DtEntityMapperKey &key, const DtString &keywords="", const DtString &menuIcon="")
 Same as above, except adds after specified path.
- Public Member Functions inherited from makVrf::DtConfigurableMenu
 DtConfigurableMenu (makVrv::DtDe &, const std::string &className)
 CTOR.
virtual ~DtConfigurableMenu ()
 DTOR.
virtual void registerMenu (makVrv::DtMenu *customMenu)
 Use to register your own complex menu object.
virtual void registerMenuItem (makVrv::DtMenuItem *customMenuItem)
 Use to register your own complex menu item object.
virtual void createSimpleMenu (std::string menuText, makVrv::DtMenuPath menuIdPath, int weight=-1)
virtual void createSimpleMenuAfter (std::string menuText, makVrv::DtMenuPath menuIdPath, makVrv::DtMenuPath afterIdPath)
virtual void createSimpleMenuBefore (std::string menuText, makVrv::DtMenuPath menuIdPath, makVrv::DtMenuPath beforeIdPath)
virtual void createSimpleMenuItem (std::string itemText, makVrv::DtMenuPath itemIdPath, DtSimpleMenuItemAction *action, void *usr=NULL, int weight=-1)
virtual void createSimpleMenuItemAfter (std::string itemText, makVrv::DtMenuPath itemIdPath, makVrv::DtMenuPath afterIdPath, DtSimpleMenuItemAction *action, void *usr=NULL)
virtual void createSimpleMenuItemBefore (std::string itemText, makVrv::DtMenuPath itemIdPath, makVrv::DtMenuPath beforeIdPath, DtSimpleMenuItemAction *action, void *usr=NULL)
virtual void mergeMenu (makVrv::DtQtMenuAssembler &assembler, makVrv::DtMenuConfiguration &configuration)
 Merges in the assembler and configuration into the supplied assembler and configuration.
virtual void mergeMenu (makVrv::DtQtMenuAssembler &assembler)
 Merges in the assembler into the supplied assembler.
virtual void mergeMenu (makVrv::DtMenuConfiguration &configuration)
 Merges in the configuration into the supplied configuration. This merges all the menu paths together.
- Public Member Functions inherited from makVrv::DtMenu
 DtMenu (DtDe &de, const std::string &menuIdName)
 CTOR.
virtual ~DtMenu ()
 DTOR.
virtual const std::string & menuIdName () const
 Get the menu id name, the menu id name is not the same thing as the visible menu text.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static DtCreateMenuinstance (makVrv::DtDe &)
static DtCreateMenumenuInstance (makVrv::DtDe &)
 Return a new copy, not the registered copy.
- Static Public Member Functions inherited from makVrf::DtConfigurableMenu
static bool hasMenuPath (const makVrv::DtMenuConfiguration &menus, const makVrv::DtMenuPath &sourcePath, const std::string &item, makVrv::DtMenuPath &foundPath)

Public Attributes

boost::signal< void(const
DtVrfObjectManipulationHandlerBaseClass::ObjectManipulationData &)> 
signal_createObject
- Public Attributes inherited from makVrf::DtConfigurableMenu
boost::signal< void(DtConfigurableMenu *)> signal_menuRecreated
 Signal sent when this menu is recreated from it's original creation.
boost::signal< void(QAction *)> signal_validateMenuItem

Protected Member Functions

virtual void createMenuConfiguration (makVrv::DtDe &de)
 Called to initially create the menu configuration.
virtual void slot_onCreateObject (const DtVrfObjectManipulationHandlerBaseClass::ObjectManipulationData &)
virtual void menuRecreated ()
- Protected Member Functions inherited from makVrf::DtConfigurableMenu
virtual void initMenuItems (makVrv::DtDe &de)
DtConfigurableMenuAssemblerassembler ()
DtSubMenuConfigurationconfiguration ()

Protected Attributes

bool myTearOffsEnabled
AdditionalItems myAdditionalItems
bool mySignalCreation
ObjectActionCreators myObjectActionCreators
DtCreateMenuFlags myMenuFlags
makVrf::DtMenumyBaseCreateMenu
bool myUseGlobalMenuManager
- Protected Attributes inherited from makVrf::DtConfigurableMenu
DtConfigurableMenuAssembler myAssembler
DtSubMenuConfiguration myConfiguration
bool myInitialized
makVrv::DtSignalConnectionManager myConnections
- Protected Attributes inherited from makVrv::DtMenu
DtDemyDe
std::string myMenuIdName

Static Protected Attributes

static
DtConfigurableMenuAssembler
theMenuAssembler
 Variables used to store initial menu configuration.
static DtSubMenuConfigurationtheMenuConfiguration

Detailed Description

Examples

Member Typedef Documentation

Constructor & Destructor Documentation

makVrf::DtCreateMenu::DtCreateMenu ( makVrv::DtDe ,
const QString &  createName = DtCreateMenuId 
)

CTOR.

virtual makVrf::DtCreateMenu::~DtCreateMenu ( )
virtual

DTOR.

Member Function Documentation

virtual QMenu* makVrf::DtCreateMenu::createMenu ( makVrv::DtDe ,
QWidget *  parent 
)
virtual

Build a menu.

Implements makVrv::DtMenu.

Reimplemented in makVrf::DtRightClickCreateMenu.

static DtCreateMenu& makVrf::DtCreateMenu::instance ( makVrv::DtDe )
static
virtual void makVrf::DtCreateMenu::setUseGlobalMenuManager ( bool  )
virtual

The useGlobalMenuManager should only be used for the first instance of the create menu.

Not for create menus on dialogs. If true, when actions are created they will be added to the global menu manager

virtual bool makVrf::DtCreateMenu::useGlobalMenuManager ( ) const
virtual
static DtCreateMenu* makVrf::DtCreateMenu::menuInstance ( makVrv::DtDe )
static

Return a new copy, not the registered copy.

It will do this by calling the newInstance method on the currently registered version. newInstance needs to be overridden by subclasses to return their own new instance

virtual DtCreateMenu* makVrf::DtCreateMenu::newInstance ( )
virtual
virtual DtCreateMenu* makVrf::DtCreateMenu::clone ( ) const
virtual

Returns a duplicate of this menu.

If you are subclassing this menu, override the clone() method to return a new instance of your subclass

virtual DtCreateMenu* makVrf::DtCreateMenu::duplicate ( QMenu *&  ,
QWidget *  parent,
makVrf::DtMenu menu = 0 
)
virtual

If menu is specified, uses that rather than scenario default.

void makVrf::DtCreateMenu::setTearOffsEnabled ( bool  b)
inline
virtual void makVrf::DtCreateMenu::setBaseCreateMenu ( makVrf::DtMenu )
virtual
virtual DtEntityType makVrf::DtCreateMenu::nameToType ( const QString &  ) const
virtual

Given a name of a menu item (e.g. M1A2) return the entity type that represents that.

virtual bool makVrf::DtCreateMenu::triggerAction ( const DtEntityMapperKey key)
virtual

Given an entity key, trigger that action to create it. Return true if action is found.

bool makVrf::DtCreateMenu::tearOffsEnabled ( ) const
inline
virtual void makVrf::DtCreateMenu::setSignalCreation ( bool  )
virtual

Set to true to signal creation rather than creating immediately. Will send boost signal_createObject signal if true.

bool makVrf::DtCreateMenu::signalCreation ( ) const
inline
const AdditionalItems& makVrf::DtCreateMenu::additionalItems ( ) const
inline

Returns items that are scheduled to be added to new create menus.

AdditionalItems& makVrf::DtCreateMenu::additionalItems ( )
inline
virtual void makVrf::DtCreateMenu::setCreateObjectActionCreatorFor ( const DtEntityType &  ,
DtCreateObjectActionCreator  
)
virtual

Add/replace the object action creator for the specified entity mapper key.

virtual DtCreateObjectActionCreator* makVrf::DtCreateMenu::createObjectActionCreatorFor ( const DtEntityType &  ) const
virtual

Return the object action creator for the specified type.

const DtVrfCreateMenu::MappedActions& makVrf::DtCreateMenu::mappedActions ( ) const
virtual DtCreateMenuFlags makVrf::DtCreateMenu::menuFlags ( ) const
inlinevirtual
bool makVrf::DtCreateMenu::removePaletteItems ( ) const
inline
bool makVrf::DtCreateMenu::removeExtraCreateItems ( ) const
inline
virtual void makVrf::DtCreateMenu::setMenuFlags ( DtCreateMenuFlags  b)
inlinevirtual

When creating the menu, set to true to remove the "Entity Palette..." and other palette related items item.

virtual void makVrf::DtCreateMenu::createMenuConfiguration ( makVrv::DtDe de)
protectedvirtual

Called to initially create the menu configuration.

Reimplemented from makVrf::DtConfigurableMenu.

virtual DtSubMenuConfiguration& makVrf::DtCreateMenu::menuConfiguration ( )
virtual

Returns the configuration for the menu to be used in the master mode.

May be effected directly

When using this configuration, it is used a bit differently than other configuration due to the nature of the create menu itself

When referencing the main menu, referece CreateMenu as the main menu (makVrv::DtMenuPath::mainMenu("CreateMenu")) Sub-menus and items are referenced by their name as they appear in the entity.mst file (Friendly, Opposing, M1A2, etc).

Reimplemented from makVrf::DtConfigurableMenu.

virtual DtConfigurableMenuAssembler& makVrf::DtCreateMenu::menuAssembler ( )
virtual

Returns the configuration for the menu to be used in the master mode. May be effected directly.

Reimplemented from makVrf::DtConfigurableMenu.

virtual void makVrf::DtCreateMenu::addItemToCreate ( const makVrv::DtMenuPath path,
const DtEntityMapperKey key,
const DtString keywords = "",
const DtString menuIcon = "" 
)
virtual

Routines to add items to the menu to create.

Shortcut for adding a menu item creator of type DtCreateObjectAction and a menu item to the path

Add at least the keyword on_overlay to allow the object to be placed on overlay layers. This means it can be created locally and placed on the overlay palette

TODO: Make sure this gets on the overlay palette

virtual void makVrf::DtCreateMenu::removeItemToCreate ( const makVrv::DtMenuPath )
virtual

Call to remove an additional item to create.

virtual void makVrf::DtCreateMenu::addItemToCreateBefore ( const makVrv::DtMenuPath path,
const makVrv::DtMenuPath before,
const DtEntityMapperKey key,
const DtString keywords = "",
const DtString menuIcon = "" 
)
virtual

Same as above, except adds before specified path.

virtual void makVrf::DtCreateMenu::addItemToCreateAfter ( const makVrv::DtMenuPath path,
const makVrv::DtMenuPath after,
const DtEntityMapperKey key,
const DtString keywords = "",
const DtString menuIcon = "" 
)
virtual

Same as above, except adds after specified path.

virtual void makVrf::DtCreateMenu::slot_onCreateObject ( const DtVrfObjectManipulationHandlerBaseClass::ObjectManipulationData )
protectedvirtual
virtual void makVrf::DtCreateMenu::menuRecreated ( )
protectedvirtual

Member Data Documentation

boost::signal<void (const DtVrfObjectManipulationHandlerBaseClass::ObjectManipulationData&)> makVrf::DtCreateMenu::signal_createObject
bool makVrf::DtCreateMenu::myTearOffsEnabled
protected
AdditionalItems makVrf::DtCreateMenu::myAdditionalItems
protected
bool makVrf::DtCreateMenu::mySignalCreation
protected
ObjectActionCreators makVrf::DtCreateMenu::myObjectActionCreators
protected
DtCreateMenuFlags makVrf::DtCreateMenu::myMenuFlags
protected
DtConfigurableMenuAssembler* makVrf::DtCreateMenu::theMenuAssembler
staticprotected

Variables used to store initial menu configuration.

DtSubMenuConfiguration* makVrf::DtCreateMenu::theMenuConfiguration
staticprotected
makVrf::DtMenu* makVrf::DtCreateMenu::myBaseCreateMenu
protected
bool makVrf::DtCreateMenu::myUseGlobalMenuManager
protected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)