Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
        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;
             * }*/
        }
Exemplo n.º 3
0
        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();
                    }
                }
            }
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        //────────────────────────────────────────

        /// <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);
        }
Exemplo n.º 9
0
 /// <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);
Exemplo n.º 10
0
 /// <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;
 }
Exemplo n.º 11
0
		protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent) {
			calls.Add(String.Format("OnQueryContinueDrag"));
			base.OnQueryContinueDrag (qcdevent);
		}
Exemplo n.º 12
0
 public virtual void OnQueryContinueDrag(object?sender, QueryContinueDragEventArgs e)
 {
 }
Exemplo n.º 13
0
 private void radGridView1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     Console.WriteLine("[GRIDVIEW] Query Drag!");
 }
Exemplo n.º 14
0
 /// <summary>
 /// Query continue drag preprocess handler
 /// </summary>
 /// <param name="e">Event args</param>
 public virtual void PreprocessQueryContinueDrag(QueryContinueDragEventArgs e)
 {
 }
Exemplo n.º 15
0
 public void ContinueDrag(QueryContinueDragEventArgs args)
 {
     throw new System.NotImplementedException();
 }
 void IBranch.OnQueryContinueDrag(QueryContinueDragEventArgs args, int row, int column)
 {
 }
Exemplo n.º 17
0
 /// <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);
 }
Exemplo n.º 18
0
 /// <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;
     }
 }
Exemplo n.º 19
0
 private void Form1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     Console.WriteLine("QueryContinueDrag");
 }
Exemplo n.º 20
0
 private void OnQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     _panelAdorner.Update();
     MoveChild(_dragedChild);
 }
Exemplo n.º 21
0
        /// <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));
        }
Exemplo n.º 22
0
 protected virtual bool OnQueryContinueDrag(QueryContinueDragEventArgs eventArgs)
 {
     return(false);
 }
Exemplo n.º 23
0
 private void LbObjectsQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
 }
Exemplo n.º 24
0
        /// <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);
            }
        }
Exemplo n.º 25
0
 internal void OnQueryContinueDrag(QueryContinueDragEventArgs e)
 { 
     TextEditorDragDrop.OnQueryContinueDrag(_uiScope, e); 
 }
Exemplo n.º 26
0
 private void Edit_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     QueryContinueDrag?.Invoke(sender, e);
 }
Exemplo n.º 27
0
 /// <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
 }
Exemplo n.º 28
0
        private void DragStart1(object sender, QueryContinueDragEventArgs e)
        {

        }
Exemplo n.º 29
0
 private void BoxSlot_QueryContinueDrag(object?sender, QueryContinueDragEventArgs e) => M?.QueryContinueDrag(sender, e);
Exemplo n.º 30
0
 public void PostprocessQueryContinueDrag(QueryContinueDragEventArgs e)
 {
 }
 private void DraggableRectangle_PreviewQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
 }
Exemplo n.º 32
0
 private void txtLeftFile_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
 }
Exemplo n.º 33
0
 private void Form1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     e.Action = DragAction.Continue;
 }
Exemplo n.º 34
0
 void AssociatedObject_PreviewQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     SetLastHit();
 }
Exemplo n.º 35
0
		public virtual void OnQueryContinueDrag (Glyph g, QueryContinueDragEventArgs e)
		{
			throw new NotImplementedException ();
		}
Exemplo n.º 36
0
 protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e)
 {
     base.OnQueryContinueDrag(e);
     _dispatcher.HandleQueryContinueDrag(e);
 }
Exemplo n.º 37
0
 public virtual void OnQueryContinueDrag(Glyph g, QueryContinueDragEventArgs e)
 {
     throw new NotImplementedException();
 }