I would like to create a custom hint for an annotation.
Is there any way to get a OnHint event for a annotation?
Ed Dressel
Hint for Annotation
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Hint for Annotation
Hi Ed,
No but you could use OnMouseMove event and annotation's Clicked method to check if the mouse is over an annotation tool and use delphi tooltips or windows hints then to display whatever you want.
No but you could use OnMouseMove event and annotation's Clicked method to check if the mouse is over an annotation tool and use delphi tooltips or windows hints then to display whatever you want.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Hint for Annotation
There is no OnMouseMove event (at least in version 3) for annotation and since it is not of Control type, I cannot assign .Net ToolTip.
P.S.: not sure whether this should be placed in the .Net forum.
P.S.: not sure whether this should be placed in the .Net forum.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Hint for Annotation
Hello icecream,
which can be used to implement what I suggested this way:
I actually meant using TChart's MouseMove event and calling Annotation's Clicked method in it. Given that Annotation.Clicked is not a public method in .NET, you can create your custom annotation tool class like this:icecream wrote:There is no OnMouseMove event (at least in version 3) for annotation and since it is not of Control type, I cannot assign .Net ToolTip.
Code: Select all
public class MyAnnotation : Annotation
{
public MyAnnotation(Chart c) : base(c) { }
public bool Clicked(Point p)
{
return Clicked(p.X, p.Y);
}
}
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.MouseMove += TChart1_MouseMove;
Bar bar1 = new Bar(tChart1.Chart);
bar1.FillSampleValues();
tool = new MyAnnotation(tChart1.Chart);
tool.Text = "HELLO WORLD";
}
MyAnnotation tool;
private void TChart1_MouseMove(object sender, MouseEventArgs e)
{
if(tool.Clicked(e.Location))
{
MessageBox.Show("ANNOTATION CLICKED!");
}
}
When I read .NET in your post I rushed moving it to the .NET forum. I forgot about the VCL history it could have behind.icecream wrote:P.S.: not sure whether this should be placed in the .Net forum.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |