Inheritance: System.EventArgs
示例#1
0
        public virtual bool ExitTrackingMode(MouseEventArgs e)
        {
            if (_tracking)
                _tracking = false;

            return false;
        }
示例#2
0
        // Beim Klick auf "Verschieben" wird das Programm in die Taskleiste verschoben
        private void btnDelayImage_MouseClick(object sender, MouseEventArgs e)
        {
            switch (timebox.SelectedItem.ToString())
            {
                case "10 Minuten":
                    Hide();
                    this.timer.Interval = 1000 * 60 * 10;    // 1000 is the number of milliseconds in a second.
                                                             // 60 is the number of seconds in a minute
                                                             // 10 is the number of minutes.

                    timer.Start();
                    timer.Tick += new System.EventHandler(TimerEvent);
                    break;

                case "30 Minuten":
                    Hide();
                    timer.Interval = 1000 * 60 * 30;     // 1000 is the number of milliseconds in a second.
                                                         // 60 is the number of seconds in a minute
                                                         // 30 is the number of minutes.

                    timer.Start();
                    timer.Tick += new System.EventHandler(TimerEvent);
                    break;

                case "60 Minuten":
                    Hide();
                    timer.Interval = 1000 * 60 * 60;    // 1000 is the number of milliseconds in a second.
                                                        // 60 is the number of seconds in a minute
                                                        // 60 is the number of minutes.

                    timer.Start();
                    timer.Tick += new System.EventHandler(TimerEvent);
                    break;
            }
        }
示例#3
0
 private void pictureBoxHue_MouseMove(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
     this.handle_hue_click(new System.Drawing.Point (e.X, e.Y));
     }
 }
示例#4
0
 public override void LeftMouseFullClicked(MouseEventArgs e)
 {
     if (_validPos)
     {
         engine.addNode(nodeType);
     }
 }
        void OnMouseWheel(object sender, MouseEventArgs e)
        {
            WheelActions inputaction = e.Delta > 0 ? WheelActions.Up : WheelActions.Down;

            if (inputaction == action)
                base.OnEventTriggered(EventTypes.MouseWheel, this);
        }
示例#6
0
 void GameControl_MouseMove(object sender, MouseEventArgs e)
 {
     EditorMouse.UpdateState(e.X, e.Y,
        (e.Button == System.Windows.Forms.MouseButtons.Left),
        (e.Button == System.Windows.Forms.MouseButtons.Middle),
        (e.Button == System.Windows.Forms.MouseButtons.Right));
 }
 private static void MouseUp(object sender, MouseEventArgs mouseEventArgs)
 {
     if (mouseEventArgs.Button == MouseButtons.Left)
         KeysPressed &= ~VolumeScrollKey.LeftMouseButton;
     if (mouseEventArgs.Button == MouseButtons.Right)
         KeysPressed &= ~VolumeScrollKey.RightMouseButton;
 }
示例#8
0
 private void pnlTopBar_MouseDown(object sender, MouseEventArgs e)
 {
     if (!pinned) {
         ReleaseCapture();
         SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
     }
 }
示例#9
0
 private void listbox_clients_DoubleClickSubItem(object sender, ChatListEventArgs e, MouseEventArgs es)
 {
     if (listbox_clients.Items[0].SubItems[0].Status== ChatListSubItem.UserStatus.OffLine)
     {
         showInfo("你处于离线状态", MyConfig.INT_UPDATEUI_TXBOX);
         return;
     }
     if (listbox_clients.Items[0].SubItems[0].IsVip)
     {
         showInfo("你处于远程控制状态", MyConfig.INT_UPDATEUI_TXBOX);
         return;
     }
     if (e.SelectSubItem.DisplayName.Equals(label_nickname.Text))
     {
         showInfo("设备不能连接自身", MyConfig.INT_UPDATEUI_TXBOX);
         //return;
     }
     if (e.SelectSubItem.Status==ChatListSubItem.UserStatus.OffLine)
     {
         showInfo("你连接的远端设备不在线", MyConfig.INT_UPDATEUI_TXBOX);
         return;
     }
     if (e.SelectSubItem.IsVip)
     {
         showInfo("你连接的远端设备处于控制状态", MyConfig.INT_UPDATEUI_TXBOX);
         return;
     }
     connect(e.SelectSubItem.Tag.ToString());
 }
        /// <summary>
        /// Handles the <see cref="Control.MouseDown"/> event.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Is used to retrieve information about changed button (<see cref="MouseEventArgs.Button"/>) and wheel delta (<see cref="MouseEventArgs.Delta"/>).</param>
        private void HandleMouseDown(object sender, MouseEventArgs e)
        {
            pressedButtonsCount++;

            var eventType = pressedButtonsCount > 1 ? PointerEventType.Moved : PointerEventType.Pressed;
            CreateAndAddPoint(eventType, TranslateMouseButtonDown(e.Button), e.Delta);
        }
示例#11
0
文件: TabManager.cs 项目: Jaex/IRCLib
        private void tc_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Middle)
            {
                for (int i = 0; i < tc.TabCount; ++i)
                {
                    if (tc.GetTabRect(i).Contains(e.Location))
                    {
                        TabPage tabPage = tc.TabPages[i];

                        if (tabPage != null)
                        {
                            TabInfo tabInfo = tabPage.Tag as TabInfo;

                            if (tabInfo != null)
                            {
                                tc.TabPages.Remove(tabPage);
                                Tabs.Remove(tabInfo);
                            }
                        }

                        return;
                    }
                }
            }
        }
示例#12
0
 public override bool OnMouseUp(MouseEventArgs e, KeyModifier eKeyMod, int iOldX, int iOldY)
 {
     base.OnMouseUp(e, eKeyMod, iOldX, iOldY);
       if (e.Button == MouseButtons.Left)// && eKeyMod != KeyModifier.None)
     HandleClick();
       return true;
 }
示例#13
0
 private void TxtMessagesMouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         contextOuputMenu.Show(txtMessages, e.Location);
     }
 }
示例#14
0
        public override void Mouse_Move(MouseEventArgs e)
        {
            _endMouseRay = Editor.Camera.GetWorldRay(new Vector2(e.X, e.Y));
            if (!_startSet)
            {
                _startPositions.Clear();
                foreach (var control in Editor.Selection)
                {
                    _startPositions.Add(control, control.Position);
                }
                _startMouseRay = _endMouseRay;
                _cameraPlane = new Plane(Editor.Camera.LookAt, Editor.Camera.LookAt + Editor.Camera.Right, Editor.Camera.LookAt + Editor.Camera.UpEffective);
                _startSet = true;
            }

            float? distanceStart, distance;
            _startMouseRay.Intersects(ref _cameraPlane, out distanceStart);
            _endMouseRay.Intersects(ref _cameraPlane, out distance);

            if (distanceStart != null && distance != null)
            {
                var deltaMouse = (_endMouseRay.Position + Vector3.Multiply(_endMouseRay.Direction, distance.Value))
                    - (_startMouseRay.Position + Vector3.Multiply(_startMouseRay.Direction, distanceStart.Value));

                foreach (var control in Editor.Selection)
                {
                    control.Position = _startPositions[control] + deltaMouse;
                }
            }
        }
 public void itemListBox_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         offsetListBox.SelectedIndex = offsetListBox.IndexFromPoint(e.Location);
     }
 }
示例#16
0
 private void HandleStatusLabelMouseDown(object sender, MouseEventArgs e)
 {
     if(e.Button==MouseButtons.Right)
     {
         Clipboard.SetText(statusLabel.Text);
     }
 }
示例#17
0
        public MouseEvent MouseUp(MouseEventArgs e)
        {
            MouseEvent.MouseInfo mouseInfo = new MouseEvent.MouseInfo(false, false, new TPoint(e.X, e.Y));
            InheritButtonStatesFromPreviousMouseEvent(ref mouseInfo);

            if (e.Button == MouseButtons.Left)
            {
                mouseInfo.leftButton = false;
                MouseEvent mouseEvent = new MouseEvent(MouseEvent.EventState.LUp, mouseInfo, m_previousEvent.Info.position);
                m_previousEvent = mouseEvent;
                return mouseEvent;
            }
            else if (e.Button == MouseButtons.Middle)
            {
                mouseInfo.middleButton = false;
                MouseEvent mouseEvent = new MouseEvent(MouseEvent.EventState.MUp, mouseInfo, m_previousEvent.Info.position);
                m_previousEvent = mouseEvent;
                return mouseEvent;
            }
            else if (e.Button == MouseButtons.Right)
            {
                mouseInfo.rightButton = false;
                MouseEvent mouseEvent = new MouseEvent(MouseEvent.EventState.RUp, mouseInfo, m_previousEvent.Info.position);
                m_previousEvent = mouseEvent;
                return mouseEvent;
            }

            return null;
        }
示例#18
0
		protected virtual void grid_MouseDown(GridVirtual sender, MouseEventArgs e)
		{
#warning da fare
            //if (sender.Selection.BorderRange.IsEmpty() == false)
            //{
            //    Position mousePos = sender.PositionAtPoint(new System.Drawing.Point(e.X, e.Y));

            //    if (mousePos.IsEmpty() == false)
            //    {
            //        float distance;
            //        DevAge.Drawing.RectanglePartType partType = sender.Selection.Border.GetPointPartType(sender.Selection.GetDrawingRectangle(), 
            //            new System.Drawing.Point( e.X, e.Y) , out distance);
            //        if ( partType == DevAge.Drawing.RectanglePartType.BottomBorder || 
            //            partType == DevAge.Drawing.RectanglePartType.TopBorder || 
            //            partType == DevAge.Drawing.RectanglePartType.RightBorder || 
            //            partType == DevAge.Drawing.RectanglePartType.LeftBorder)
            //        {
            //            RangeData data = new RangeData();
            //            data.LoadData(sender, sender.Selection.BorderRange, mousePos, mCutMode);
            //            if (mCutMode == CutMode.None)
            //                sender.DoDragDrop(data, DragDropEffects.Copy);
            //            else
            //                sender.DoDragDrop(data, DragDropEffects.Move);
            //        }
            //    }
            //}
		}
示例#19
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if ((e.Button == MouseButtons.Left) && (e.Clicks > 1))
                checkWasFromDoubleClick = true;

            base.OnMouseDown(e);
        }
示例#20
0
        private void BlobTreeMouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                currentNode = blobTree.GetNodeAt(e.X, e.Y);

                if (currentNode != null)
                {
                    if (currentNode is BlobTreeNode)
                        blobContextMenu.Show(blobTree, e.Location);
                    else if (currentNode is ContainerTreeNode)
                    {
                        CloudBlobContainer containerRef = (currentNode as ContainerTreeNode).Container;
                        BlobContainerPermissions containerPermissions = containerRef.GetPermissions();

                        privateToolStripMenuItem.Checked = (containerPermissions.PublicAccess ==
                                                            BlobContainerPublicAccessType.Off);
                        publicBlobsToolStripMenuItem.Checked = (containerPermissions.PublicAccess ==
                                                                BlobContainerPublicAccessType.Blob);
                        publicContainerToolStripMenuItem.Checked = (containerPermissions.PublicAccess ==
                                                                    BlobContainerPublicAccessType.Container);

                        containerContextMenu.Show(blobTree, e.Location);
                    }
                }
            }
        }
 private void teamNumberTextBox_MouseClick(object sender, MouseEventArgs e)
 {
     if (Settings.Default.clickToEmptyTextBoxes)
     {
         teamNumberTextBox.Text = ("");
     }
 }
示例#22
0
 private void ListViewUsersMouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (SelectedUsers.Count > 0)
     {
         ButtonValidateClick(null, null);
     }
 }
示例#23
0
 private void CanvasForm_MouseDown(object sender, MouseEventArgs e)
 {
     allowToDraw = true;
     tmpShape = ShapeFactory.GetShapeInstance(ShapeFactory.GetTypeByNumber(cbType.SelectedIndex), e.X, e.Y, 1, 1, Convert.ToInt16(width.SelectedItem), colorPanel.BackColor);
     tabControlCanvas.SelectedTab.Controls[0].Controls.Add(tmpShape);
     shapeIndex = tabControlCanvas.SelectedTab.Controls[0].Controls.Count - 1;
 }
示例#24
0
 private void ListBoxMouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (listBox.SelectedIndex == -1)
         return;
     DialogResult = DialogResult.OK;
     Close();
 }
示例#25
0
 public override void LeftMousePressed(MouseEventArgs e)
 {
     engine.setInitPos();
     engine.setInitAngle();
     origX = System.Windows.Forms.Control.MousePosition.X;
     origY = System.Windows.Forms.Control.MousePosition.Y;
 }
        private void notifyIcon_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left) return;

            var mi = typeof(NotifyIcon).GetMethod("ShowContextMenu", BindingFlags.Instance | BindingFlags.NonPublic);
            mi.Invoke(_notifyIcon, null);
        }
示例#27
0
文件: UcOpt.cs 项目: burstas/rmps
 private void LlText_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         CmMenu.Show(PlHead, 0, PlHead.Height);
     }
 }
        private void rb_MouseUp(object sender, MouseEventArgs e)
        {
            var fs = ((RibbonButton)sender).Text;
            fontSize = Convert.ToInt32(fs);

            switch (FontSize)
            {
                case 8:
                    fontSize = 1;
                    break;
                case 10:
                    fontSize = 2;
                    break;
                case 12:
                    fontSize = 3;
                    break;
                case 14:
                    fontSize = 4;
                    break;
                case 18:
                    fontSize = 5;
                    break;
                case 24:
                    fontSize = 6;
                    break;
                case 28:
                    fontSize = 7;
                    break;
            }

            TextBoxText = fs;
        }
        public override void OnMouseButton(bool down, MouseEventArgs e)
        {
            int deviceX = 0, deviceY = 0;
            HardwareToDevice(e.X, e.Y, ref deviceX, ref deviceY);

            switch (e.Button)
            {
                case MouseButtons.Left:
                    if (down)
                    {
                        m_Camera.BeginMouseRotate(deviceX, deviceY);
                    }
                    break;
                case MouseButtons.Middle:
                    if (down)
                    {
                        m_Camera.BeginMouseTrack(deviceX, deviceY);
                    }
                    break;
                case MouseButtons.Right:
                    if (down)
                    {
                        m_Camera.BeginMouseZoom(deviceX);
                    }
                    break;
            }
        }
示例#30
0
        private void zarzadzaniePracownicyListBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewHitTestInfo info = zarzadzaniePracownicyListBox.HitTest(e.X, e.Y);
            ListViewItem item = info.Item;

            if (item != null)
            {
                var employee = item.Tag as Employee;
                var employeeForm = new EmployeeForm(employee);
                if (employeeForm.ShowDialog(this) == DialogResult.OK)
                {

                    AsyncTaskRunner task = new AsyncTaskRunner(
                        new Task(
                            () =>
                            {
                                Zarzadzanie_UpdateEmployee(employee);
                            }),
                            () =>
                            {
                                MessageBox.Show("Zaktualizowano dane pracownika: " + employee.Login, "Sukces",
                                                MessageBoxButtons.OK, MessageBoxIcon.Information);

                                Zarzadzanie_UpdatePracownicyListBox();
                            });
                    task.StartInTransaction();
                }

            }
        }
示例#31
0
 private void tabControl1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     DragStartPosition = new Point(e.X, e.Y);
 }
示例#32
0
 private void button48_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     //Change this button's background colour to yellow
     this.button48.BackColor = Color.Yellow;
 }
示例#33
0
 private void button49_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     //Change this button's background colour back to it's default
     this.button49.BackColor = System.Drawing.SystemColors.ActiveCaption;
 }
示例#34
0
 protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
 {
     base.OnMouseUp(e);
     Cap = false;
     Invalidate();
 }
示例#35
0
 /// <summary>
 /// Skils link clicked: show skills menu
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lnkSkill_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     Pandora.Skills.Menu.Show(lnkSkill, new Point(e.X, e.Y));
 }
示例#36
0
 private void mh_MouseMoveEvent(object sender, MouseEventArgs e)
 {
     int x = e.Location.X;
     int y = e.Location.Y;
 }
示例#37
0
 private void mh_MouseClickEvent(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
     }
 }
示例#38
0
 private void Button2_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     Button2.BackColor = Color.LightSteelBlue;
     Button2.FlatStyle = FlatStyle.Popup;
 }
示例#39
0
        private void PictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (ImageCurrent == null)
            {
                return;
            }
            Graphics g = PictureBox1.CreateGraphics();

            switch (displayedDoc.DegreesRotated)
            {
            case 0:
                //
                break;

            case 90:
                g.TranslateTransform(PictureBox1.ClientRectangle.Width, 0);
                g.RotateTransform(90);                        //prepended to matrix transform
                break;

            case 180:
                g.TranslateTransform((float)PictureBox1.ClientRectangle.Width
                                     , (float)PictureBox1.ClientRectangle.Height);
                g.RotateTransform(180);
                break;

            case 270:
                g.TranslateTransform(0, PictureBox1.ClientRectangle.Height);
                g.RotateTransform(270);
                break;
            }
            string whiteSide = GetWhiteSide();          //L,R,T,or B

            //if(ToolBarMain.Buttons["Hand"].Pushed){//hand mode
            if (!MouseIsDown)
            {
                return;
            }
            RecTempZoom = RecZoom;
            //these are the amounts the rectangle moves across the image. They are negative, because
            //as the mouse drags down, the rectangle must move up to expose the upper part of the image.
            int moveX = (int)(-(e.X - MouseDownOrigin.X) * 2 *
                              Math.Abs((decimal)RecZoom.Width) / (decimal)PictureBox1.ClientRectangle.Width);
            //Debug.WriteLine(moveX);
            int moveY = -(e.Y - MouseDownOrigin.Y) * 2 * RecZoom.Height / PictureBox1.ClientRectangle.Height;

            if (displayedDoc.DegreesRotated == 0)
            {
                RecTempZoom.Y = RecZoom.Y + moveY;
                if (displayedDoc.IsFlipped)
                {
                    RecTempZoom.X = RecZoom.X - moveX;
                }
                else                 //normal
                {
                    RecTempZoom.X = RecZoom.X + moveX;
                }
            }
            else if (displayedDoc.DegreesRotated == 90)
            {
                RecTempZoom.Y = RecZoom.Y - moveX;
                if (displayedDoc.IsFlipped)
                {
                    RecTempZoom.X = RecZoom.X - moveY;
                }
                else
                {
                    RecTempZoom.X = RecZoom.X + moveY;
                }
            }
            else if (displayedDoc.DegreesRotated == 180)
            {
                RecTempZoom.Y = RecZoom.Y - moveY;
                if (displayedDoc.IsFlipped)
                {
                    RecTempZoom.X = RecZoom.X + moveX;
                }
                else
                {
                    RecTempZoom.X = RecZoom.X - moveX;
                }
            }
            else if (displayedDoc.DegreesRotated == 270)
            {
                RecTempZoom.Y = RecZoom.Y + moveX;
                if (displayedDoc.IsFlipped)
                {
                    RecTempZoom.X = RecZoom.X + moveY;
                }
                else
                {
                    RecTempZoom.X = RecZoom.X - moveY;
                }
            }
            Rectangle sourceRect = GetSourceRect();
            //remember that white side is considered after the image is already rotated and flipped.
            //BUT: from here on down, white side will be relative to RecZoom BEFORE rotation and flip.
            //Yes, this is confusing, but I'd like to see anyone come up with something better.
            //these track whether there was whitespace when the drag was started.
            bool startedWhiteR = false;
            bool startedWhiteL = false;
            bool startedWhiteB = false;

            if (RecZoom.Y + RecZoom.Height > ImageCurrent.Height)
            {
                if (displayedDoc.DegreesRotated == 0 && whiteSide == "B")
                {
                    startedWhiteB = true;
                }
                else if (displayedDoc.DegreesRotated == 90 && whiteSide == "L")
                {
                    startedWhiteB = true;
                }
                else if (displayedDoc.DegreesRotated == 180 && whiteSide == "T")
                {
                    startedWhiteB = true;
                }
                else if (displayedDoc.DegreesRotated == 270 && whiteSide == "R")
                {
                    startedWhiteB = true;
                }
            }
            if (RecZoom.X + RecZoom.Width > ImageCurrent.Width)
            {
                if (displayedDoc.DegreesRotated == 0 && whiteSide == "R")
                {
                    startedWhiteR = true;
                }
                else if (displayedDoc.DegreesRotated == 90 && whiteSide == "B")
                {
                    startedWhiteR = true;
                }
                else if (displayedDoc.DegreesRotated == 180 && whiteSide == "L")
                {
                    startedWhiteR = true;
                }
                else if (displayedDoc.DegreesRotated == 270 && whiteSide == "T")
                {
                    startedWhiteR = true;
                }
            }
            if (RecZoom.X + RecZoom.Width < 0)        //width is neg because only for flipped
            {
                if (displayedDoc.DegreesRotated == 0 && whiteSide == "L")
                {
                    startedWhiteL = true;
                }
                else if (displayedDoc.DegreesRotated == 90 && whiteSide == "T")
                {
                    startedWhiteL = true;
                }
                else if (displayedDoc.DegreesRotated == 180 && whiteSide == "R")
                {
                    startedWhiteL = true;
                }
                else if (displayedDoc.DegreesRotated == 270 && whiteSide == "B")
                {
                    startedWhiteL = true;
                }
            }
            //limit movement to right
            if (startedWhiteR)
            {
                //same for flipped and regular
                if (RecTempZoom.X > RecZoom.X)
                {
                    RecTempZoom.X = RecZoom.X;
                }
            }
            else
            {
                if (displayedDoc.IsFlipped)
                {
                    if (RecTempZoom.X > ImageCurrent.Width)
                    {
                        RecTempZoom.X = ImageCurrent.Width;
                    }
                }
                else
                {
                    if (RecTempZoom.X + RecTempZoom.Width > ImageCurrent.Width)
                    {
                        RecTempZoom.X = ImageCurrent.Width - RecTempZoom.Width;
                    }
                }
            }
            //limit movement to left
            if (startedWhiteL)
            {
                //same for flipped and regular
                if (RecTempZoom.X < RecZoom.X)
                {
                    RecTempZoom.X = RecZoom.X;
                }
            }
            else
            {
                if (displayedDoc.IsFlipped)
                {
                    if (RecTempZoom.X + RecTempZoom.Width < 0)
                    {
                        RecTempZoom.X = -RecTempZoom.Width;
                    }
                }
                else
                {
                    if (RecTempZoom.X < 0)
                    {
                        RecTempZoom.X = 0;
                    }
                }
            }
            //limit movement to bottom
            if (startedWhiteB)
            {
                if (RecTempZoom.Y > RecZoom.Y)
                {
                    RecTempZoom.Y = RecZoom.Y;
                }
            }
            else
            {
                if (RecTempZoom.Y + RecTempZoom.Height > ImageCurrent.Height)
                {
                    RecTempZoom.Y = ImageCurrent.Height - RecTempZoom.Height;
                }
            }
            //limit movement to top.
            if (RecTempZoom.Y < 0)
            {
                RecTempZoom.Y = 0;
            }
            //draw
            if (displayedDoc.DegreesRotated == 0 || displayedDoc.DegreesRotated == 180)
            {
                g.DrawImage(ImageCurrent
                            , new Rectangle(0, 0, PictureBox1.ClientRectangle.Width, PictureBox1.ClientRectangle.Height)
                            , RecTempZoom, GraphicsUnit.Pixel);
            }
            else             //90 or 270
            {
                g.DrawImage(ImageCurrent
                            , new Rectangle(0, 0, PictureBox1.ClientRectangle.Height, PictureBox1.ClientRectangle.Width)
                            , RecTempZoom, GraphicsUnit.Pixel);
            }
            g.Dispose();
        }        //end mousemove
 protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
 {
     base.OnMouseUp(e);
     State = MouseState.Over;
     Invalidate();
 }
 private void OnNotifyIconDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     this.Show();
     WindowState = wsl;
 }
示例#42
0
        }        //end mousemove

        private void PictureBox1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            MouseIsDown = false;
            RecZoom     = RecTempZoom;
        }
 private void OnMouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     OnRaiseEvent(MouseDownEvent, new MouseButtonEventArgs(
                      InputManager.Current.PrimaryMouseDevice, 0, ToMouseButton(e.Button)));
 }
 private void pic_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     med.mouseUp(e.X, e.Y);
 }
示例#45
0
 // When the mouse has been pressed, set clicked to true and set the first point.
 private void Capture_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     clicked = true;
     point1  = new Point(e.X, e.Y);
 }
示例#46
0
 internal override void OnMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
 }
示例#47
0
        private void OnMouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            int xPos;

            if (e.Y < 18)
            {
                xPos = e.X / 17;
                if (OnClick != null)
                {
                    selectedColor = xPos;
                    hostPanel.Invalidate();
                    OnClick(xPos);
                }
            }
            else if ((e.Y > 19) && e.Y < 38)
            {
                xPos = e.X / 17;
                if (OnClick != null)
                {
                    selectedColor = xPos + 12;
                    hostPanel.Invalidate();
                    OnClick(xPos + 12);
                }
            }
            else if ((e.Y > 39) && e.Y < 58)
            {
                xPos = e.X / 17;
                if (OnClick != null)
                {
                    selectedColor = xPos + 24;
                    hostPanel.Invalidate();
                    OnClick(xPos + 24);
                }
            }
            else if ((e.Y > 59) && e.Y < 79)
            {
                xPos = e.X / 17;
                if (OnClick != null)
                {
                    selectedColor = xPos + 36;
                    hostPanel.Invalidate();
                    OnClick(xPos + 36);
                }
            }
            else if ((e.Y > 79) && e.Y < 99)
            {
                xPos = e.X / 17;
                if (OnClick != null)
                {
                    selectedColor = xPos + 48;
                    hostPanel.Invalidate();
                    OnClick(xPos + 48);
                }
            }
            else if ((e.Y > 99) && e.Y < 119)
            {
                xPos = e.X / 17;
                if (OnClick != null)
                {
                    selectedColor = xPos + 60;
                    hostPanel.Invalidate();
                    OnClick(xPos + 60);
                }
            }
        }
示例#48
0
 private void labelHook_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     this.ProcessClick(e);
 }
        //mouse event method
        private void matrix_Base_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            int iX = e.X / m_iSize;
            int iY = e.Y / m_iSize;

            if (iX < m_iColDimensions && iX >= 0 && iY < m_iRowDimensions && iY >= 0)
            {
                if (this.addWall.Checked == true)
                {
                    //walls can be added along the Y-Axis and the X-Axis
                    m_iMaze = m_Maze.GetMaze;
                    if (m_iMaze[iY, iX] == 0)
                    {
                        m_iMaze[iY, iX] = 1;
                    }
                    else
                    {
                        m_iMaze[iY, iX] = 0;
                    }
                    //refreshing the grid to have no walls
                    this.Refresh();
                }
                else
                {
                    if (m_iMaze[iY, iX] == 100) //if path exists
                    {
                        //move step by step until the required position is achieved
                        while (this.iSelectedX != iX || this.iSelectedY != iY)
                        {
                            m_iMaze[this.iSelectedY, this.iSelectedX] = 0;

                            if (this.iSelectedX - 1 >= 0 && this.iSelectedX - 1 < m_iColDimensions && m_iMaze[this.iSelectedY, this.iSelectedX - 1] == 100)
                            {
                                this.iSelectedX--;
                            }
                            else if (this.iSelectedX + 1 >= 0 && this.iSelectedX + 1 < m_iColDimensions && m_iMaze[this.iSelectedY, this.iSelectedX + 1] == 100)
                            {
                                this.iSelectedX++;
                            }
                            else if (this.iSelectedY - 1 >= 0 && this.iSelectedY - 1 < m_iRowDimensions && m_iMaze[this.iSelectedY - 1, this.iSelectedX] == 100)
                            {
                                this.iSelectedY--;
                            }
                            else if (this.iSelectedY + 1 >= 0 && this.iSelectedY + 1 < m_iRowDimensions && m_iMaze[this.iSelectedY + 1, this.iSelectedX] == 100)
                            {
                                this.iSelectedY++;
                            }

                            // move diagonal
                            else if (this.iSelectedY + 1 >= 0 && this.iSelectedY + 1 < m_iRowDimensions && this.iSelectedX + 1 >= 0 && this.iSelectedX + 1 < m_iColDimensions && m_iMaze[this.iSelectedY + 1, this.iSelectedX + 1] == 100)
                            {
                                this.iSelectedX++; this.iSelectedY++;
                            }
                            else if (this.iSelectedY - 1 >= 0 && this.iSelectedY - 1 < m_iRowDimensions && this.iSelectedX + 1 >= 0 && this.iSelectedX + 1 < m_iColDimensions && m_iMaze[this.iSelectedY - 1, this.iSelectedX + 1] == 100)
                            {
                                this.iSelectedX++; this.iSelectedY--;
                            }
                            else if (this.iSelectedY + 1 >= 0 && this.iSelectedY + 1 < m_iRowDimensions && this.iSelectedX - 1 >= 0 && this.iSelectedX - 1 < m_iColDimensions && m_iMaze[this.iSelectedY + 1, this.iSelectedX - 1] == 100)
                            {
                                this.iSelectedX--; this.iSelectedY++;
                            }
                            else if (this.iSelectedY - 1 >= 0 && this.iSelectedY - 1 < m_iRowDimensions && this.iSelectedX - 1 >= 0 && this.iSelectedX - 1 < m_iColDimensions && m_iMaze[this.iSelectedY - 1, this.iSelectedX - 1] == 100)
                            {
                                this.iSelectedX--; this.iSelectedY--;
                            }

                            this.Refresh();
                        }
                    }
                }
            }
        }
 protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
 {
     base.OnMouseMove(e);
     Mouse = e.Location;
     Invalidate();
 }
 private void DataGrid_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     sSelectedID = DataGrid[DataGrid.CurrentRowIndex, 0].ToString();
     this.Close();
 }
示例#52
0
 private void WButtonEdit_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     this.Invalidate(false);
 }
 // event for DoubleClick in the ListBox
 private void listBox_MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     // select the current item
     SelectItem();
 }
示例#54
0
 public void MouseUp(System.Windows.Forms.MouseEventArgs e)
 {
 }
示例#55
0
 protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
 {
     m_State = eButtonState.Down;
     this.Invalidate();
     base.OnMouseDown(e);
 }
示例#56
0
 private void TextArea_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     updateStatusBar();
     UpdateMenuItem();
 }
示例#57
0
 // chon ban cu de ghep
 void gridViewDm_Table_Old_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     DevExpress.XtraGrid.Views.Card.ViewInfo.CardHitInfo cardHit = gridViewDm_Table_Old.CalcHitInfo(e.X, e.Y);
     if (cardHit.InCard)
     {
         try
         {
             lblStatus_Bar.Text = "";
             DataRow drChons_Old2 = gridViewDm_Table_Old.GetDataRow(cardHit.RowHandle);
             identity_Old = drChons_Old2["Id_Table"];
             if (drChons_Old2["Id_Booking"] != null && drChons_Old2["Id_Booking"].ToString() != "")
             {
                 lblStatus_Bar.Text = "Bàn có booking, không được chọn bàn này để ghép";
                 return;
             }
             if (drChons_Old2["Lock"].ToString() != "")
             {
                 if ((bool)drChons_Old2["Lock"])
                 {
                     lblStatus_Bar.Text = "Bàn này đã in hóa đơn, liên hệ với quản lý để thay đổi";
                     GoobizFrame.Windows.Forms.Policy.Authorization.Actions Actions = GoobizFrame.Windows.MdiUtils.MdiChecker.ShowIDCardLogonWithResult(this);
                     if (Actions.Count == 0 || !Actions.Contains("EnableUnlock"))
                     {
                         lblStatus_Bar.Text = "Tài khoản không hợp lệ";
                         return;
                     }
                     else
                     {
                         lblStatus_Bar.Text = "";
                     }
                 }
             }
             if (dsTable_Order_Old_2.Tables[0].Rows.Count == 0)
             {
                 dsTable_Order_Old_2.Tables[0].ImportRow(gridViewDm_Table_Old.GetDataRow(cardHit.RowHandle));
                 if (drChons_New == null)
                 {
                     return;
                 }
                 performMerge(position);
             }
             else
             {
                 for (int i = 0; i < dsTable_Order_Old_2.Tables[0].Rows.Count; i++)
                 {
                     if (dsTable_Order_Old_2.Tables[0].Rows[i]["Id_Table_Order"].Equals(gridViewDm_Table_Old.GetDataRow(cardHit.RowHandle)["Id_Table_Order"]))
                     {
                         break;
                     }
                     if (i == dsTable_Order_Old_2.Tables[0].Rows.Count - 1)
                     {
                         dsTable_Order_Old_2.Tables[0].ImportRow(gridViewDm_Table_Old.GetDataRow(cardHit.RowHandle));
                         if (drChons_New == null)
                         {
                             return;
                         }
                         performMerge(position);
                     }
                 }
             }
         }
         catch (Exception ex) { GoobizFrame.Windows.TrayMessage.TrayMessage.Status = new GoobizFrame.Windows.TrayMessage.TrayMessageInfo(MessageBoxIcon.Asterisk, ex.Message, ex.ToString()); }
     }
 }
示例#58
0
        private void ListBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            ListBox listBox = sender as ListBox;

            listBox.SelectedIndex = listBox.IndexFromPoint(e.Location);
        }
示例#59
0
 private void tableLayoutPanel1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     OnMouseUp(e);
 }
示例#60
0
 private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     ReleaseCapture();
     SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
 }