摘要: 1. 添加右鍵彈出菜單
我們在這里,將會在插件中加入右鍵彈出菜單功能。也就是如下圖那樣,在文檔區內,點擊鼠標右鍵時會彈出的菜單。我們將在這個菜單中加入屬于我們插件的菜單項目”testplug”。
加入菜單項目的效果如下圖:
讓我們看看,咱們創建的插件工程中,給我們提供了什么樣的入口代碼了吧。
1. 在函數BuildModuleMenu中添加菜單項。
在文檔的視圖里才加入菜單項的入口函數是BuildModuleMenu,它的初始代碼是下面那樣:
void testplug::BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data)
{
//Some library module is ready to display a pop-up menu.
//Check the parameter \"type\" and see which module it is
閱讀全文