Contextual Menus in Scintilla
The ScintillaControlMBS control in MBS Xojo Plugins comes with a standard contextual menu and you may not have any need to change it. Here you see screenshots from Mac and Windows:
But you can replace it with a custom menu. First you need to toggle off the default menu with calling UsePopup method:
Then you implement ConstructContextualMenu event in Xojo:
As you see we just add 3 dumy menu entries. Yours should have some tag values so you can later do a SELECT CASE on it to run right method.
When user selects an entry, the ContextualMenuAction event runs:
If you use newer Desktop controls with DesktopScintillaControlMBS control, the MenuItem parameter will use DesktopMenuItem class. And the ContextualMenuAction event gets a SelectedItem as DesktopMenuItem.