def __init__(self): QtGui.QLabel.__init__(self, "Drop here .................................................") add_drop_callback(self, 'openalea/interface.IImage', self.drop) add_drop_callback(self, 'openalea/interface.IPath', self.drop) add_drop_callback(self, 'openalealab/control', self.drop) add_drop_callback(self, 'custom/data', self.drop) add_drop_callback(self, 'text/plain', self.drop)
def __init__(self): QtGui.QLabel.__init__( self, "Drop here .................................................") add_drop_callback(self, 'openalea/interface.IImage', self.drop) add_drop_callback(self, 'openalea/interface.IPath', self.drop) add_drop_callback(self, 'openalealab/control', self.drop) add_drop_callback(self, 'custom/data', self.drop) add_drop_callback(self, 'text/plain', self.drop)
def __init__(self): AbstractListener.__init__(self) super(WorldBrowser, self).__init__() self.world = None QtCore.QObject.connect(self.tree, QtCore.SIGNAL("doubleClicked(const QModelIndex&)"), self.show_world_object) actionClearWorld = QtGui.QAction(QtGui.QIcon(":/images/resources/plant.png"), "Clear World", self) actionClearWorld.triggered.connect(self.clear) self._actions = [["Project", "World", actionClearWorld, 0]] add_drop_callback(self, "openalea/interface.IImage", self.drop_object)
def __init__(self): AbstractListener.__init__(self) super(WorldBrowser, self).__init__() self.world = None QtCore.QObject.connect(self.tree, QtCore.SIGNAL('doubleClicked(const QModelIndex&)'), self.show_world_object) actionClearWorld = QtGui.QAction(QtGui.QIcon(":/images/resources/plant.png"), "Clear World", self) actionClearWorld.triggered.connect(self.clear) self._actions = [["Project", "World", actionClearWorld, 0]] add_drop_callback(self, 'openalea/interface.IImage', self.drop_object)
def _default_editor(self): try: from openalea.oalab.editor.pyeditor import PyCodeEditor as Editor editor = Editor(parent=self.parent) except ImportError: from openalea.oalab.editor.text_editor import RichTextEditor as Editor from openalea.oalab.editor.highlight import Highlighter editor = Editor(parent=self.parent) Highlighter(editor.editor) from openalea.oalab.service.drag_and_drop import add_drop_callback def drop_text(text, **kwds): cursor = kwds.get('cursor') cursor.insertText(text) add_drop_callback(editor, 'openalea/code.oalab', drop_text) add_drop_callback(editor, 'openalea/identifier', drop_text) add_drop_callback(editor, 'text/plain', drop_text) return editor