VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
makVrf::DtVrfRightClickMenu Class Reference

Used to modify the right click menu based on different contexts. More...

Inheritance diagram for makVrf::DtVrfRightClickMenu:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtVrfRightClickMenu ()
 Destructor for this class which likely should not be called unless you have a good reason for it.
virtual DtSubMenuConfigurationmenuConfiguration ()
 Gets the menu configuration for this class to add/remove menu paths from the right click menu.
virtual void addContext (std::string contextName, DtVrfRightClickContextFunc func)
 Add a new context in which you will reference with a string name (must be unique).
virtual void removeContext (std::string contextName)
 Remove an existing context known to this class.
virtual void setDefaultContext (std::string contextName)
 Sets the default context.
virtual void setCurrentContext (std::string contextName)
 Sets the current context.
virtual void resetContext ()
 Resets the current context to the default context.
virtual std::string currentContext ()
 Gets the current context that was set for this class.
virtual std::string defaultContext ()
 Gets the default context that was set for this class or what it started as.
virtual
DtConfigurableMenuAssembler
menuAssembler ()
 Gets the menu assembler to register/unregister menus to the right click menu.

Static Public Member Functions

static DtVrfRightClickMenuinstance (makVrv::DtDe &de)
 The main accessor for this class. Use this function to get the instance of this object.

Protected Member Functions

void setupDefaultContext ()
 Setup the factory contexts.
 DtVrfRightClickMenu (makVrv::DtDe &de)
 Constructor which should be accessed by the instance() function instead.
virtual QMenucreateMenu (makVrv::DtDe &, QWidget *)
 Overridden function from the base class and should not be overrided if you decide to subclass this object.
virtual void createMenuConfiguration (makVrv::DtDe &)
 Overridden function from the base class and should not be overrided if you decide to subclass this object.

Protected Attributes

DtVrfRightClickContextHandlermyAssemblerAndConfig
makVrv::DtDemyDe

Static Protected Attributes

static DtVrfRightClickMenutheInstance

Additional Inherited Members

- Private Member Functions inherited from makVrf::DtConfigurableMenu
 DtConfigurableMenu (makVrv::DtDe &, const std::string &className)
 CTOR.
virtual ~DtConfigurableMenu ()
 DTOR.
virtual DtSubMenuConfigurationmenuConfiguration ()
 Returns the configuration for the menu to be used. May be effected directly.
virtual
DtConfigurableMenuAssembler
menuAssembler ()
 Returns the assembler for the menu to be used. May be effected directly.
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.
virtual void initMenuItems (makVrv::DtDe &de)
DtConfigurableMenuAssemblerassembler ()
DtSubMenuConfigurationconfiguration ()
virtual void createMenuConfiguration (makVrv::DtDe &)
 Creates the menu configuration by creating the assembler and adding menu items.
- Static Private Member Functions inherited from makVrf::DtConfigurableMenu
static bool hasMenuPath (const makVrv::DtMenuConfiguration &menus, const makVrv::DtMenuPath &sourcePath, const std::string &item, makVrv::DtMenuPath &foundPath)
- Private 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
DtConfigurableMenuAssembler myAssembler
DtSubMenuConfiguration myConfiguration
bool myInitialized
makVrv::DtSignalConnectionManager myConnections

Detailed Description

Used to modify the right click menu based on different contexts.

A context is defined by what is true at the time a right click occurs in the GUI. Given a set of parameters, if the context holds true, then you can apply different changes to the right click menu depending on the context. You can define your own context functions and define which changes you wish to occur during which right click context.

Examples

Constructor & Destructor Documentation

virtual makVrf::DtVrfRightClickMenu::~DtVrfRightClickMenu ( )
virtual

Destructor for this class which likely should not be called unless you have a good reason for it.

makVrf::DtVrfRightClickMenu::DtVrfRightClickMenu ( makVrv::DtDe de)
protected

Constructor which should be accessed by the instance() function instead.

Member Function Documentation

static DtVrfRightClickMenu& makVrf::DtVrfRightClickMenu::instance ( makVrv::DtDe de)
static

The main accessor for this class. Use this function to get the instance of this object.

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

Gets the menu configuration for this class to add/remove menu paths from the right click menu.

Like every other function in this class, the context matters and it is recommended that you call setCurrentContext() first before making modifications so that you are changing the appropriate right click menu context.

virtual void makVrf::DtVrfRightClickMenu::addContext ( std::string  contextName,
DtVrfRightClickContextFunc  func 
)
virtual

Add a new context in which you will reference with a string name (must be unique).

It is recommended that you name them similar to "MySampleContext". When you add a new context, you can refer to it by setting the current context (setCurrentContext()) and now when you make changes to the right click menu, it will only apply if the function you supplied proves true. If no function is given, your context will not be added.

virtual void makVrf::DtVrfRightClickMenu::removeContext ( std::string  contextName)
virtual

Remove an existing context known to this class.

VR-Forces comes with a few supplied contexts and you can remove them if you wish. You can also remove your own contexts though that is very unlikely as you would not add it in the first place if you did not want it to be there. This function will likely not be called by most users.

virtual void makVrf::DtVrfRightClickMenu::setDefaultContext ( std::string  contextName)
virtual

Sets the default context.

The default context is the context that this class starts with and is also the context that will be used when you call resetContext(). This is if you will find yourself changing the context back and forth for adding and removing menu items for multiple contexts. It is likely that most users will stick to setCurrentContext() to flip to the context they want, make changes, and then call it again to make changes for the next context.

virtual void makVrf::DtVrfRightClickMenu::setCurrentContext ( std::string  contextName)
virtual

Sets the current context.

Once the current context is set, all add/remove of menus using this class will result in only applying to the context you just set it to. The context name is associated with a function which evaluates whether some set of conditions to determine whether or not to apply your changes to the right click menu. Given the nature of the right click, all these changes are stored on a per context basis and making changes requires you to tell this class which context you are talking about for the changes you make.

virtual void makVrf::DtVrfRightClickMenu::resetContext ( )
virtual

Resets the current context to the default context.

This will likely not be used much by most users.

virtual std::string makVrf::DtVrfRightClickMenu::currentContext ( )
virtual

Gets the current context that was set for this class.

virtual std::string makVrf::DtVrfRightClickMenu::defaultContext ( )
virtual

Gets the default context that was set for this class or what it started as.

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

Gets the menu assembler to register/unregister menus to the right click menu.

Changes made to the registration are not context sensitive as this affects the entire right click menu regardless of context. Menus/items registered by DtVrfMainMenu do not need to be re-registered.

void makVrf::DtVrfRightClickMenu::setupDefaultContext ( )
protected

Setup the factory contexts.

virtual QMenu* makVrf::DtVrfRightClickMenu::createMenu ( makVrv::DtDe ,
QWidget *   
)
protectedvirtual

Overridden function from the base class and should not be overrided if you decide to subclass this object.

virtual void makVrf::DtVrfRightClickMenu::createMenuConfiguration ( makVrv::DtDe )
protectedvirtual

Overridden function from the base class and should not be overrided if you decide to subclass this object.

Member Data Documentation

DtVrfRightClickContextHandler* makVrf::DtVrfRightClickMenu::myAssemblerAndConfig
protected
makVrv::DtDe& makVrf::DtVrfRightClickMenu::myDe
protected
DtVrfRightClickMenu* makVrf::DtVrfRightClickMenu::theInstance
staticprotected

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)