Beispiel #1
0
        /// <summary>
        /// Handle mouse hover over an item to display a tooltip.
        /// </summary>
        protected override void OnMouseHover(EventArgs e)
        {
            base.OnMouseHover(e);
            CanvasElementBase item = CanvasItemLayout.ItemFromPosition(_lastMousePosition);

            if (item != null && item.HasToolTip)
            {
                _tooltip.Show(item.ToolTipString, this, _lastMousePosition.X + 16, _lastMousePosition.Y, 2500);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handle mouse movement to set the cursor.
        /// </summary>
        protected override void OnMouseMove(MouseEventArgs e)
        {
            if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
            {
                if (_dragBoxFromMouseDown != Rectangle.Empty && !_dragBoxFromMouseDown.Contains(e.X, e.Y))
                {
                    // OK - it is definitely a drag so handle it as such.
                    DoDragDrop(this, DragDropEffects.All | DragDropEffects.Link);
                    return;
                }
            }

            base.OnMouseMove(e);
            CanvasElementBase item = CanvasItemLayout.ItemFromPosition(e.Location);

            Cursor             = (item != null && item.ID != ActionID.None) ? Cursors.Hand : Cursors.Default;
            _lastMousePosition = e.Location;
        }
Beispiel #3
0
 /// <summary>
 /// Handle mouse clicks on the control.
 /// </summary>
 /// <param name="e">Mouse event argument</param>
 protected override void OnMouseClick(MouseEventArgs e)
 {
     _view.HandleSelect(this, CanvasItemLayout.ItemFromPosition(e.Location));
 }