CNiAnnotations

CNi

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

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

CNiAnnotations encapsulates the interface to the Annotations property of a CNiGraph object, which allows you to access and remove annotations 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 annotations in the collection.

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

Public constructor

CNiAnnotations()

Default constructor.
Public constructor

CNiAnnotations( CWAnnotations_CI* pCustom, CNiInterface::ThreadAccess option )

Constructor that attaches to the specified CWAnnotations_CI pointer.
Public constructor

CNiAnnotations( const CNiAnnotations& source )

Copy constructor.

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

Public destructor

~CNiAnnotations()

Destructor.

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

Public function CNiAnnotation

Add()

Adds an annotation to the collection and returns the new annotation.
Public function static const IID &

GetIid()

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

Item( long annotationIndex )

Returns the specified annotation from the collection.
Public function CNiAnnotation

Item( const CString& annotationName )

Returns the specified annotation from the collection.
Public function const CNiAnnotations &

operator =( const CNiAnnotations& source )

Assignment operator.
Public function void

Remove( long annotationIndex )

Removes the specified annotation from the collection.
Public function void

Remove( const CString& annotationName )

Removes the specified annotation from the collection.
Public function void

RemoveAll()

Removes all annotations from the collection.

Shortcut to top of page. Examples

1. Set the text and visibility of the first annotation on the graph.

    CNiGraph graph;
    CNiAnnotation annotation = graph.Annotations.Item(1);
    annotation.Caption.Text    = "Critical Point";
    annotation.Visible = true;

2. Set the arrow head style.

    CNiGraph graph;
    graph.Annotations.Item(1).Arrow.HeadStyle = CNiArrow::Solid;

3. Add an additional annotation to the graph and hide it.

    CNiGraph graph;
    CNiAnnotation annotation = graph.Annotations.Add();
    annotation.Visible = false;

4. Remove all annotations from the graph.

    CNiGraph graph;
    graph.Annotations.RemoveAll();

5. Change the name of the first annotation.

    CNiGraph graph;
    graph.Annotations.Item(1).Name = "Time";

Subsequent accesses to this annotation must now use "Time" for its name. For example,

    graph.Annotations.Item("Time").Visible = true;