コード例 #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
        }
コード例 #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;
             * }*/
        }
コード例 #3
0
ファイル: GlassForm.cs プロジェクト: hucara/confmanager
        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);
                }
            }
        }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
        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();
                    }
                }
            }
        }
コード例 #6
0
        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();
                    }
                }
            }
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
コード例 #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;
 }
コード例 #11
0
ファイル: events.cs プロジェクト: hitswa/winforms
		protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent) {
			calls.Add(String.Format("OnQueryContinueDrag"));
			base.OnQueryContinueDrag (qcdevent);
		}
コード例 #12
0
 public virtual void OnQueryContinueDrag(object?sender, QueryContinueDragEventArgs e)
 {
 }
コード例 #13
0
ファイル: GridDataAssets.cs プロジェクト: Ales999/plena
 private void radGridView1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     Console.WriteLine("[GRIDVIEW] Query Drag!");
 }
コード例 #14
0
 /// <summary>
 /// Query continue drag preprocess handler
 /// </summary>
 /// <param name="e">Event args</param>
 public virtual void PreprocessQueryContinueDrag(QueryContinueDragEventArgs e)
 {
 }
コード例 #15
0
 public void ContinueDrag(QueryContinueDragEventArgs args)
 {
     throw new System.NotImplementedException();
 }
コード例 #16
0
 void IBranch.OnQueryContinueDrag(QueryContinueDragEventArgs args, int row, int column)
 {
 }
コード例 #17
0
ファイル: DragDropLib.cs プロジェクト: applejian/cyberduck
 /// <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);
 }
コード例 #18
0
ファイル: DragDropLib.cs プロジェクト: applejian/cyberduck
 /// <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;
     }
 }
コード例 #19
0
ファイル: form6.cs プロジェクト: ChanahC/CSharpTrain
 private void Form1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     Console.WriteLine("QueryContinueDrag");
 }
コード例 #20
0
 private void OnQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     _panelAdorner.Update();
     MoveChild(_dragedChild);
 }
コード例 #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));
        }
コード例 #22
0
 protected virtual bool OnQueryContinueDrag(QueryContinueDragEventArgs eventArgs)
 {
     return(false);
 }
コード例 #23
0
ファイル: AddFloorPlanForm.cs プロジェクト: uzbekdev1/main
 private void LbObjectsQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
 }
コード例 #24
0
ファイル: TextBoxBase.cs プロジェクト: JianwenSun/cc
        /// <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);
            }
        }
コード例 #25
0
ファイル: TextEditor.cs プロジェクト: sjyanxin/WPFSource
 internal void OnQueryContinueDrag(QueryContinueDragEventArgs e)
 { 
     TextEditorDragDrop.OnQueryContinueDrag(_uiScope, e); 
 }
コード例 #26
0
ファイル: UIRichTextBox.cs プロジェクト: znw333/SunnyUI
 private void Edit_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     QueryContinueDrag?.Invoke(sender, e);
 }
コード例 #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
 }
コード例 #28
0
        private void DragStart1(object sender, QueryContinueDragEventArgs e)
        {

        }
コード例 #29
0
 private void BoxSlot_QueryContinueDrag(object?sender, QueryContinueDragEventArgs e) => M?.QueryContinueDrag(sender, e);
コード例 #30
0
 public void PostprocessQueryContinueDrag(QueryContinueDragEventArgs e)
 {
 }
コード例 #31
0
 private void DraggableRectangle_PreviewQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
 }
コード例 #32
0
 private void txtLeftFile_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
 }
コード例 #33
0
 private void Form1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     e.Action = DragAction.Continue;
 }
コード例 #34
0
ファイル: LastHitAwareBehavior.cs プロジェクト: zparr/ATF
 void AssociatedObject_PreviewQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     SetLastHit();
 }
コード例 #35
0
ファイル: Behavior.cs プロジェクト: nlhepler/mono
		public virtual void OnQueryContinueDrag (Glyph g, QueryContinueDragEventArgs e)
		{
			throw new NotImplementedException ();
		}
コード例 #36
0
 protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e)
 {
     base.OnQueryContinueDrag(e);
     _dispatcher.HandleQueryContinueDrag(e);
 }
コード例 #37
0
 public virtual void OnQueryContinueDrag(Glyph g, QueryContinueDragEventArgs e)
 {
     throw new NotImplementedException();
 }