GoDiagram Win Reference
GoRulerCursor Class
Members  Example 

Provides functionality for drawing cursors (special marks) onto a GoRuler. The Value property can be changed dynamically to have the cursor "follow" the mouse or some object in the view.
Syntax
'Declaration
 
Public Class GoRulerCursor 
public class GoRulerCursor 
Example
This custom-painting cursor displays as a triangle. You can install such cursors on your GoRulers by calling GoRuler.AddCursor.
public class TriangleCursor : GoRulerCursor {
  public TriangleCursor() {
    this.Size = new Size(10, 20);
    this.ForeColor = Color.Blue;
    this.BackColor = Color.LightBlue;
  }
            
  public override void Paint(Graphics g, GoRuler ruler, float measure) {
    Pen p = new Pen(this.ForeColor, 0);
    Brush b = new SolidBrush(this.BackColor);
            
    Rectangle r = ruler.DisplayRectangle;
    float left = measure - this.Width/2.0f;
    float right = measure + this.Width/2.0f;
            
    PointF[] pts;
    if (ruler.Orientation == Orientation.Horizontal)
      pts = new PointF[] {new PointF(left, r.Y), new PointF(right, r.Y), new PointF(measure, r.Bottom)};
    else
      pts = new PointF[] {new PointF(r.X, left), new PointF(r.X, right), new PointF(r.Right, measure)};
            
    g.FillPolygon(b, pts);
    g.DrawPolygon(p, pts);
            
    b.Dispose();
    p.Dispose();
  }
}
Inheritance Hierarchy

System.Object
   Northwoods.Go.Draw.GoRulerCursor

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GoRulerCursor Members
Northwoods.Go.Draw Namespace

 

 


© 2015. Northwoods Software Corporation. All Rights Reserved.

Send Feedback