Page 1 of 1

Silverlight : Rectangle / Annotation tool edit

Posted: Fri Jul 24, 2009 10:00 am
by 13051589
hi

I am trying to make a simple feature where a user can add a rectangle tool to the chart , edit the text , later delete the annotation/rectangle tool

so i will have methods like addAnnotation , removAannotation and am planning to add editing using the AllowEdit = true and using Keydown event as follows
(below "annotation" can be rectangletool or annotation)
void annotation_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
currentAnnotationTool.EndEdit();
if(e.Key == Key.F2)
currentAnnotationTool.StartEdit();
}

is the below logic correct?
------------------------------
Have a flag to set which tool is selected - defalt = false
Add a annotation and set the flag to false
On click of the annotation , set the flag to true and set the currentannotation = selectedannotation
on keydown startedit on enter and endedit on F2(key can be any key)
in deleteAnnotation , remove the annotation from the chart tool collection

I am not able to hit the keydown event , I am able to hit the click event . do we have a sample to show how to use rectangletool for editing .

Also I saw that the rectangle shape "roundrectangle" is available , but the Shape property for rectangletool is readonly , so how can i have a round rectangle on my chart .
What is the use of EditorKey() eventhandler .

thanks,
Aniket

Re: Silverlight : Rectangle / Annotation tool edit

Posted: Fri Jul 24, 2009 1:33 pm
by narcis
Hi Aniket,
is the below logic correct?
Yes, it seems fine to me.
I am not able to hit the keydown event , I am able to hit the click event . do we have a sample to show how to use rectangletool for editing .
I've checked that KeyDown event and RectangleTool editing doesn't work in TeeChart.Silverligh.dll. I've added these to the wish-list to be enchanced for future releases. In such circumstances, the only solution I can think of for editing a RectangleTool is using a textbox and assigning the text to the tool.
Also I saw that the rectangle shape "roundrectangle" is available , but the Shape property for rectangletool is readonly , so how can i have a round rectangle on my chart .
Code below works fine for me here.

Code: Select all

			rectangle1.Shape.ShapeStyle = Steema.TeeChart.Silverlight.Drawing.TextShapeStyle.RoundRectangle;
What is the use of EditorKey() eventhandler.
It's is for checking which key has been pressed in an editor.

Re: Silverlight : Rectangle / Annotation tool edit

Posted: Mon Jul 27, 2009 6:38 am
by 13051589
Hi Narcis,

Thanks for the roundrect comment , it does work , I must have set someting else :).

On the annotation/rect editing .....
" I've checked that KeyDown event and RectangleTool editing doesn't work in TeeChart.Silverligh.dll. I've added these to the wish-list to be enchanced for future releases. In such circumstances, the only solution I can think of for editing a RectangleTool is using a textbox and assigning the text to the tool "

I checked in windows samples for the annotation/rect editing it works (canedit), shouldnt it be a bug for silverlight implementation ? I mean the logic i am trying to implement is because "CanEdit" is not working , even the Keydown event works in windows samples , so request teechart to take it as a bug . Am sure people will want to add and edit annotations/text set for thier charts , specially financial charts , in place editing should work the same way as in wondows samples .

which release will this fix/feature be a part of ? this is part of my (must have)requirements so need it quickly mate .

Thanks for the textbox suggestion , I did try the same , it works but , it doesnt provide the same utility/effect as the "in place" editing of recttool/annotation , which we have in windows .

thanks,
Aniket

Re: Silverlight : Rectangle / Annotation tool edit

Posted: Mon Jul 27, 2009 8:49 am
by narcis
Hi Aniket,
I checked in windows samples for the annotation/rect editing it works (canedit), shouldnt it be a bug for silverlight implementation ? I mean the logic i am trying to implement is because "CanEdit" is not working , even the Keydown event works in windows samples , so request teechart to take it as a bug . Am sure people will want to add and edit annotations/text set for thier charts , specially financial charts , in place editing should work the same way as in wondows samples .
Yes, we know that works with Windows Forms applications. However Silverlight is almost and independent framework so, even though TeeChart.Silverlight.dll reuses TeeChart.dll code, I'm not sure if this should be considered a bug or just needs to be reworked to be supported in TeeChart.Silverlight.dll.
which release will this fix/feature be a part of ? this is part of my (must have)requirements so need it quickly mate .
I understand your position but I'm not able to provide an estimate date for now. I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's fixed and included on them.

Thanks in advance.