コード例 #1
0
    def __init__(self, parent, ID, uri):
        EditorInterface.__init__(self, parent, False, uri)
        ElementMap.__init__(self, parent, ID)

        self._controller = Controller()
        self._logger     = self._controller.getLogger()
        self._model      = Model()
        self._circtree   = ComponentManager().getComponent("circuit").getCircuitTree()
        self._importer   = edef.Importer()
        self._mainframe  = self._controller.getMainFrame()
        
        self.setTitle(uri)
       
        if not uri == "circ://":
            self._loadCircuit(uri)
            self.redraw()
            self.setModified(False)

        self._target = CircuitDropTarget(self)
        self.SetDropTarget( self._target )
コード例 #2
0
    def __init__(self, parent, ID, uri):
        ScrolledPanel.__init__(self, parent, ID)
        eDevEditorInterface.__init__(self, parent, False, uri)

        self._controller = Controller()
        self._model      = Model()
        self._mainframe  = self._controller.getMainFrame()
        self._component_manager = ComponentManager()
        self._moduletree = self._component_manager.getComponent("modeditor").getModuleTree()
        self._notebook   = self._controller.getNotebook()


        if uri == "mod://":
            txt = '<?xml version="1.0"?><Module version="1.0"/>'
            title = "unsaved"
        else:
            txt = self._model.openURI(uri)
            title = getModuleName(uri)
        self.setTitle(title)
        
        self._d_doc = xml.dom.minidom.parseString(txt)

        vert_box = wx.BoxSizer(wx.VERTICAL)
        self._d_basic_data = eDevModuleEditorBasic(self, -1, self._d_doc)
        self._d_require = eDevModuleEditorRequire(self, -1, self._d_doc)
        self._d_provide = eDevModuleEditorProvide(self, -1, self._d_doc)

        self.Bind(Events.EVT_MODIFIED, self.OnModified, self._d_basic_data)
        self.Bind(Events.EVT_MODIFIED, self.OnModified, self._d_require)
        self.Bind(Events.EVT_MODIFIED, self.OnModified, self._d_provide)

        vert_box.Add(self._d_basic_data, 0, wx.EXPAND|wx.ALL, 15)
        vert_box.Add(self._d_require, 0, wx.EXPAND|wx.ALL, 15)
        vert_box.Add(self._d_provide, 0, wx.EXPAND|wx.ALL, 15)

        self.SetSizer(vert_box)
        self.SetAutoLayout(1)
        self.SetupScrolling()