Exemple #1
0
 def onDragOver(self, event):
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     dt = event.dataTransfer
     dt.dropEffect = 'copy'
     class_names = t.getStyleName()
     if class_names is not None:
         if 'drophere' in class_names:
             DOM.eventPreventDefault(event)
Exemple #2
0
 def onDragOver(self, event):
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     dt = event.dataTransfer
     dt.dropEffect = 'copy'
     class_names = t.getStyleName()
     if class_names is not None:
         if 'drophere' in class_names:
             DOM.eventPreventDefault(event)
Exemple #3
0
 def onDragLeave(self, event):
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     try:
         class_names = t.getStyleName()
     except:
         class_names = None
     if class_names is not None:
         if 'drophere' in class_names:
             t.removeStyleName('dragover')
Exemple #4
0
 def onDragLeave(self, event):
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     try:
         class_names = t.getStyleName()
     except:
         class_names = None
     if class_names is not None:
         if 'drophere' in class_names:
             t.removeStyleName('dragover')
Exemple #5
0
 def onDragOver(self, event):
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     class_names = t.getStyleName()
     if class_names is not None:
         if 'drophere' in class_names:
             dt = event.dataTransfer
             id = Widget(Element=target).getID()
             drop_effect = self.data[int(id[-1])]
             dt.dropEffect = drop_effect
             DOM.eventPreventDefault(event)
Exemple #6
0
 def onDragEnter(self, event):
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     try:
         class_names = t.getStyleName()
     except:
         class_names = None
     if class_names is not None:
         if 'drophere' in class_names:
             t.addStyleName('dragover')
             DOM.eventPreventDefault(event)
Exemple #7
0
 def onDrop(self, event):
     dt = event.dataTransfer
     text = dt.getData('Text')
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     class_names = t.getStyleName()
     DOM.eventPreventDefault(event)
     if class_names is not None:
         if 'drophere' in class_names:
             self.addMessage('%s onto %s' % (text, target.id))
             return
Exemple #8
0
 def onDrop(self, event):
     dt = event.dataTransfer
     text = dt.getData('Text')
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     class_names = t.getStyleName()
     if class_names is not None:
         if 'drophere' in class_names:
             self.addMessage('%s onto %s<br>effectAllowed=%s, dropEffect=%s'
             % (text, target.id, dt.effectAllowed, dt.dropEffect))
             DOM.eventPreventDefault(event)
Exemple #9
0
 def onDragOver(self, event):
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     class_names = t.getStyleName()
     if class_names is not None:
         if 'drophere' in class_names:
             dt = event.dataTransfer
             id = Widget(Element=target).getID()
             drop_effect = self.data[int(id[-1])]
             dt.dropEffect = drop_effect
             DOM.eventPreventDefault(event)
Exemple #10
0
 def onDragEnter(self, event):
     target = DOM.eventGetTarget(event)
     t = Widget(Element=target)
     try:
         class_names = t.getStyleName()
     except:
         class_names = None
     if class_names is not None:
         if 'drophere' in class_names:
             t.addStyleName('dragover')
             DOM.eventPreventDefault(event)