摘要: 1. 添加右鍵彈出菜單
我們?cè)谶@里,將會(huì)在插件中加入右鍵彈出菜單功能。也就是如下圖那樣,在文檔區(qū)內(nèi),點(diǎn)擊鼠標(biāo)右鍵時(shí)會(huì)彈出的菜單。我們將在這個(gè)菜單中加入屬于我們插件的菜單項(xiàng)目”testplug”。
加入菜單項(xiàng)目的效果如下圖:
讓我們看看,咱們創(chuàng)建的插件工程中,給我們提供了什么樣的入口代碼了吧。
1. 在函數(shù)BuildModuleMenu中添加菜單項(xiàng)。
在文檔的視圖里才加入菜單項(xiàng)的入口函數(shù)是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
閱讀全文