简体   繁体   中英

How to add a menu item in Delphi's IDE context menu

I am trying to add some functionality to Delphi's IDE to easy myself. I have found how to add menu items to the IDE main menu using INTAServices.MainMenu, also was able to create some custom component editors, so I can have my own menu items in the component's context menu. But I want to add some functionality in the context menu of the source editor. I want to select some text in the source editor and right click on it, so I can transform it the way I need, using IOTAEditorServices.TopView.buffer.EditBlock.text and IOTAEditorServices.TopView.Buffer.EditPosition.InsertText(newText); Is this possible? Or easiest way is to use a shortcut to a main menu item?

Thanks.

实际上是一行代码: myPopup := TPopupMenu(editorServices.TopView.GetEditWindow.Form.FindComponent('EditorLocalMenu'));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM