I am using CWGraph imported as an ActiveX component in Borland C++Builder 6. I am unable to set the Text property in CWCaption. Should I be able to set this programmatically in the MouseOver event, or is it only available at design time?
I assume that you want to change the caption of an annotation when the user mouses over the annotation. This is possible. The key is that you have to set CWGraph::TrackMode to cwGTrackAllEvents. This corresponds to "Plot & Cursor Events" in the property pages (admittedly not the best name for this track mode).
The following code in VC++ changes an annotation caption when it is moused over.
Here's what I'm trying to do. I have graph with multiple plots, and want to be able to display information about a given plot as the user moves the mouse over the plot. When the mouse is elsewhere, I don't want the annotation to be displayed, so I don't think using the AnnotationMouseMove event will work.
You should be able to use the PlotMouseMove and PlotAreaMouseMove events to do this. In the PlotMouseMove event handler, you can make the annotation visible and in the PlotAreaMouseMove event handler, you can make the annotation not visible.
You will likely have to come up with a clever algorithm to get the exact behavior that you are looking for. For example, you might want to hide the annotation 1 second after the first PlotAreaMouseMove event you receive after having made the annotation visible. You might need to ignore some PlotAreaMouseMove events if you receive them immediately after the PlotMouseMove event (othewise the user would have to be very precise with mouse movements).