Hi,
I'm using CwGraph 7.1.0 (306) (602) with LW/CVI 7.0 under Windows XP.
I have a CwGraph object with 4 plots on it, each of them being associated with its own Y-axis.
The bug I'm experiencing is that the coordinates used to place the cwCaption object always scale to the first plot even though I associate the cwAnnotation
object with another plot.
Here is a code snippet:
/* cwAnnotation and cwCaption object handles */
ret = CWUIControlsLib_CWAnnotationsAdd (annotationsHandle, NULL, &annotationHandle);
ret = CWUIControlsLib_CWAnnotationGetCaption (annotationHandle, NULL, &captionHandle);
/* Set caption text */
ret = CWUIControlsLib_CWCaptionSetText (captionHandle, NULL, "test");
/* Annotation coordinate type */
ret = CWUIControlsLib_CWAnnotationSetCoordinateType (annotationHandle, NULL, CWUIControlsLibConst_cwAxesCoordinates);
/* Associate annotation with a valid plot - That's the point that doesn't seem to work... */
ret = CWUIControlsLib_CWAnnotationSetPlot (annotationHandle, NULL, plot[activePlot]);
/* Snap mode */
ret = CWUIControlsLib_CWAnnotationSetSnapMode (annotationHandle, NULL, CWUIControlsLibConst_cwCSnapPointsOnPlot);
/* Position the caption - the Y coordinate scales to the 1st plot even when cwAnnotation has been associated with a different plot!!! */
ret = CWUIControlsLib_CWCaptionSetCoordinates (captionHandle, NULL, xPos, yPos);
All the return values equal 0. plot is a valid array of CAObjHandle. It is used elsewhere and it points on right plots. xPos and yPos are the right coordinates.
The code actually "works" because I can see the annotation appear on the cwGraph. The X coordinate is right since I have only 1 X axis.
The problem is that its Y coordinate is wrong (when I associate plot 2, 3 or 4) since it *ALWAYS* scales to the 1st plot.
I've looked at the VB examples for annotations but there is always only 1 plot used.
Is there a hotfix for this problem? I've been looking through the forum and KB, but nothing useful came up.
Any help would be greatly appreciated.
Regards,
svk