Who or what inserts the Unicode, right-to-left and IME items at the foot of the default right-click popup menu in Delphi 2010 VCL applications? I would like to remove them for user environments where they are unlikely ever to be needed, without having to define a custom pop-up menu for every edit and memo. Most of the time only copy, cut, paste and select all are appropriate.
+7
A:
The OS inserts them. The entire menu is generated by the underlying Windows control, not by Delphi.
To have a different menu, provide your own TPopupMenu
component, set the control's PopupMenu
property, and provide whatever menu items you want.
Rob Kennedy
2009-11-06 14:46:23
Yes, I assumed that it might be Windows. But over several dozen forms, some with 100 or more controls, only about 10% of which already have a custom PopupMenu, your suggestion is precisely what I am trying to avoid.
frogb
2009-11-06 16:27:25
.... but I will accept your answer because I have now written a unit which I can call from CreateForm which will apply a default PopupMenu to all controls that need one and do not already have a custom one, and which provides handlers for the necessary actions.
frogb
2009-11-06 17:56:42
Regarding the "necessary actions," are you aware of the "standard actions"? You shouldn't need to write any code at all for the menu handlers. Just use TEditUndo, TEditCut, TEditCopy, etc. http://docwiki.embarcadero.com/VCL/en/StdActns
Rob Kennedy
2009-11-06 18:27:13