![]() |
CNiCursors | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: NiCursors.h |
Overview
CNiCursors encapsulates the interface to the Cursors property of a CNiGraph object, which allows you to access and remove cursors associated with the graph control.
Base Classes
Data Items
![]() |
short | Count | Returns the number of cursors in the collection. |
Constructors
![]() |
Default constructor. | ||
![]() |
CNiCursors( CWCursors_CI* pCustom, CNiInterface::ThreadAccess option ) |
Constructor that attaches to the specified CWCursors_CI pointer. | |
![]() |
CNiCursors( const CNiCursors& source ) |
Copy constructor. |
Destructors
Functions
![]() |
CNiCursor | Add() |
Adds a cursor to the collection and returns the new cursor. |
![]() |
static const IID & | GetIid() |
Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects. |
![]() |
CNiCursor | Item( long cursorIndex ) |
Returns the specified cursor from the collection. |
![]() |
CNiCursor | Returns the specified cursor from the collection. | |
![]() |
const CNiCursors & | Assignment operator. | |
![]() |
void | Remove( long cursorIndex ) |
Removes the specified cursor from the collection. |
![]() |
void | Removes the specified cursor from the collection. | |
![]() |
void | Removes all cursors from the collection. |
Examples
1. Set the snap mode and visibility of the first cursor on the graph.
CNiGraph graph; CNiCursor cursor = graph.Cursors.Item(1); cursor.SnapMode = CNiCursor::SnapNearestPoint; cursor.Visible = true;
2. Set the crosshair style.
CNiGraph graph; graph.Cursors.Item(1).CrosshairStyle = CNiCursor::CrosshairMinorXMinorY;
3. Add an additional cursor to the graph and hide it.
CNiGraph graph; CNiCursor cursor = graph.Cursors.Add(); cursor.Visible = false;
4. Remove all cursors from the graph.
CNiGraph graph; graph.Cursors.RemoveAll();
5. Change the name of the first cursor.
CNiGraph graph; graph.Cursors.Item(1).Name = "Time";
Subsequent accesses to this cursor must now use "Time" for its name. For example,
graph.Cursors.Item("Time").Visible = true;