Start dragging a row
8043
def _start_drag_row(self, event):
        """"""
        self._dragged_row = self.identify_row(event.y)  # identify dragged row
        bbox = self.bbox(self._dragged_row)
        self._dy = bbox[1] - event.y  # distance between cursor and row upper border
        self._dragged_row_y = bbox[1]  # y coordinate of dragged row upper border
        self._dragged_row_height = bbox[3]
        # configure dragged row preview
        self._visual_drag.configure(displaycolumns=self['displaycolumns'],
                                    height=1)
        for col in self['columns']:
            self._visual_drag.column(col, width=self.column(col, 'width'))
        if 'tree' in tuple(str(p) for p in self['show']):
            self._visual_drag.configure(show='tree')
        else:
            self._visual_drag.configure(show='')
        self._visual_drag.place(in_=self, x=0, y=bbox[1],
                                height=self._visual_drag.winfo_reqheight() + 2,
                                anchor='nw', relwidth=1)
        self._visual_drag.selection_add(self._dragged_row)
        self.selection_remove(self._dragged_row)
        self._visual_drag.update_idletasks()
        self._visual_drag.see(self._dragged_row)
        self._visual_drag.update_idletasks()
        self._visual_drag.xview_moveto(self.xview()[0])
1242974
function leftButtonStartDrag(cm,event,pos,behavior){var display=cm.display,moved=false;var dragEnd=operation(cm,function(e){if(webkit){display.scroller.draggable=false;}cm.state.draggingText=false;off(document,"mouseup",dragEnd);off(document,"mousemove",mouseMove);off(display.scroller,"dragstart",dragStart);off(display.scroller,"drop",dragEnd);if(!moved){e_preventDefault(e);if(!behavior.addNew){extendSelection(cm.doc,pos,null,null,behavior.extend);}// Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
if(webkit||ie&&ie_version==9){setTimeout(function(){document.body.focus();display.input.focus();},20);}else{display.input.focus();}}});var mouseMove=function mouseMove(e2){moved=moved||Math.abs(event.clientX-e2.clientX)+Math.abs(event.clientY-e2.clientY)>=10;};var dragStart=function dragStart(){return moved=true;};// Let the drag handler handle this.
if(webkit){display.scroller.draggable=true;}cm.state.draggingText=dragEnd;dragEnd.copy=!behavior.moveOnDrag;// IE's approach to draggable
if(display.scroller.dragDrop){display.scroller.dragDrop();}on(document,"mouseup",dragEnd);on(document,"mousemove",mouseMove);on(display.scroller,"dragstart",dragStart);on(display.scroller,"drop",dragEnd);delayBlurEvent(cm);setTimeout(function(){return display.input.focus();},20);}
335446
function(evt) {
    this._startPoint = evt.containerPoint.clone();
    this._dragStartPoint = evt.containerPoint.clone();
    this._matrix = [1, 0, 0, 1, 0, 0];

    this._path._map
      .on('mousemove', this._onDrag, this)
      .on('mouseup', this._onDragEnd, this)
    this._path._dragMoved = false;
  }
1270775
function (out, delegateId, cssClassPostfix, skinIcon, label, focusable) {
            // --------------------------------------------------- destructuring

            var cfg = this._cfg;
            var skinnableClass = this._skinnableClass;

            var waiAria = cfg.waiAria;

            // ------------------------------------------------------ processing

            // wrapper (opening) -----------------------------------------------

            var attributes = [];

            // Adding atdraggable="" to make sure clicking on the button does not start the drag operation
            // Using the atdraggable attribute directly instead of the aria.utils.Mouse.DRAGGABLE_ATTRIBUTE
            // variable because aria.utils.Mouse may not be loaded yet.
            attributes.push('atdraggable=""');

            attributes.push('class="' + [
                'x' + skinnableClass + '_' + cssClassPostfix,
                'x' + skinnableClass + '_' + cfg.sclass + '_' + cssClassPostfix
            ].join(' ') + '"');

            attributes.push(ariaUtilsDelegate.getMarkup(delegateId));

            var openingTagMarkup = '<span ' + attributes.join(' ') + '>';

            out.write(openingTagMarkup);

            // button ----------------------------------------------------------

            var iconConfiguration = {
                icon : this._skinObj[skinIcon],
                waiAria : waiAria
            };

            if (label) {
                iconConfiguration.tooltip = label;
                iconConfiguration.label = label;
            }

            if (label || focusable) {
                iconConfiguration.role = 'button';
            }

            if (focusable) {
                iconConfiguration.tabIndex = 0;
            }


            var button = new ariaWidgetsIcon(iconConfiguration, this._context, this._lineNumber);

            out.registerBehavior(button);

            button.writeMarkup(out);

            // wrapper (closing) -----------------------------------------------

            out.write('</span>');

            // ---------------------------------------------------------- return

            return button;
        }
57218
def setDragData(self, data, x=None, y=None):
        
        self._dragData[(x, y)] = data
1156603
function (e)
	{
		var that = this;
		var startingTd = this.dom.currentTarget;

		this.s.drag.dragging = true;

		that.dom.borderTop.style.display = "block";
		that.dom.borderRight.style.display = "block";
		that.dom.borderBottom.style.display = "block";
		that.dom.borderLeft.style.display = "block";

		var coords = this._fnTargetCoords( startingTd );
		this.s.drag.startX = coords.x;
		this.s.drag.startY = coords.y;

		this.s.drag.startTd = startingTd;
		this.s.drag.endTd = startingTd;

		this._fnUpdateBorder( startingTd, startingTd );

		$(document).bind('mousemove.AutoFill', function (e) {
			that._fnFillerDragMove.call( that, e );
		} );

		$(document).bind('mouseup.AutoFill', function (e) {
			that._fnFillerFinish.call( that, e );
		} );

		/* Scrolling information cache */
		this.s.screen.y = e.pageY;
		this.s.screen.height = $(window).height();
		this.s.screen.scrollTop = $(document).scrollTop();

		if ( this.s.dt.oScroll.sY !== "" )
		{
			this.s.scroller.top = $(this.s.dt.nTable.parentNode).offset().top;
			this.s.scroller.bottom = this.s.scroller.top + $(this.s.dt.nTable.parentNode).height();
		}

		/* Scrolling handler - we set an interval (which is cancelled on mouse up) which will fire
		 * regularly and see if we need to do any scrolling
		 */
		this.s.screen.interval = setInterval( function () {
			var iScrollTop = $(document).scrollTop();
			var iScrollDelta = iScrollTop - that.s.screen.scrollTop;
			that.s.screen.y += iScrollDelta;

			if ( that.s.screen.height - that.s.screen.y + iScrollTop < 50 )
			{
				$('html, body').animate( {
					"scrollTop": iScrollTop + 50
				}, 240, 'linear' );
			}
			else if ( that.s.screen.y - iScrollTop < 50 )
			{
				$('html, body').animate( {
					"scrollTop": iScrollTop - 50
				}, 240, 'linear' );
			}

			if ( that.s.dt.oScroll.sY !== "" )
			{
				if ( that.s.screen.y > that.s.scroller.bottom - 50 )
				{
					$(that.s.dt.nTable.parentNode).animate( {
						"scrollTop": $(that.s.dt.nTable.parentNode).scrollTop() + 50
					}, 240, 'linear' );
				}
				else if ( that.s.screen.y < that.s.scroller.top + 50 )
				{
					$(that.s.dt.nTable.parentNode).animate( {
						"scrollTop": $(that.s.dt.nTable.parentNode).scrollTop() - 50
					}, 240, 'linear' );
				}
			}
		}, 250 );
	}
974833
def startDrag( self, supportedActions ):
        
        if ( not self.useDragPixmaps() ):
            return super(XTreeWidget, self).startDrag(supportedActions)
        
        filt  = lambda x: x.flags() & QtCore.Qt.ItemIsDragEnabled
        items = filter(filt, self.selectedItems())
        if ( not items ):
            return
        
        data = self.mimeData(items)
        if ( not data ):
            return
        
        if ( len(items) > 1 ):
            pixmap = self.dragMultiPixmap()
        else:
            pixmap = self.dragSinglePixmap()
        
        # create the drag event
        drag = QtGui.QDrag(self)
        drag.setMimeData(data)
        drag.setPixmap(pixmap)
        
        drag.exec_(supportedActions, QtCore.Qt.MoveAction)
849863
function dragStart(_dragElement, ev, ui) {
		hoverListener.start(function(cell) {
			clearOverlays();
			if (cell) {
				renderCellOverlay(cell.row, cell.col, cell.row, cell.col);
			}
		}, ev);
	}
98472
function dragHandler(event) {
            dragging.released = event.type === 'mouseup' || event.type === 'touchend';
            dragging.path     = within(
                (dragging.touch ? event.originalEvent[dragging.released ? 'changedTouches' : 'touches'][0] : event)[o.horizontal ? 'pageX' : 'pageY'] - dragging.initLoc,
                dragging.pathMin, dragging.pathMax
            );

            // Initialization
            if (!dragging.init && (Math.abs(dragging.path) > (dragging.touch ? 50 : 10) || dragging.source === 'handle')) {
                dragging.init = 1;
                if (dragging.source === 'slidee') {
                    ignoreNextClick = 1;
                }

                // Pause ongoing cycle
                self.pause(1);

                // Disable click actions on source element, as they are unwelcome when dragging
                dragging.$source.on('click', function disableAction(event) {
                    stopDefault(event, 1);
                    if (dragging.source === 'slidee') {
                        ignoreNextClick = 0;
                    }
                    dragging.$source.off('click', disableAction);
                });

                // Trigger moveStart event
                trigger('moveStart');
            }

            // Proceed when initialized
            if (dragging.init) {
                stopDefault(event);

                // Adjust path with a swing on mouse release
                if (dragging.released && dragging.source === 'slidee' && o.speed > 33) {
                    dragging.path += dragging.path * 200 / (+new Date() - dragging.start);
                }

                slideTo(dragging.source === 'slidee' ? Math.round(dragging.initPos - dragging.path) : handleToSlidee(dragging.initPos + dragging.path));
            }

            // Cleanup and trigger :moveEnd event on release
            if (dragging.released) {
                $doc.off(dragging.touch ? dragTouchEvents : dragMouseEvents, dragHandler);
                (dragging.source === 'slidee' ? $slidee : $handle).removeClass(o.draggedClass);

                // Account for item snapping position adjustment.
                if (pos.cur === pos.dest) {
                    trigger('moveEnd');
                }
            }
        }
1099350
function(x, y) {
            if (this.dragCurrent && this.dragCurrent.useShim) {
                this._shimState = this.useShim;
                this.useShim = true;
            }
            this._activateShim();
            YAHOO.log("firing drag start events", "info", "DragDropMgr");
            clearTimeout(this.clickTimeout);
            var dc = this.dragCurrent;
            if (dc && dc.events.b4StartDrag) {
                dc.b4StartDrag(x, y);
                dc.fireEvent('b4StartDragEvent', { x: x, y: y });
            }
            if (dc && dc.events.startDrag) {
                dc.startDrag(x, y);
                dc.fireEvent('startDragEvent', { x: x, y: y });
            }
            this.dragThreshMet = true;
        }
624959
private void stopDragging() {
		if (dragging) {
			dragging = false;
			getContainer().remove(circle);
			getContainer().remove(line);
		}
	}
878250
function() {
        var control = this;
        this.dragControl = new OpenLayers.Control.DragFeature(this.layer, {
            documentDrag: true,
            // avoid moving the feature itself - move the box instead
            moveFeature: function(pixel) {
                if(this.feature === control.feature) {
                    this.feature = control.box;
                }
                OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,
                    arguments);
            },
            // transform while dragging
            onDrag: function(feature, pixel) {
                if(feature === control.box) {
                    control.transformFeature({center: control.center});
                }
            },
            // set a new feature
            onStart: function(feature, pixel) {
                var eligible = !control.geometryTypes ||
                    OpenLayers.Util.indexOf(control.geometryTypes,
                        feature.geometry.CLASS_NAME) !== -1;
                var i = OpenLayers.Util.indexOf(control.handles, feature);
                i += OpenLayers.Util.indexOf(control.rotationHandles,
                    feature);
                if(feature !== control.feature && feature !== control.box &&
                                                        i == -2 && eligible) {
                    control.setFeature(feature);
                }
            },
            onComplete: function(feature, pixel) {
                control.events.triggerEvent("transformcomplete",
                    {feature: control.feature});
            }
        });
    }
408757
def dragMoveEvent(self, event):
        """"""
        super(AbstractDragView, self).dragMoveEvent(event)
        if event.mimeData().hasFormat("application/x-protocol"):
            # find the nearest break to cursor
            self.dragline = self.cursor(event.pos())
            self.viewport().update()
            event.setDropAction(QtCore.Qt.MoveAction)
            event.accept()
        else:
            event.ignore()
230582
def dragMoveEvent(self, event):
        """"""
        if (event.mimeData().hasFormat("text/plain")):
            event.setDropAction(Qt.MoveAction)
            event.accept()
        else:
            event.ignore()
1309698
function(){
                // check for related events
                if ( $.data( this, drag.datakey ) )
                    return;
                // initialize the drag data with copied defaults
                var data = $.extend({ related:0 }, drag.defaults );
                // store the interaction data
                $.data( this, drag.datakey, data );
                // bind the mousedown event, which starts drag interactions
                $event.add( this, "touchstart mousedown", drag.init, data );
                // prevent image dragging in IE...
                if ( this.attachEvent )
                    this.attachEvent("ondragstart", drag.dontstart );
            }
799406
def startDrag(self, dragData):
        
        # create the mime data
        mimeData = QMimeData()
        for key, value in dragData.items():
            mimeData.setData('application/x-%s' % key, wrapVariant(value))
        
        # create the drag instance
        drag = QDrag(self.scene().chart())
        drag.setMimeData(mimeData)
        drag.exec_()
1071002
protected void beginDragging(MouseDownEvent event) {

        m_dragging = true;
        m_windowWidth = Window.getClientWidth();
        m_clientLeft = Document.get().getBodyOffsetLeft();
        m_clientTop = Document.get().getBodyOffsetTop();
        DOM.setCapture(getElement());
        m_dragStartX = event.getX();
        m_dragStartY = event.getY();
        addStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().dragging());
    }