Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Signals | Public Member Functions | Private Slots | Private Member Functions | List of all members
ContextMenuInterface Class Reference

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

`#include <OpenFlipper/BasePlugin/ContextMenuInterface.hh>`

Inheritance diagram for ContextMenuInterface:

## Signals
virtual void | addContextMenuItem (QAction *_action, ContextMenuType _type)
| Add an entry for a context Menu. More...

## Public Member Functions
virtual | ~ContextMenuInterface ()
| Destructor.
virtual void | addContextMenuItem (QAction *_action, DataType _objectType, ContextMenuType _type)
| Add an entry for a context Menu. More...
virtual void | hideContextMenu ()
| hide the main context menu

## Private Slots
virtual void | slotUpdateContextMenu (int _objectId)

## Private Member Functions
virtual void | slotUpdateContextMenuNode (int _nodeId)
virtual void | slotUpdateContextMenuBackground ()

## Detailed Description

Interface class for creating custom context menus.

Detailed description
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 101 of file ContextMenuInterface.hh.

## Member Function Documentation

virtual void ContextMenuInterface::addContextMenuItem | ( | QAction * | _action,
|  | ContextMenuType | _type
| ) |  |
| 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 right click 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

  _action | Pointer to the new Action
  _type | Type context menu type

Definition at line 120 of file ContextMenuInterface.hh.

virtual void ContextMenuInterface::addContextMenuItem | ( | QAction * | _action,
|  | DataType | _objectType,
|  | ContextMenuType | _type
| ) |  |
| inline virtual

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 )

Definition at line 134 of file ContextMenuInterface.hh.

virtual void ContextMenuInterface::slotUpdateContextMenu | ( | int | _objectId | ) |
| 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

Reimplemented in TypeBSplineCurvePlugin, TypeBSplineSurfacePlugin, and TypeSkeletonPlugin.

Definition at line 147 of file ContextMenuInterface.hh.

virtual void ContextMenuInterface::slotUpdateContextMenuBackground | ( |  | ) |
| inline private virtual

When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating that the background has been picked.

Definition at line 161 of file ContextMenuInterface.hh.

virtual void ContextMenuInterface::slotUpdateContextMenuNode | ( | int | _nodeId | ) |
| inline private virtual

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.

Parameters

  _nodeId | id of the picked node

Definition at line 155 of file ContextMenuInterface.hh.

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

- OpenFlipper/BasePlugin/ContextMenuInterface.hh