cjprecord / editra-plugins

Automatically exported from code.google.com/p/editra-plugins
0 stars 0 forks source link

Request for an API for the CodeBrowser-plugin #168

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What Plugin does this relate to? What version of the Plugin?
CodeBrowser, version 0.5.

I`d like to see an API for the CodeBrowser Plugin so that we can add more menu 
entries to the context menu, other than "Go to ...". 

What version of Editra are you using? On what operating system?
Editra 0.6.26 on Ubuntu 10.10 ( from source ) and Windows 7 ( binary ).

Please provide any additional information below.

Original issue reported on code.google.com by thomas.w...@gmail.com on 8 Apr 2011 at 5:31

GoogleCodeExporter commented 9 years ago
Version 1.3 of the plugin will include a right click menu callback interface:

Example usage:
import ed_msg

def myMenuCallback(menu_id, cb_data):
    # Callback method for custom menu item
    print "do stuff"

ID_DOFOO = wx.NewId()
def OnCodeBrowserRightClick(self, msg):
    # ed_msg handler hook for codebrowser right click menu
    data = msg.GetData() # Data is instance of ebmlib.ContextMenuManager
    data.Menu.Append(ID_DOFOO, "My Menu Item")
    data.AddHandler(ID_DOFOO, myMenuCallback)

ed_msg.Subscribe(("CodeBrowser","ContextMenu"), OnCodeBrowserRightClick)

Original comment by CodyPrec...@gmail.com on 13 May 2011 at 10:52