#NEWLINE# def onDrop( self , event ) : #NEWLINE# #INDENT# dt = event . dataTransfer #NEWLINE# text = dt . getData ( 'text' ) #NEWLINE# package = json . decode ( text ) #NEWLINE# x = DOM . eventGetClientX ( event ) #NEWLINE# y = DOM . eventGetClientY ( event ) #NEWLINE# scrollY = Window . getScrollTop ( ) #NEWLINE# scrollX = Window . getScrollLeft ( ) #NEWLINE# offsetX = int ( package [ 'offsetX' ] ) #NEWLINE# offsetY = int ( package [ 'offsetY' ] ) #NEWLINE# at = self . getAbsoluteTop ( ) #NEWLINE# al = self . getAbsoluteLeft ( ) #NEWLINE# ( posX , posY ) = ( ( x - ( al - scrollX ) ) , ( y - ( at - scrollY ) ) ) #NEWLINE# w = DragWidget6 ( package [ 'text' ] ) #NEWLINE# self . add ( w ) #NEWLINE# makeDraggable ( w ) #NEWLINE# w . setStyleAttribute ( 'left' , ( posX - offsetX ) ) #NEWLINE# w . setStyleAttribute ( 'top' , ( posY - offsetY ) ) #NEWLINE# w . removeStyleName ( 'invisible' ) #NEWLINE# self . addMessage ( ( 'top:%s, left:%s, cy:%s cx:%s, sy:%s sx:%s dropy:%s dropx:%s' % ( at , al , y , x , scrollY , scrollX , posY , posX ) ) ) #NEWLINE# DOM . eventPreventDefault ( event )