![]() |
CNiAnnotations | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: NiAnnotations.h |
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.
Base Classes
Data Items
![]() |
short | Count | Returns the number of annotations in the collection. |
Constructors
![]() |
Default constructor. | ||
![]() |
CNiAnnotations( CWAnnotations_CI* pCustom, CNiInterface::ThreadAccess option ) |
Constructor that attaches to the specified CWAnnotations_CI pointer. | |
![]() |
CNiAnnotations( const CNiAnnotations& source ) |
Copy constructor. |
Destructors
Functions
![]() |
CNiAnnotation | Add() |
Adds an annotation to the collection and returns the new annotation. |
![]() |
static const IID & | GetIid() |
Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects. |
![]() |
CNiAnnotation | Item( long annotationIndex ) |
Returns the specified annotation from the collection. |
![]() |
CNiAnnotation | Returns the specified annotation from the collection. | |
![]() |
const CNiAnnotations & | Assignment operator. | |
![]() |
void | Remove( long annotationIndex ) |
Removes the specified annotation from the collection. |
![]() |
void | Removes the specified annotation from the collection. | |
![]() |
void | Removes all annotations from the collection. |
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;