![]() |
CNiCursor | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: NiCursor.h |
Overview
CNiCursor encapsulates the interface to a single cursor on a graph control, which allows you to modify its appearance and behavior.
Individual cursors are obtained via the Cursors property on a CNiGraph object.
Note: To specify a date/time value, you must convert your date or time value to a double. A date is implemented as a floating-point value with the integer part of the number measuring days from midnight, 30 December 1899, and the fractional part representing the time of day. The absolute value of the fractional part of the number represents the time as a fraction of a day. Thus, 1 second equals 1 / 24 hours / 60 minutes, which is 1/86400 or approximately 1.157407e-5. So, midnight, 31 December 1899, is represented by 1.0. Similarly, 6 AM, 1 January 1900, is represented by 2.25, and midnight, 29 December 1899, is -1.0. However, 6 AM, 29 December 1899, is -1.25.
Base Classes
Data Items
![]() |
CNiColor | Color | Specifies the color of the cursor crosshair and point. |
![]() |
CrosshairStyles | CrosshairStyle | Specifies the type of lines that identify the cursor position. |
![]() |
bool | Enabled | Specifies if the cursor generates mouse events or if you can drag the cursor in cursor tracking mode. |
![]() |
CString | Name | Specifies the name of the cursor. |
![]() |
CNiPlot | Plot | Specifies the plot associated with the cursor. |
![]() |
long | PointIndex | Specifies the point associated with the cursor on the plot. |
![]() |
PointStyles | PointStyle | Specifies the cursor point style. |
![]() |
SnapModes | SnapMode | Specifies the snap mode of the cursor. |
![]() |
bool | Visible | Specifies if the cursor is visible or hidden. |
![]() |
double | XPosition | Current x axis position of the cursor. |
![]() |
double | YPosition | Current y axis position of the cursor. |
Constructors
![]() |
Default constructor. | ||
![]() |
CNiCursor( CWCursor_CI* pCustom, CNiInterface::ThreadAccess option ) |
Constructor that attaches to the specified CWCursor_CI pointer. | |
![]() |
CNiCursor( const CNiCursor& source ) |
Copy constructor. |
Destructors
Functions
![]() |
static const IID & | GetIid() |
Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects. |
![]() |
const CNiCursor & | Assignment operator. | |
![]() |
void | SetPosition( double xPosition, double yPosition ) |
Sets the x and y axis positions of the cursor at the same time. |
Example
// Change the snap mode of the first cursor on the graph.
CNiGraph graph; CNiCursor cursor = graph.Cursors.Item(1); cursor.SnapMode = CNiCursor::SnapNearestPoint;