简体   繁体   English

如何在 Delphi 的 IDE 上下文菜单中添加菜单项

[英]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.我正在尝试向 Delphi 的 IDE 添加一些功能以简化自己。 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.我已经找到了如何使用 INTAServices.MainMenu 将菜单项添加到 IDE 主菜单,还能够创建一些自定义组件编辑器,因此我可以在组件的上下文菜单中拥有自己的菜单项。 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);我想在源代码编辑器中选择一些文本并右键单击它,这样我就可以按照我需要的方式转换它,使用 IOTAEditorServices.TopView.buffer.EditBlock.text 和 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'));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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