private void panel1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { screenOffset = SystemInformation.WorkingArea.Location; ListBox lb = sender as ListBox; if (lb != null) { Form f = lb.FindForm(); // Cancel the drag if the mouse moves off the form. The screenOffset // takes into account any desktop bands that may be at the top or left // side of the screen. if (((Control.MousePosition.X - screenOffset.X) < f.DesktopBounds.Left) || ((Control.MousePosition.X - screenOffset.X) > f.DesktopBounds.Right) || ((Control.MousePosition.Y - screenOffset.Y) < f.DesktopBounds.Top) || ((Control.MousePosition.Y - screenOffset.Y) > f.DesktopBounds.Bottom)) { e.Action = DragAction.Cancel; } } eventCount = eventCount + 1; // increment event counter }
private void shellListView_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { //e.Action = DragAction.Continue; /*var info = shellListView.HitTest(shellListView.PointToClient(System.Windows.Forms.Cursor.Position)); * if (info.Item != null && testDropItems.Contains(info.Item) && TestDropHandler != null) * { * // Get the paths. * var paths = new StringCollection(); * paths.AddRange(dragItems.Select(di => di.Path).ToArray()); * * uint effect = 0; * var dataObject = new DataObject(); * var position = new POINT() {X = Cursor.Position.X, Y = Cursor.Position.Y}; * dataObject.SetFileDropList(paths); * ((SharpShell.Interop.IDropTarget) TestDropHandler).DragEnter( * dataObject, 0, position, ref effect); * * var effects = (DragDropEffects) effect; * * e.Action = effects != DragDropEffects.None ? DragAction.Drop : DragAction.Cancel; * }*/ }
private void GlassForm_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { if (mouseOverForm) { Point cord = System.Windows.Forms.Cursor.Position; cord = this.PointToClient(cord); dragControl.cd.Top = cord.Y - model.lastClickedY; dragControl.cd.Left = cord.X - model.lastClickedX; //CalculateSnapToGrid(); } else { e.Action = DragAction.Cancel; this.Controls.Remove(dragControl as Control); RestoreControlState(); for (double i = .30; i > 0.00; i -= 0.05) { this.Opacity = i; System.Threading.Thread.Sleep(30); } } }
void textArea_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { try { if (e.EscapePressed) { e.Action = DragAction.Cancel; } else if ((e.KeyStates & DragDropKeyStates.LeftMouseButton) != DragDropKeyStates.LeftMouseButton) { e.Action = DragAction.Drop; } else { e.Action = DragAction.Continue; } e.Handled = true; } catch (Exception ex) { OnDragException(ex); } }
private void treeObjects_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { if (Control.MouseButtons == MouseButtons.None) { if (e.Action == DragAction.Drop) { System.Windows.Point currMousePoint = SafeNativeMethods.GetCursorPos(); Point DrawingPoint = new Point() { X = (int)currMousePoint.X, Y = (int)currMousePoint.Y }; DrawingPoint = this.PointToClient(DrawingPoint); Rectangle rc = Rectangle.FromLTRB(0, 0, this.Width, this.Height); if (!rc.Contains(DrawingPoint)) { ToMethodsViewer toMethodsViewer = new ToMethodsViewer(_dragUIAcon, currMousePoint); if (DialogResult.OK == toMethodsViewer.ShowDialog(this)) { string _TestFullPath0 = _dragDataObject.GetData(DataFormats.Text) as string; if (!string.IsNullOrEmpty(_TestFullPath0)) { string _TestFullPath = ";\n" + _TestFullPath0 + "."; _dragDataObject.SetData(DataFormats.Text, true, _TestFullPath0 + "." + string.Join(_TestFullPath, toMethodsViewer.TestObjectInfomation.ToArray())); } } else { e.Action = DragAction.Cancel; } toMethodsViewer.Dispose(); } } } }
protected override void OnPreviewQueryContinueDrag(QueryContinueDragEventArgs args) { base.OnPreviewQueryContinueDrag(args); if (args.Action == DragAction.Cancel || args.Action == DragAction.Drop) { CancelDrag(); } else if (args.Action == DragAction.Continue) { Point p = MouseUtilities.GetMousePosition(this); if ((p.Y < DRAG_MARGIN) || (p.Y > RenderSize.Height - DRAG_MARGIN)) { if (_dragScrollTimer == null) { _dragVelocity = DRAG_INITIAL_VELOCITY; _dragScrollTimer = new DispatcherTimer(); _dragScrollTimer.Tick += TickDragScroll; _dragScrollTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)DRAG_INTERVAL); _dragScrollTimer.Start(); } } } }
public override NSDragOperation DraggingUpdated(NSDraggingInfo sender) { try { if (!driver.draggingSource.Cancelled) { var source = Control.FromHandle(driver.draggingSource.ViewHandle); var args = new QueryContinueDragEventArgs(0, false, DragAction.Continue); source?.DndContinueDrag(args); if (args.Action == DragAction.Cancel) { // It seems there is no way to cancel dragging on macOS. // Anyway, we have to stop sending QueryContinue events. driver.draggingSource.Cancelled = true; } } var control = Control.FromHandle(Handle); if (null != control && control.AllowDrop) { var e = ToDragEventArgs(sender); control.DndOver(e); if (e.Effect != UnusedDndEffect) { XplatUICocoa.DraggingEffects = e.Effect; } return(XplatUICocoa.DraggingEffects.ToDragOperation()); } } catch { return(NSDragOperation.None); } return(NSDragOperation.Generic); }
//──────────────────────────────────────── /// <summary> /// ドラッグ&ドロップ用アクション実行。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void Execute4_OnQueryContinueDragEventArgs( object prm_Sender, QueryContinueDragEventArgs prm_E ) { Log_Method log_Method = new Log_MethodImpl(0, Log_ReportsImpl.BDebugmode_Static); Log_Reports log_Reports_Master = new Log_ReportsImpl(log_Method); log_Method.BeginMethod(Info_Expr.Name_Library, this, "Execute4_OnQueryContinueDragEventArgs", log_Reports_Master); // // // イベントハンドラー引数の設定 this.Set_OnQueryContinueDragEventArgs( this, prm_Sender, prm_E ); this.Execute5_Main(log_Reports_Master); log_Method.EndMethod(log_Reports_Master); }
/// <summary> /// The AdornerWindow hooks all Drag/Drop notification so they can be forwarded to the appropriate /// Behavior via the BehaviorService. /// </summary> protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e) => _behaviorService.OnQueryContinueDrag(e);
/// <summary> /// Saves EscapePressed and KeyStates when /// QueryContinueDrag is defined in DataProviderActions. /// Provide your own method if you wish; making sure /// to define QueryContinueDrag in DataProviderActions. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public virtual void DragSource_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { this._escapePressed = e.EscapePressed; this._keyStates = e.KeyStates; }
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent) { calls.Add(String.Format("OnQueryContinueDrag")); base.OnQueryContinueDrag (qcdevent); }
public virtual void OnQueryContinueDrag(object?sender, QueryContinueDragEventArgs e) { }
private void radGridView1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { Console.WriteLine("[GRIDVIEW] Query Drag!"); }
/// <summary> /// Query continue drag preprocess handler /// </summary> /// <param name="e">Event args</param> public virtual void PreprocessQueryContinueDrag(QueryContinueDragEventArgs e) { }
public void ContinueDrag(QueryContinueDragEventArgs args) { throw new System.NotImplementedException(); }
void IBranch.OnQueryContinueDrag(QueryContinueDragEventArgs args, int row, int column) { }
/// <summary> /// Provides a default handler for the QueryContinueDrag drag source event. /// </summary> /// <param name="sender">The object that raised the event. Not used internally.</param> /// <param name="e">The event arguments.</param> public static void DefaultQueryContinueDragHandler(object sender, QueryContinueDragEventArgs e) { DefaultQueryContinueDrag(e); }
/// <summary> /// Provides a default handler for the QueryContinueDrag drag source event. /// </summary> /// <param name="e">The event arguments.</param> public static void DefaultQueryContinueDrag(QueryContinueDragEventArgs e) { if (e.EscapePressed) { e.Action = DragAction.Cancel; } }
private void Form1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { Console.WriteLine("QueryContinueDrag"); }
private void OnQueryContinueDrag(object sender, QueryContinueDragEventArgs e) { _panelAdorner.Update(); MoveChild(_dragedChild); }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// querycontinuedrageventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this QueryContinueDragEventHandler querycontinuedrageventhandler, Object sender, QueryContinueDragEventArgs e, AsyncCallback callback) { if (querycontinuedrageventhandler == null) { throw new ArgumentNullException("querycontinuedrageventhandler"); } return(querycontinuedrageventhandler.BeginInvoke(sender, e, callback, null)); }
protected virtual bool OnQueryContinueDrag(QueryContinueDragEventArgs eventArgs) { return(false); }
private void LbObjectsQueryContinueDrag(object sender, QueryContinueDragEventArgs e) { }
/// <summary> /// Virtual method reporting the query continue drag is going to happen /// </summary> protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e) { base.OnQueryContinueDrag(e); if (e.Handled) { return; } if (_textEditor != null) { _textEditor.OnQueryContinueDrag(e); } }
internal void OnQueryContinueDrag(QueryContinueDragEventArgs e) { TextEditorDragDrop.OnQueryContinueDrag(_uiScope, e); }
private void Edit_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { QueryContinueDrag?.Invoke(sender, e); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <seealso cref="Control.QueryContinueDrag"/> protected virtual void OnQueryContinueDrag(object sender, QueryContinueDragEventArgs e) { // Nothing by default }
private void DragStart1(object sender, QueryContinueDragEventArgs e) { }
private void BoxSlot_QueryContinueDrag(object?sender, QueryContinueDragEventArgs e) => M?.QueryContinueDrag(sender, e);
public void PostprocessQueryContinueDrag(QueryContinueDragEventArgs e) { }
private void DraggableRectangle_PreviewQueryContinueDrag(object sender, QueryContinueDragEventArgs e) { }
private void txtLeftFile_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { }
private void Form1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) { e.Action = DragAction.Continue; }
void AssociatedObject_PreviewQueryContinueDrag(object sender, QueryContinueDragEventArgs e) { SetLastHit(); }
public virtual void OnQueryContinueDrag (Glyph g, QueryContinueDragEventArgs e) { throw new NotImplementedException (); }
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e) { base.OnQueryContinueDrag(e); _dispatcher.HandleQueryContinueDrag(e); }
public virtual void OnQueryContinueDrag(Glyph g, QueryContinueDragEventArgs e) { throw new NotImplementedException(); }