![]() |
VR-Forces 4.2 Class Documentation
|
Used to modify the right click menu based on different contexts. More...

Public Member Functions | |
| virtual | ~DtVrfRightClickMenu () |
| Destructor for this class which likely should not be called unless you have a good reason for it. | |
| virtual DtSubMenuConfiguration & | menuConfiguration () |
| 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 DtVrfRightClickMenu & | instance (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 QMenu * | createMenu (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 | |
| DtVrfRightClickContextHandler * | myAssemblerAndConfig |
| makVrv::DtDe & | myDe |
Static Protected Attributes | |
| static DtVrfRightClickMenu * | theInstance |
Additional Inherited Members | |
Private Member Functions inherited from makVrf::DtConfigurableMenu | |
| DtConfigurableMenu (makVrv::DtDe &, const std::string &className) | |
| CTOR. | |
| virtual | ~DtConfigurableMenu () |
| DTOR. | |
| virtual DtSubMenuConfiguration & | menuConfiguration () |
| 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) |
| DtConfigurableMenuAssembler & | assembler () |
| DtSubMenuConfiguration & | configuration () |
| virtual void | createMenuConfiguration (makVrv::DtDe &) |
| Creates the menu configuration by creating the assembler and adding menu items. | |
Private Attributes inherited from makVrf::DtConfigurableMenu | |
| boost::signal< void(QAction *)> | signal_validateMenuItem |
| DtConfigurableMenuAssembler | myAssembler |
| DtSubMenuConfiguration | myConfiguration |
| bool | myInitialized |
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.
|
virtual |
Destructor for this class which likely should not be called unless you have a good reason for it.
|
protected |
Constructor which should be accessed by the instance() function instead.
|
static |
The main accessor for this class. Use this function to get the instance of this object.
|
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 |
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 |
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 |
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 |
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 |
Resets the current context to the default context.
This will likely not be used much by most users.
|
virtual |
Gets the current context that was set for this class.
|
virtual |
Gets the default context that was set for this class or what it started as.
|
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.
|
protected |
Setup the factory contexts.
|
protectedvirtual |
Overridden function from the base class and should not be overrided if you decide to subclass this object.
|
protectedvirtual |
Overridden function from the base class and should not be overrided if you decide to subclass this object.
|
protected |
|
protected |
|
staticprotected |