Пример #1
0
 /// <summary>
 /// Raises the <see cref="Control.MouseLeave"></see> event.
 /// </summary>
 /// <param name="e">An <see cref="EventArgs"></see> that contains the event data.</param>
 protected override void OnMouseLeave(EventArgs e)
 {
     base.OnMouseLeave(e);
     Cursor = Cursors.Default;
     if (_lastMouseInMargin != null)
     {
         _lastMouseInMargin.HandleMouseLeave(EventArgs.Empty);
         _lastMouseInMargin = null;
     }
     CloseToolTip();
 }
Пример #2
0
        /// <summary>
        /// Raises the <see cref="Control.MouseMove"></see> event.
        /// </summary>
        /// <param name="e">A <see cref="MouseEventArgs"></see> that contains the event data.</param>
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (!_toolTipRectangle.Contains(e.Location))
            {
                _toolTipRectangle = Rectangle.Empty;
                if (_toolTipActive)
                {
                    RequestToolTip(e.Location);
                }
            }
            foreach (AbstractMargin margin in _leftMargins)
            {
                if (margin.DrawingPosition.Contains(e.X, e.Y))
                {
                    Cursor = margin.Cursor;
                    margin.HandleMouseMove(e);
                    if (_lastMouseInMargin != margin)
                    {
                        if (_lastMouseInMargin != null)
                        {
                            _lastMouseInMargin.HandleMouseLeave(EventArgs.Empty);
                        }

                        _lastMouseInMargin = margin;
                    }
                    return;
                }
            }
            if (_lastMouseInMargin != null)
            {
                _lastMouseInMargin.HandleMouseLeave(EventArgs.Empty);
                _lastMouseInMargin = null;
            }
            if (_textView.DrawingPosition.Contains(e.X, e.Y))
            {
                TextLocation realmousepos = TextView.GetLogicalPosition(e.X - TextView.DrawingPosition.X, e.Y - TextView.DrawingPosition.Y);
                if (SelectionManager.IsSelected(Document.PositionToOffset(realmousepos)) && MouseButtons == MouseButtons.None)
                {
                    // mouse is hovering over a selection, so show default mouse
                    Cursor = Cursors.Default;
                }
                else
                {
                    // mouse is hovering over text area, not a selection, so show the textView cursor
                    Cursor = _textView.Cursor;
                }
                return;
            }
            Cursor = Cursors.Default;
        }
Пример #3
0
        /// <summary>
        /// Raises the <see cref="Control.MouseMove"></see> event.
        /// </summary>
        /// <param name="e">A <see cref="MouseEventArgs"></see> that contains the event data.</param>
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
              if (!_toolTipRectangle.Contains(e.Location))
              {
            _toolTipRectangle = Rectangle.Empty;
            if (_toolTipActive)
              RequestToolTip(e.Location);
              }
              foreach (AbstractMargin margin in _leftMargins)
              {
            if (margin.DrawingPosition.Contains(e.X, e.Y))
            {
              Cursor = margin.Cursor;
              margin.HandleMouseMove(e);
              if (_lastMouseInMargin != margin)
              {
            if (_lastMouseInMargin != null)
              _lastMouseInMargin.HandleMouseLeave(EventArgs.Empty);

            _lastMouseInMargin = margin;
              }
              return;
            }
              }
              if (_lastMouseInMargin != null)
              {
            _lastMouseInMargin.HandleMouseLeave(EventArgs.Empty);
            _lastMouseInMargin = null;
              }
              if (_textView.DrawingPosition.Contains(e.X, e.Y))
              {
            TextLocation realmousepos = TextView.GetLogicalPosition(e.X - TextView.DrawingPosition.X, e.Y - TextView.DrawingPosition.Y);
            if (SelectionManager.IsSelected(Document.PositionToOffset(realmousepos)) && MouseButtons == MouseButtons.None)
            {
              // mouse is hovering over a selection, so show default mouse
              Cursor = Cursors.Default;
            }
            else
            {
              // mouse is hovering over text area, not a selection, so show the textView cursor
              Cursor = _textView.Cursor;
            }
            return;
              }
              Cursor = Cursors.Default;
        }
Пример #4
0
 /// <summary>
 /// Raises the <see cref="Control.MouseLeave"></see> event.
 /// </summary>
 /// <param name="e">An <see cref="EventArgs"></see> that contains the event data.</param>
 protected override void OnMouseLeave(EventArgs e)
 {
     base.OnMouseLeave(e);
       Cursor = Cursors.Default;
       if (_lastMouseInMargin != null)
       {
     _lastMouseInMargin.HandleMouseLeave(EventArgs.Empty);
     _lastMouseInMargin = null;
       }
       CloseToolTip();
 }
Пример #5
0
 /// <summary>
 /// Inserts the left margin.
 /// </summary>
 /// <param name="index">The index.</param>
 /// <param name="margin">The margin.</param>
 internal void InsertLeftMargin(int index, AbstractMargin margin)
 {
     _leftMargins.Insert(index, margin);
       Refresh();
 }
Пример #6
0
 /// <summary>
 /// Inserts the left margin.
 /// </summary>
 /// <param name="index">The index.</param>
 /// <param name="margin">The margin.</param>
 internal void InsertLeftMargin(int index, AbstractMargin margin)
 {
     _leftMargins.Insert(index, margin);
     Refresh();
 }