Move rectangle with annotations into it

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Move rectangle with annotations into it

Post by acastro » Fri Aug 06, 2010 10:02 am

I would like to create a rectangle tool with several annotations tools into it, but with the selector tool when I move the rectangle the annotations don't move.

Is it posible to create an rectangle or something with anotations and drag all of them at the same time?

Thanks
Alain

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Move rectangle with annotations into it

Post by Yeray » Mon Aug 09, 2010 4:26 pm

Hi Alain,

I'm afraid it won't be possible with the actual TeeChart tool set. But you should be able to achieve it with OnMouseDown, OnMouseMove and OnMouseUp events.
If you find troubles with it, don't hesitate to let us know.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Move rectangle with annotations into it

Post by acastro » Mon Aug 23, 2010 9:01 am

I'm trying it, and I can move annotations automatically when I move a rectangle, but I have a strange behaviour, when I add the rectangle and annotation dinamically.

In the Dragging event I always set de annotation 10 pixels more in left and top properties than the rectangle, but I can't do it when I add the rectangle and annotation with the add button.

How can I do it?

I attach an example.

Thanks
Attachments
TestTeeChart2010.zip
(28.37 KiB) Downloaded 439 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Move rectangle with annotations into it

Post by Yeray » Tue Aug 24, 2010 10:39 am

Hi wakeup,

Try calling tChart1.Refresh(); before initializing the annotation position (Left and Top properties).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Move rectangle with annotations into it

Post by acastro » Tue Aug 24, 2010 11:21 am

Hi Yeray,

As you can see in the example I uploaded I have the refresh and it seems not solve anything...


Thanks

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Move rectangle with annotations into it

Post by Yeray » Tue Aug 24, 2010 11:25 am

Hi wakeup,

I moved the Refresh call to be before the set of the properties and it works for me here:

Code: Select all

tChart1.Refresh();

anotacion.Left = rectangulo.Left + 10;
anotacion.Top = rectangulo.Top + 10;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Move rectangle with annotations into it

Post by acastro » Tue Aug 24, 2010 11:27 am

Ah! Thanks!
I put the refresh before the asings and now it runs too.
Thanks you

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Move rectangle with annotations into it

Post by Yeray » Tue Aug 24, 2010 11:49 am

Hi wakeup,

You're welcome!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply