VR-Forces 4.0.4 Class Documentation
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]

List of all members.

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

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.


Constructor & Destructor Documentation

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

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


Member Function Documentation

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

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.

Implements makVrf::DtConfigurableMenu.

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.

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.

Implements makVrf::DtConfigurableMenu.

Setup the factory contexts.

virtual QMenu* makVrf::DtVrfRightClickMenu::createMenu ( makVrv::DtDe ,
QWidget  
) [protected, virtual]

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

Implements makVrv::DtMenu.

virtual void makVrf::DtVrfRightClickMenu::createMenuConfiguration ( makVrv::DtDe ) [protected, virtual]

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

Implements makVrf::DtConfigurableMenu.


Member Data Documentation

Reimplemented from makVrv::DtMenu.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)