Jump to content
Software FX Community

Annotation extension


User (Legacy)

Recommended Posts

The help file says:

If you want to add the annotation extension programmatically, just use the

AddExtension method, as follows:

AnnotX= ChartFX1.AddExtension "AnnotationX.AnnList"

but when my VFP code runs:

THIS.ioAnnotX = THIS.AddExtension ("AnnotationX.AnnList")

where ioAnnotX is a custom property, it adds the annotation toolbar to

the chart but then

THIS.ioAnnotX.Toolbar = FALSE

fails because THIS.ioAnnotX contains an empty character string and not an

object reference. Have I misunderstood? What am I doing wrong?

Also where are constants like OBJECT_TYPE_GROUP defined? I can't find them

in the trial version I'm testing.

Andy

post-2107-13922394650333_thumb.jpg

Link to comment
Share on other sites

The help files seem a bit inconsistent on this issue!  But either way I 

can't get an object handle to the extension..

THIS.ioAnnotX = THIS.GetExtension ("AnnotateX.AnnList")

Gives OLE error code 0x800401f3: Invalid class string

and

THIS.ioAnnotX = THIS.GetExtension ("AnnotationX.AnnList")

gives "Function argument, value, type, or count is invalid"

The help file says

This help was last revised on September 26, 2001

Is ChartFX client-server likely to see any further development?

Andy

Link to comment
Share on other sites

Answer via email:

I was able to add an annotation circle using the following code. I think

you just need to create the annotation list using the CREATEOBJECT method,

then add the extension to the chart:

LOCAL loAnnotation, loCircle

loAnnotation = CREATEOBJECT('AnnotationX.AnnList')

THISFORM.OleControl1.AddExtension(loAnnotation)

loCircle = loAnnotation.Add(OBJECT_TYPE_CIRCLE)

loCircle.Top = 100

loCircle.Left = 50

loCircle.Height = 30

loCircle.Width = 30

Also, make sure you specify a height and width. I think they default to 0

and you will not see the object.

Here are the constants for the Annotation objects:

&&Annotation Objects

#define OBJECT_TYPE_RECT 1

#define OBJECT_TYPE_CIRCLE 2

#define OBJECT_TYPE_ARROW 3

#define OBJECT_TYPE_ARC 4

#define OBJECT_TYPE_PICTURE 5

#define OBJECT_TYPE_TEXT 6

#define OBJECT_TYPE_BALLOON 7

#define OBJECT_TYPE_GROUP 8

You can include these into your CFXOCX.Prg or use the integer value

directly.

Kind regards,

Rob

Software FX, Inc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...