VR-Forces 5.0.2 Developer's Guide
 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. 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.

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

Public Member Functions

virtual ~DtVrfRightClickMenu ()
 
virtual DtSubMenuConfigurationmenuConfiguration ()
 
virtual void addContext (std::string contextName, DtVrfRightClickContextFunc func)
 
virtual void removeContext (std::string contextName)
 
virtual void setDefaultContext (std::string contextName)
 
virtual void setCurrentContext (std::string contextName)
 
virtual void resetContext ()
 
virtual std::string currentContext ()
 
virtual std::string defaultContext ()
 
virtual
DtConfigurableMenuAssembler
menuAssembler ()
 

Static Public Member Functions

static DtVrfRightClickMenuinstance (makVrv::DtDe &de)
 

Protected Member Functions

void setupDefaultContext ()
 
 DtVrfRightClickMenu (makVrv::DtDe &de)
 
virtual QMenucreateMenu (makVrv::DtDe &, QWidget *)
 
virtual void createMenuConfiguration (makVrv::DtDe &)
 

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)
 
virtual ~DtConfigurableMenu ()
 
virtual void registerMenu (makVrv::DtMenu *customMenu)
 
virtual void registerMenuItem (makVrv::DtMenuItem *customMenuItem)
 
virtual void createSimpleMenu (std::string menuText, makVrv::DtMenuPath menuIdPath, const makVrv::DtMenuConfiguration::MenuSortFlags &sortFlagsIfMenu=(makVrv::DtMenuConfiguration::MenuSortFlags)(makVrv::DtMenuConfiguration::SortAllAlphabetically|makVrv::DtMenuConfiguration::SortWithinSubmenus|makVrv::DtMenuConfiguration::SortBetweenSeparators))
 
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, const makVrv::DtMenuConfiguration::MenuSortFlags &sortFlagsIfMenu=(makVrv::DtMenuConfiguration::MenuSortFlags)(makVrv::DtMenuConfiguration::SortAllAlphabetically|makVrv::DtMenuConfiguration::SortWithinSubmenus|makVrv::DtMenuConfiguration::SortBetweenSeparators))
 
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)
 
virtual void mergeMenu (makVrv::DtQtMenuAssembler &assembler)
 
virtual void mergeMenu (makVrv::DtMenuConfiguration &configuration)
 
virtual void initMenuItems (makVrv::DtDe &de)
 
DtConfigurableMenuAssemblerassembler ()
 
DtSubMenuConfigurationconfiguration ()
 
- Private Member Functions inherited from makVrv::DtMenu
 DtMenu (DtDe &de, const std::string &menuIdName)
 
virtual ~DtMenu ()
 
virtual const std::string & menuIdName () const
 
- Private Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 
- 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::signals2::signal< void(DtConfigurableMenu *)> signal_menuRecreated
 
boost::signals2::signal< void(QAction *)> signal_validateMenuItem
 
DtConfigurableMenuAssembler myAssembler
 
DtSubMenuConfiguration myConfiguration
 
bool myInitialized
 
makVrv::DtSignalConnectionManager myConnections
 
- Private Attributes inherited from makVrv::DtMenu
DtDemyDe
 
std::string myMenuIdName
 

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.

Reimplemented from 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.

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.

Reimplemented from makVrf::DtConfigurableMenu.

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.

Implements makVrv::DtMenu.

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.

Reimplemented from makVrf::DtConfigurableMenu.

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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)