示例#1
0
 protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
 {
     base.OnMouseMove(e);
     foreach (AbstractMargin margin in leftMargins)
     {
         if (margin.DrawingPosition.Contains(e.X, e.Y))
         {
             this.Cursor = margin.Cursor;
             margin.HandleMouseMove(new Point(e.X, e.Y), e.Button);
             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))
     {
         this.Cursor = textView.Cursor;
         return;
     }
     this.Cursor = Cursors.Default;
 }
示例#2
0
 public void Refresh(AbstractMargin margin)
 {
     updateMargin = margin;
     Invalidate(updateMargin.DrawingPosition);
     Update();
     updateMargin = null;
 }
示例#3
0
 protected override void OnMouseLeave(System.EventArgs e)
 {
     base.OnMouseLeave(e);
     this.Cursor = Cursors.Default;
     if (lastMouseInMargin != null)
     {
         lastMouseInMargin.HandleMouseLeave(EventArgs.Empty);
         lastMouseInMargin = null;
     }
 }