def OnComponentCreate(self, evt): '''Hadnler for creating new elements.''' comp = Manager.findById(evt.GetId()) g.undoMan.RegisterUndo(undo.UndoGlobal()) # !!! TODO if comp.groups[0] == 'component': node = Model.createComponentNode('Component') Presenter.create(comp, node) else: Presenter.create(comp)
def OnComponentCreate(self, evt): '''Hadnler for creating new elements.''' state = self.tree.GetFullState() # state just before comp = Manager.findById(evt.GetId()) if comp.groups[0] == 'component': node = Model.createComponentNode('Component') item = Presenter.create(comp, node) else: item = Presenter.create(comp) itemIndex = self.tree.ItemFullIndex(item) g.undoMan.RegisterUndo(undo.UndoPasteCreate(itemIndex, state))