The markingMenuDisplaying event fires just before the marking menu and context menus are displayed. The marking menu is the round menu displayed when the user right-clicks the mouse within Fusion. The context menu is the vertical menu displayed. The event provides both the marking menu and the context menu so you can examine and edit the contents of either one or both of them before they are displayed. Fusion will then display the marking and context menu that you've customized. If either one is empty it will not be displayed.
-------- Import ---------
-------- Global variables ---------
-------- Connect the handler to the event. ---------
-------- Event handler function definition ---------
|
-------- Global variables ---------
-------- Connect the handler to the event. ---------
-------- Event handler class definition ---------
|
--------- Required include files. ---------
--------- Event handler class definition and global declaration. ---------
class MyMarkingMenuDisplayingEventHandler : public adsk::core::MarkingMenuEventHandler { public: void notify(const Ptr<MarkingMenuEventArgs>& eventArgs) override { // Code to react to the event. ui->messageBox("In MyMarkingMenuDisplayingEventHandler event handler."); } } _markingMenuDisplaying; --------- Connect the handler to the event. ---------
|
Name | Description |
Marking Menu API Sample | Demonstrates how to customize marking menu and context menu. This sample is an add-in. To use it, create a new add-in using the "Scrips and Add-Ins" command. Use any name you would like for the add-in. In the folder where the add-in was created edit the add-in name.py file and replace it's entire contents with the sample code below. You can also delete all the other files that were created for the add-in except for add-in name.manifiest. Start the add-in from the "Scripts and Add-Ins" dialog. Now, with the add-in running, whenever you right-click in the Fusion window, you'll get an entirely customized context menu. The default marking menu has been modified by the add-in by removing the existing commands and adding some custom commands. |