Esempio n. 1
0
    def mouseRelease(self, actor, event):
        if self.itemDragging:
            element = Element(type(self.pendingActor))

            # Copy pendingActor's properties to the element
            element.loadProperties(self.pendingActor)

            self.model.addElement(element, self.elements.keys()[self.elements.values().index(self.parentActor)])
            # Override and set the currently created actor as the proxy
            self.elements[element] = self.pendingActor
        elif self.selectionBox:
            # Process selection
            selectionBox = self.selectionBox
            self.selectionBox.fadeOut(lambda x: 
                                      self.overlayLayer.remove_child(selectionBox))
        self.resetDrag()