ContextMenuInterface Class Reference

Interface class for creating custom context menus. More...

#include <ContextMenuInterface.hh>

Inheritance diagram for ContextMenuInterface:
Inheritance graph
[legend]

List of all members.

Signals

virtual void addContextMenuItem (QAction *, ContextMenuType)
 Add an entry for a context Menu.
virtual void addContextMenuItem (QAction *, DataType, ContextMenuType)
 Add an entry for a context Menu.

Public Member Functions

virtual ~ContextMenuInterface ()
 Destructor.

Private Slots

virtual void slotUpdateContextMenu (int)
virtual void slotUpdateContextMenuNode (int)
virtual void slotUpdateContextMenuBackground ()

Detailed Description

Interface class for creating custom context menus.

Using this interface you can create custom context menus for your plugin. You can choose between context menus for objects nodes or the background.
Before a menu of the requested type is shown, an update function for the specific type will be invoked by the core. You have to create a QAction. The signals and slots of your actions have to be connected to your plugin. Just connect them as usual. Only visibility of the menu is handled by the core. You can also add submenus to the context menus. Just add the action for the menu ( menu->menuAction() )

Definition at line 83 of file ContextMenuInterface.hh.


Member Function Documentation

virtual void ContextMenuInterface::addContextMenuItem ( QAction *  ,
DataType  ,
ContextMenuType   
) [inline, virtual, signal]

Add an entry for a context Menu.

Create an action (Can also be the action of a Menu) and register this action as a context menu entry to the core. This Action will only be visible if the picked object is of the given datatype. To support multiple object types with your menu, you can emit this signal multiple times with the same action but different DataTypes. You can add a whole Menu here by adding the action: menu->menuAction()

Parameters:
_action Pointer to the new action
_objectType Type of the picked object
_type Type of the context Menu ( See ContextMenuType )

Reimplemented in MouseAndKeyPlugin.

Definition at line 114 of file ContextMenuInterface.hh.

virtual void ContextMenuInterface::addContextMenuItem ( QAction *  ,
ContextMenuType   
) [inline, virtual, signal]

Add an entry for a context Menu.

Create an Action (Can also be the action of a Menu) and register this menu as a context menu to the core. This Action will be visible when you rightclick in the viewer widget on an item of the given context menu type. You can add a whole menu here by adding the action: menu->menuAction() of your own menu.

Parameters:
_menu Pointer to the new Action

Reimplemented in MouseAndKeyPlugin.

Definition at line 100 of file ContextMenuInterface.hh.

virtual void ContextMenuInterface::slotUpdateContextMenu ( int   )  [inline, private, virtual, slot]

When the main application requests a context menu, this slot is called before showing the window. If an object is picked the id will be given in this call so you can change the contents of your menu depending on the given object.

Parameters:
_objectId id of the object

Definition at line 123 of file ContextMenuInterface.hh.

virtual void ContextMenuInterface::slotUpdateContextMenuBackground (  )  [inline, private, virtual, slot]

When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating thatthe background has been picked. The id of the node is given as a parameter

Parameters:
_node id of the picked node

Definition at line 138 of file ContextMenuInterface.hh.

virtual void ContextMenuInterface::slotUpdateContextMenuNode ( int   )  [inline, private, virtual, slot]

When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating that a scenegraph node not belonging to an object has been picked. The id of the node is given as a parameter

Parameters:
_node id of the picked node

Definition at line 131 of file ContextMenuInterface.hh.


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

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .