public int OleQueryContinueDrag(int fEscapePressed, int grfKeyState)
        {
            QueryContinueDragEventArgs qcdevent = null;
            bool escapePressed = fEscapePressed != 0;
            DragAction cancel = DragAction.Continue;
            if (escapePressed)
            {
                cancel = DragAction.Cancel;
            }
            else if ((((grfKeyState & 1) == 0) && ((grfKeyState & 2) == 0)) && ((grfKeyState & 0x10) == 0))
            {
                cancel = DragAction.Drop;
            }
            qcdevent = new QueryContinueDragEventArgs(grfKeyState, escapePressed, cancel);
            this.peer.OnQueryContinueDrag(qcdevent);
            switch (qcdevent.Action)
            {
                case DragAction.Drop:
                    return 0x40100;

                case DragAction.Cancel:
                    return 0x40101;
            }
            return 0;
        }
Beispiel #2
0
        void buttonDragDropHandle_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
        {
            Form form = FindForm();

            System.Diagnostics.Debug.Assert(form is StoryEditor);
            if (form is StoryEditor)
            {
                StoryEditor theSE = (StoryEditor)form;

                // this code causes the vertical scroll bar to move if the user is dragging the mouse beyond
                //  the boundary of the flowLayout panel that these verse controls are sitting it.
                System.Drawing.Point pt = theSE.flowLayoutPanelVerses.PointToClient(MousePosition);
                if (theSE.flowLayoutPanelVerses.Bounds.Height < (pt.Y + 10))                    // close to the bottom edge...
                {
                    theSE.flowLayoutPanelVerses.VerticalScroll.Value += 10;                     // bump the scroll bar down
                }
                else if ((pt.Y < 10) && theSE.flowLayoutPanelVerses.VerticalScroll.Value > 0)   // close to the top edge, while the scroll bar position is non-zero
                {
                    theSE.flowLayoutPanelVerses.VerticalScroll.Value -= Math.Min(10, theSE.flowLayoutPanelVerses.VerticalScroll.Value);
                }

                if (e.Action != DragAction.Continue)
                {
                    theSE.DimDropTargetButtons();
                }
                else
                {
                    theSE.LightUpDropTargetButtons(this);
                }
            }
        }
Beispiel #3
0
 private void OnQueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
 {
     if (!this.mIsDragging)
     {
         e.Action = DragAction.Cancel;
     }
 }
 private void listBox1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     if (e.EscapePressed)
     {
         e.Action = DragAction.Cancel;
     }
 }
Beispiel #5
0
            public int OleQueryContinueDrag(int fEscapePressed, int grfKeyState) {
                QueryContinueDragEventArgs qcdevent = null;
                bool escapePressed = (fEscapePressed != 0);
                DragAction action = DragAction.Continue;
                if (escapePressed) {
                    action = DragAction.Cancel;
                }
                else if ((grfKeyState & NativeMethods.MK_LBUTTON) == 0
                         && (grfKeyState & NativeMethods.MK_RBUTTON) == 0
                         && (grfKeyState & NativeMethods.MK_MBUTTON) == 0) {
                    action = DragAction.Drop;
                }

                qcdevent = new QueryContinueDragEventArgs(grfKeyState,escapePressed, action);
                peer.OnQueryContinueDrag(qcdevent);

                int hr = 0;

                switch (qcdevent.Action) {
                    case DragAction.Drop:
                        hr = DragDropSDrop;
                        break;
                    case DragAction.Cancel:
                        hr = DragDropSCancel;
                        break;
                }

                return hr;
            }
Beispiel #6
0
 private void treeViewAdv_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
 {
     // Cancel draggin when Escape was pressed.
     if (e.EscapePressed)
     {
         e.Action = DragAction.Cancel;
     }
 }
Beispiel #7
0
        /// <summary>
        /// Handles the QueryContinueDrag event raised by picCurrentColor. If
        /// the Action is anything other than Cancel or Drop, the location of
        /// the transparent form is updated.
        /// </summary>
        /// <param name="sender">The object that raised the event.</param>
        /// <param name="e">A QueryContinueDragEventArgs containing the event
        /// data.</param>

        private void picCurrentColor_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
        {
            if (e.Action == DragAction.Cancel || e.Action == DragAction.Drop)
            {
                dragForm.Hide();
            }
            else
            {
                dragForm.Location = new Point(Cursor.Position.X - dragForm.CursorXDifference, Cursor.Position.Y - dragForm.CursorYDifference);
            }
        }
        protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
        {
            var pos = Parent.PointToClient(MousePosition);

            if (!Bounds.Contains(pos))
            {
                qcdevent.Action = DragAction.Cancel;
                return;
            }

            base.OnQueryContinueDrag(qcdevent);
        }
        /// <summary>
        /// Test to see if we want to continue dragging
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void applicationsTree_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
        {
            //Did the user press escape?
            if (e.EscapePressed)
            {
                //User pressed escape - cancel the Drag
                e.Action = DragAction.Cancel;

                //Clear the Drop highlight, since we are no longer dragging
                UltraTree_DropHightLight_DrawFilter.ClearDropHighlight();
            }
        }
Beispiel #10
0
        private void listView1_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
        {
            ListView lv = sender as ListView;

            if (lv != null)
            {
                Form f = lv.FindForm();

                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;
                }
            }
        }
Beispiel #11
0
        private void ListDragSource_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
        {
            // Cancel the drag if the mouse moves off the form.
            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;
                }
            }
        }
 bool IWorkflowDesignerMessageSink.OnQueryContinueDrag(QueryContinueDragEventArgs e)
 {
     try
     {
         OnQueryContinueDrag(e);
     }
     catch
     {
     }
     return true;
 }
Beispiel #13
0
		private void Form1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
		{
			e.Action = DragAction.Continue;
		}
Beispiel #14
0
		//void Log(string message)
		//{
		//    var writer = new StreamWriter(@"c:\test\log.txt", true);
		//    writer.WriteLine(message);
		//    writer.Close();
		//}

		/// <summary>
		/// Despite the method name (chosen to match the method of Control which it implements),
		/// our main reason for implementing this is to be notified when the drop takes place
		/// and, if it is a move, delete the original.
		/// </summary>
		/// <param name="e"></param>
		public void OnQueryContinueDrag(QueryContinueDragEventArgs e)
		{
			//Log("OnQueryContinueDrag: action " + e.Action);
			if (e.Action != DragAction.Drop)
			{
				return; // drop did not take place (yet).
			}
			if ((e.KeyState & (int)DragDropKeyStates.ControlKey) != 0)
			{
				//Log("Drop: Copy");
				return; // it was a copy
			}
			//Log("Drop: Move");
			if (DragState != WindowDragState.None)
				DragState = WindowDragState.InternalMove;
			else
			{
				// Something else is supposed to handle the drop; this is our one chance to actually make it
				// a move by deleting the source. We presume that what is being dragged is our current selection.
				if (Selection != null)
				{
					Selection.Delete();
				}
			}
		}
Beispiel #15
0
		private bool QueryContinue (bool escape, DragAction action)
		{
			QueryContinueDragEventArgs qce = new QueryContinueDragEventArgs ((int) XplatUI.State.ModifierKeys,
					escape, action);

			Control c = MwfWindow (source);
			
			if (c == null) {
				tracking = false;
				return false;
			}
			
			c.DndContinueDrag (qce);

			switch (qce.Action) {
			case DragAction.Continue:
				return true;
			case DragAction.Drop:
				SendDrop (drag_data.LastTopLevel, source, IntPtr.Zero);
				tracking = false;
				return true;
			case DragAction.Cancel:
				drag_data.Reset ();
				c.InternalCapture = false;
				break;
			}

			SendLeave (drag_data.LastTopLevel, toplevel);

			RestoreDefaultCursor ();
			tracking = false;
			return false;
		}
 protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
 {
     base.OnQueryContinueDrag(qcdevent);
     using (WorkflowMessageDispatchData data = new WorkflowMessageDispatchData(this, qcdevent))
     {
         foreach (WorkflowDesignerMessageFilter filter in data.Filters)
         {
             if (((IWorkflowDesignerMessageSink) filter).OnQueryContinueDrag(qcdevent))
             {
                 return;
             }
         }
     }
 }
Beispiel #17
0
 private void ListDragSource_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     // Cancel the drag if the mouse moves off the form.
     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;
         }
     }
 }
Beispiel #18
0
 /// <summary>
 /// 判断ALT键是否按下
 /// </summary>
 /// <param name="e">事件数据</param>
 /// <returns>true/false</returns>
 public static bool IsMouseCenterButtonPressed(this QueryContinueDragEventArgs e)
 {
     return(e != null && (e.KeyState & 16) > 0);
 }
Beispiel #19
0
		/// <summary>
		/// Check if we should continue dragging
		/// </summary>
		/// <param name="e"></param>
		protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e)
		{
			Rectangle screen = this.Parent.RectangleToScreen(new Rectangle(this.Location.X, this.Location.Y, this.Width, this.Height));
			Point mousePoint = Cursor.Position;

			// if ESC is pressed, always stop
			if (e.EscapePressed == true || ((e.KeyState & 1) == 0 && screen.Contains(mousePoint) == false))
			{
				e.Action = DragAction.Cancel;

				if (_draggedItem != null)
				{
					_draggedItem.Dragging = false;
					this.RefreshItem(_draggedItem);
					_draggedItem = null;
				}
				if (_draggedBitmap != null)
				{
					_draggedBitmap.Dispose();
					_draggedBitmap = null;
					this.Invalidate(_draggedBitmapRect);
				}
				_mouseDownLocation = Point.Empty;
			}
			else
			{
				DateTime now = DateTime.Now;

				// if we are at the top or bottom, scroll every 150ms
				if (mousePoint.Y >= screen.Bottom)
				{
					int visible = this.ClientSize.Height / this.ItemHeight;
					int maxtopindex = Math.Max(this.Items.Count - visible + 1, 0);
					if (this.TopIndex < maxtopindex && now.Subtract(_lastDragScroll).TotalMilliseconds >= 150)
					{
						this.TopIndex++;
						_lastDragScroll = now;
						this.Refresh();
					}
				}
				else if (mousePoint.Y <= screen.Top)
				{
					int visible = this.ClientSize.Height / this.ItemHeight;
					if (this.TopIndex > 0 && now.Subtract(_lastDragScroll).TotalMilliseconds >= 150)
					{
						this.TopIndex--;
						_lastDragScroll = now;
						this.Refresh();
					}
				}
				_lastDragTopIndex = this.TopIndex;

				base.OnQueryContinueDrag(e);
			}
		}
Beispiel #20
0
 private void lbDragDropSource_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
 {
     // DO NOT DO THIS
     // e.Action = DragAction.Continue;
 }
Beispiel #21
0
 /// <summary>
 /// 判断SHIFT键是否按下
 /// </summary>
 /// <param name="e">事件数据</param>
 /// <returns>true/false</returns>
 public static bool IsShiftPressed(this QueryContinueDragEventArgs e)
 {
     return(e != null && (e.KeyState & 4) > 0);
 }
Beispiel #22
0
 public override void OnQueryContinueDrag(Glyph g, System.Windows.Forms.QueryContinueDragEventArgs e)
 {
     base.OnQueryContinueDrag(g, e);
 }
 public void Content_QueryContinueDrag(System.Windows.Forms.QueryContinueDragEventArgs e)
 {
 }
 public virtual void Content_QueryContinueDrag(System.Windows.Forms.QueryContinueDragEventArgs e)
 {
     Content_QueryContinueDrag(e, null);
 }
 public void OnQueryContinueDrag(QueryContinueDragEventArgs e)
 {
 }
        //────────────────────────────────────────
        /// <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);
        }
Beispiel #27
0
        //private void panel1_DragDrop(object sender, DragEventArgs e)
        //{
        // //   int x = readerx;
        //  //  int y = readery;
        //    try
        //    {
        //        DSSmartCity.Antenna_Row tagrow = (DSSmartCity.Antenna_Row)gridView3.GetFocusedDataRow();
        //        DSSmartCity.ReaderListRow readerrow = (DSSmartCity.ReaderListRow)gridView2.GetFocusedDataRow();
        //        foreach (Control item in panel1.Controls)
        //        {
        //            if (item.ToString()=="RfidTest.UCReader")
        //            {
        //                if (((UCReader)item).labelname== readerrow.name + ":"+tagrow.antennaid.ToString())
        //                {
        //                    MessageBox.Show("This Antenna is already in the map.");
        //                    return;
        //                }
        //            }
        //        }
        //        int x = PointToClient(Cursor.Position).X - this.panel1.Location.X - this.splitContainer1.Panel1.Width;// +scrollx;
        //        int y = PointToClient(Cursor.Position).Y - this.panel1.Location.Y;// +scrolly;
        //        this.panel1.SuspendLayout();
        //        this.SuspendLayout();
        //        // add the selected string to bottom of list
        //        Image im = Image.FromFile(@"photo/light.jpg"); // System.Drawing.Color.Lime;
        //        string readername = rfid1.ReaderList.Select("server='" + tagrow.readerid + "'")[0][1].ToString();
        //        UCReader mytag = new UCReader(im, readername + ":" + tagrow.antennaid);
        //       //  PictureBox mytag = new PictureBox();
        //     //   mytag.Image = im;
        //        mytag.AutoSize = true;
        //        mytag.Tag = "Reader";
        //        mytag.Location = new System.Drawing.Point(x, y);
        //        //  mytag.Name = name.Split(',')[0].ToString();
        //        mytag.Size = new System.Drawing.Size(40, 60);
        //     //   ((DSSmartCity.Antenna_Row)gridView3.GetFocusedDataRow()).x = x+scrollx;
        //      //  ((DSSmartCity.Antenna_Row)gridView3.GetFocusedDataRow()).y = y+scrolly;
        //        mytag.BackColor = Color.White;
        //         mytag.MouseMove += new System.Windows.Forms.MouseEventHandler(this.label1_MouseMove);
        //         //if (rfid1.TagsPosition.Select("tagid='" + tagrow.readerid + "'").Length > 0)
        //         //{
        //         //    MessageBox.Show("The Tag is existing!");
        //         //}
        //         //else
        //         //{
        //         //    this.panel1.Controls.Add(mytag);
        //         //    mytag.BringToFront();
        //         //    this.panel1.PerformLayout();
        //         //    this.ResumeLayout(false);
        //         //    SaveData();
        //         //}
        //        // textBox1.SelectAll();
        //    }
        //    catch (Exception ex)
        //    {
        //        MessageBox.Show(ex.ToString());
        //    }
        //}
        private void label1_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
        }
 protected void Set_OnQueryContinueDragEventArgs(
     Expression_Node_Function expr_Func,
     object prm_Sender,
     QueryContinueDragEventArgs prm_E
     )
 {
     if (null != expr_Func)//暫定
     {
         expr_Func.EnumEventhandler = EnumEventhandler.O_Qcdea;
         expr_Func.Functionparameterset.Sender = prm_Sender;
         expr_Func.Functionparameterset.QueryContinueDragEventArgs = prm_E;
     }
 }
		protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
		{
			if (qcdevent != null && ((qcdevent.KeyState & 2) > 0 || (qcdevent.KeyState & 16) > 0))
				qcdevent.Action = DragAction.Cancel;
			base.OnQueryContinueDrag(qcdevent);
		}
		protected virtual void OnQueryContinueDrag (QueryContinueDragEventArgs queryContinueDragEvent)
		{
			QueryContinueDragEventHandler eh = (QueryContinueDragEventHandler)(Events[QueryContinueDragEvent]);
			if (eh != null)
				eh (this, queryContinueDragEvent);
		}
Beispiel #31
0
		protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
		{
			base.OnQueryContinueDrag(qcdevent); // call before root method, determines whether drop or cancel
			Root.OnQueryContinueDrag(qcdevent);
		}
Beispiel #32
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);
 }
Beispiel #33
0
 /// <summary>
 ///   Handles the <see cref="TreeView.QueryContinueDrag" /> event of the source tree view.
 /// </summary>
 /// <remarks>
 ///   This aborts the drag operation of an item from the source tree view if the action is iterrup6ted
 ///   or stopped over something other than the fomod tree view.
 /// </remarks>
 /// <param name="sender">The object that triggered the event.</param>
 /// <param name="e">A <see cref="ItemDragEventArgs" /> that describes the event arguments.</param>
 private void tvwSource_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
   if ((e.Action != DragAction.Drop) && ((MouseButtons & MouseButtons.Left) != MouseButtons.Left))
   {
     e.Action = DragAction.Cancel;
   }
 }
        public void OnQueryContinueDrag_ActionIsNotDropOrCancel()
        {
            //Arrange
            _control.IsMouseDown = true;
            var eventArgs = new QueryContinueDragEventArgs(0, false, DragAction.Continue);

            //Act
            _control.OnQueryContinueDrag(null, eventArgs);

            //Assert
            Assert.IsTrue(_control.IsMouseDown);
        }
Beispiel #35
0
			void IBranch.OnQueryContinueDrag(QueryContinueDragEventArgs args, int row, int column)
			{
			}
Beispiel #36
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        protected override void OnQueryContinueDrag(QueryContinueDragEventArgs args)
        {
            base.OnQueryContinueDrag(args);

            if (this.DropSink != null)
                this.DropSink.QueryContinue(args);
        }
 /// <summary>
 /// Controls if the drag drop operation should continue.
 /// </summary>
 /// <param name="e">A QueryContinueDragEventArgs that contains the event data.</param>
 protected virtual void OnQueryContinueDrag(QueryContinueDragEventArgs e)
 {
     if (e == null)
         throw new ArgumentNullException("e");
 }
 private void Controls_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
 {
     Console.Write("Controls_QueryContinueDrag\n");
     if (e.Action == DragAction.Continue)
     {
         Console.Write("Continue\n");
         if ((lastDragOver.Location.Y <= 0) & (vScrollBarAdv1.Value > 0))
         {
             vScrollBarAdv1.Value -= 1;
             this.Cursor           = System.Windows.Forms.Cursors.NoMoveVert;
             DoScrollAction();
             this.Cursor = System.Windows.Forms.Cursors.Default;
         }
         else if ((lastDragOver.Location.Y + lastDragOver.Size.Height >= vScrollBarAdv1.ClientSize.Height) &&
                  (vScrollBarAdv1.Value < (vScrollBarAdv1.Maximum - vScrollBarAdv1.LargeChange + 1)))
         {
             vScrollBarAdv1.Value += 1;
             this.Cursor           = System.Windows.Forms.Cursors.NoMoveVert;
             DoScrollAction();
             this.Cursor = System.Windows.Forms.Cursors.Default;
         }
     }
     else if (e.Action == DragAction.Drop)
     {
         int         iCnt          = 0;
         ControlBase SelectControl = ListControls[SelectIndex];
         Point       DragPoint     = ListControls[DragIndex].Location;
         if (SelectIndex > DragIndex)
         {
             for (iCnt = SelectIndex - 1; iCnt >= DragIndex; --iCnt)
             {
                 if (ListControls[iCnt].Visible == true)
                 {
                     ListControls[iCnt].Location = new Point(1, ListControls[iCnt].Location.Y + SelectControl.Size.Height);
                 }
                 ListControls[iCnt + 1] = ListControls[iCnt];
             }
             SelectControl.Location = DragPoint;
             EnableControl(SelectControl);
             ListControls[DragIndex] = SelectControl;
             SelectIndex             = DragIndex;
             OnDragDrop();
         }
         else if (SelectIndex < DragIndex)
         {
             for (iCnt = SelectIndex + 1; iCnt <= DragIndex; ++iCnt)
             {
                 if (ListControls[iCnt].Visible == true)
                 {
                     ListControls[iCnt].Location = new Point(1, ListControls[iCnt].Location.Y - SelectControl.Size.Height);
                 }
                 ListControls[iCnt - 1] = ListControls[iCnt];
             }
             SelectControl.Location = DragPoint;
             EnableControl(SelectControl);
             ListControls[DragIndex] = SelectControl;
             SelectIndex             = DragIndex;
             OnDragDrop();
         }
         else
         {
         }
     }
     else
     {
     }
     this.Cursor = System.Windows.Forms.Cursors.Default;
     Update();
     if (e.EscapePressed)
     {
         e.Action = DragAction.Cancel;
     }
 }
Beispiel #39
0
        private void treeViewChannel_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
        {
            if (e.EscapePressed)
            {
                // Reset the drag rectangle when the mouse button is raised.
                this.dragBoxFromMouseDown = Rectangle.Empty;

                e.Action = DragAction.Cancel;
            }
        }
 void IBranch.OnQueryContinueDrag(System.Windows.Forms.QueryContinueDragEventArgs args, int row, int column)
 {
 }
Beispiel #41
0
 private void LbObjectsQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
 }
Beispiel #42
0
 private void TestControl_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("QueryContinueDrag");
 }
Beispiel #43
0
 /// <summary>
 /// Should the drag be allowed to continue?
 /// </summary>
 /// <remarks>
 /// You only need to override this if you want the user to be able
 /// to end the drop in some non-standard way, e.g. dragging to a
 /// certain point even without releasing the mouse, or going outside
 /// the bounds of the application. 
 /// </remarks>
 /// <param name="args"></param>
 public virtual void QueryContinue(QueryContinueDragEventArgs args)
 {
 }
        //────────────────────────────────────────
        /// <summary>
        /// ドラッグ&ドロップ中に発生します。
        /// ドラッグをキャンセルするのに使います。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnSourceListbox_QueryContinueDrag(
            object sender,
            QueryContinueDragEventArgs e,
            Log_Reports log_Reports
            )
        {
            // ドラッグ中にマウスの右ボタンが押されていれば、ドラッグをキャンセルします。

            // "2"は、マウスの右ボタンを表します。何故か定数はないようです。
            if ((e.KeyState & 2) == 2)
            {
                e.Action = DragAction.Cancel;
            }
        }
        public void OnQueryContinueDrag_ActionIsDrop()
        {
            //Arrange
            _control.IsMouseDown = true;
            var eventArgs = new QueryContinueDragEventArgs(0, false, DragAction.Drop);

            //Act
            _control.OnQueryContinueDrag(null, eventArgs);

            //Assert
            Assert.IsFalse(_control.IsMouseDown);
        }
Beispiel #46
0
        private void pbPreview_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
        {
            //Trace.WriteLine("QueryContinueDrag...", "PeekPreview.pbPreview_QueryContinueDrag");

            if (e.Action == DragAction.Continue)
            {
                DragThumb.SetDesktopLocation(Cursor.Position.X - DragThumb.Width / 2, Cursor.Position.Y - DragThumb.Height);
            }
            //else
            //{
            //    DragThumb.Close();
            //}
        }
 private void TabPanel_QueryContinueDrag( object sender, QueryContinueDragEventArgs e )
 {
     //右クリックでキャンセル
     if ( ( e.KeyState & 2 ) != 0 ) {
         e.Action = DragAction.Cancel;
     }
 }
Beispiel #48
0
 private void HandleQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
 {
     OnQueryContinueDrag(e);
 }
Beispiel #49
0
 protected override bool OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
 {
     return true;
 }
Beispiel #50
0
 protected virtual void OnQueryContinueDrag(QueryContinueDragEventArgs queryContinueDragEvent)
 {
     throw null;
 }