################################################################################
# Name : basePlugin
# Author : C.Dutoit - dutoitc@hotmail.com - http://www.dutoitc.fr.st
# Goal : the base for all plugins
# Date : September 2001
################################################################################
from wxPython.wx import *
from gPluginsDialogs import *
from utils import assignID
pluginID="basePlugin"
[ID_MENU_ABOUT]=assignID(1)
#>--------------------------------------------------------------------------
class GiminiPlugin:
"A gimini plugin"
def __init__(self, wxParent, pluginsAPI):
"Plugin initialisation"
#>--------------------------------------------------------------------------
def getNodeData(self):
"Get a node data for this plugin"
return NodeData()
class Mindmap_NodeDatas:
"Standard node data"
#>----------------------------------------------------------------------
def __init__(self):
self._fontSize=8 # Default font size
pass
#>----------------------------------------------------------------------
def setFontSize(self, fontSize):
self._fontSize=fontSize
#>----------------------------------------------------------------------
def getFontSize(self):
return self._fontSize
#>----------------------------------------------------------------------
def saveToString(self):
"Save the node data to a string"
return "Empty_Node"
#>----------------------------------------------------------------------
def loadFromString(self, txt):
"Load the node data from a string"
pass
#>----------------------------------------------------------------------
def saveToList(self):
"Save the datas to a list"
return [""]
#>----------------------------------------------------------------------
def loadFromList(self, text):
"Load the node data from a list"
print "Error : can't load node from list !"
#>----------------------------------------------------------------------
def getSmallName(self):
"Get a small name wich will represent the node"
return "Empty_Node"
#>----------------------------------------------------------------------
def getNodeSize(self, dc):
"Get the node size"
return (0, 0)
#>----------------------------------------------------------------------
def getNodeRootSize(self, dc):
"Get the node size when drawed as root"
return (0, 0)
#>----------------------------------------------------------------------
def getRootLatexCode(self, dc, x, y):
"Return the LaTeX code of the root, drawed as root"
return ""
#>----------------------------------------------------------------------
def getLatexCode(self, dc, x, y):
"Return the node LaTeX code"
return ""
#>----------------------------------------------------------------------
def drawRootNode(self, dc, x, y):
"Draw as root node"
pass
#>----------------------------------------------------------------------
def drawNodeDatas(self, dc, x, y):
"Draw the node data; org is bottom-left"
pass
#>----------------------------------------------------------------------
def getNodeEditionPanel(self, parent):
"""Return a canvas to integrate to the node edition dialog box wich
will permit to edit the node datas"""
return nodeEditionPanel(parent)
#>------------------------------------------------------------------
def getPluginID(self):
"Return the plugin ID"
return pluginID
#>------------------------------------------------------------------
def saveToXML(self):
"Save the datas to xml"
from xml.dom.minidom import Element
return Element("Data")
#>------------------------------------------------------------------
def loadFromXML(self, xml):
"Load the datas from xml"
pass
#>------------------------------------------------------------------
# def onDblClick(self):
# "Handle double-click"
# pass
#>----------------------------------------------------------------------
class nodeEditionPanel(wxPanel):
"Panel to edit node datas"
#>------------------------------------------------------------------
def __init__(self, parent):
wxPanel.__init__(self, parent, -1)
#>------------------------------------------------------------------
def saveDatas(self):
pass
|