Hardly trivial IMHO.
I wouldn't even know where to look for the PopupMenu for the SourceEditor in the first place.
Try Ctrl-clicking in the IDE code, and most of the time you end up in some abstract method (because it is passed as a parameter with the type of some base class, en God only knows what the actual class is (@desing time that is)).
Without familiarity with the insides of the IDE, you'll spend lot's of time.
(Once you found it, the solution may be trivial.)
"trivial" is not equal to "not time consuming"
About the finding the real class. Depending on the name of a function, you can search in files, and find all declared methods of that name. Or you can run the IDE in the debugger. (open ide/lazarus.lpi and press F9)
About the popup:
Simple start (incremental searching) for "popup in SourceEditor. It gets you to lin 243
FPopUpMenu: TPopupMenu;
FMouseActionPopUpMenu: TPopupMenu;
For the difference, look at the mouse options, in he ide option dialog, and find that you can open more than one context menu, by assigning stuff to shift-right mouse etc....
Or ask. Assuming you did: It is "FPopUpMenu" you want to look at.
Search for other occurrences of those.
You should find
procedure TSourceEditor.SetPopupMenu(NewPopupMenu: TPopupMenu);
begin
if NewPopupMenu<>FPopupMenu then begin
FPopupMenu:=NewPopupMenu;
Setter of a property. Search for write access to that property "PopupMenu := "
and find:
PopupMenu := TabPopupMenu;
AnEditor.PopupMenu := SrcPopupMenu;
Now it is a bit of a random search for the to, you will find the first is for click on a tab, the 2nd for click on the editor text.
You can search that, and you will find where it is created and items are assigned.
I needed to search them myself too. I don't remember all of them.
And as a side effect, you may discover existing IDE functionality that you didnt know.
---------
There are alternative ways:
You know that for example there is a section about bookmarks, so you can search that.
Or you search in files for the English resource string, of an item in the menu, then search that identifier, and work your way back...
---
Since I did the search, here is the final result:
procedure SrcPopUpMenuPopup(Sender: TObject);
took me 5 minutes, but If I had been new to it, I admit, it may have taken 30 to 60 minutes to find. Depending on which route I had taken
--EDIT
Even searching for clipboard would have gotten you there
{%region *** Clipboard section ***}
// Clipboard section: