CNiCursors

CNi

Class CNiCursors Base ClassesData ItemsConstructorsDestructorsFunctionsGo to hierarchy chart    Prev page: RemoveAllNext page: Count    
Class Declared in:
NiCursors.h

'Overview' icon -- Shortcut to top of page. 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.

Hierarchy Chart Hierarchy Chart

'Base Classes' icon -- Shortcut to top of page. Base Classes

'Data Items' icon -- Shortcut to top of page. Data Items

Public data short Count Returns the number of cursors in the collection.

'Constructors' icon -- Shortcut to top of page. Constructors

Public constructor

CNiCursors()

Default constructor.
Public constructor

CNiCursors( CWCursors_CI* pCustom, CNiInterface::ThreadAccess option )

Constructor that attaches to the specified CWCursors_CI pointer.
Public constructor

CNiCursors( const CNiCursors& source )

Copy constructor.

'Destructors' icon -- Shortcut to top of page. Destructors

Public destructor

~CNiCursors()

Destructor.

'Functions' icon -- Shortcut to top of page. Functions

Public function CNiCursor

Add()

Adds a cursor to the collection and returns the new cursor.
Public function static const IID &

GetIid()

Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects.
Public function CNiCursor

Item( long cursorIndex )

Returns the specified cursor from the collection.
Public function CNiCursor

Item( const CString& cursorName )

Returns the specified cursor from the collection.
Public function const CNiCursors &

operator =( const CNiCursors& source )

Assignment operator.
Public function void

Remove( long cursorIndex )

Removes the specified cursor from the collection.
Public function void

Remove( const CString& cursorName )

Removes the specified cursor from the collection.
Public function void

RemoveAll()

Removes all cursors from the collection.

Shortcut to top of page. 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;