Context Menu API
Where are context menus needed?
The following lists show widgets that could have a context menu.
Preferred widgets
Name |
Context |
Options |
|---|---|---|
Output |
|
|
Navigation Tree |
Hovered item |
|
3D View |
|
|
Graphics View |
|
* would be a good feature to add
** A new Visualization Mode flag (or similar) would allow disabling visualization for calculation / data intensive requests on entity selection.
Unclear
Name |
Context |
Options |
|---|---|---|
Property Grid? |
|
|
Tool Bar Buttons? |
||
Text Editor? |
Example: |
|
Table? |
||
Plot |
Question: |
|
Version Graph |
Examples: |
Note:
It might be a useful feature to explicitly create a new branch in order to avoid misclicking in the “delete all other data in branch irreversibly :D” dialog.
Context Menu Roundtrip
The figure below shows all relevant classes involved in displaying a context menu for a widget and reacting to its button press.
There are five main steps:
Widget raises event and the wrapper class creates the corresponding 1:
ContextRequestWidgetEvent (CRWE)instance.CRWEcreatesContextRequestDataand sets it to the 2:ContextMenuRequestEvent (CMRE).Event is dispatched to the callback service (e.g. Model) which then returns a 3:
MenuCfgconfiguration.Configuration (3) is used to create and display the 4:
ContextMenu.User selected action is used to perform default action or send owner notification via the
ContextMenuCallbackBase (CMCB).