Hello,
Is it possible to block a TAnnotationTool so that the user cannot move it anymore ? I couldn't find anything about this.
Disable annotation moving ?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello bertrod,
By default, an annotation tool can not be moved by user if you don't grant them access to the chart editor tools tab doing this:
By default, an annotation tool can not be moved by user if you don't grant them access to the chart editor tools tab doing this:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
Var NewTabs : TChartEditorHiddenTabs;
begin
NewTabs:=[cetTools];
ChartEditor1.HideTabs:=ChartEditor1.HideTabs+NewTabs
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ChartEditor1.Execute;
end;
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 |
I would like to disable only some TAnnotations, not all. And I'm not using the chart editor tool. I don't feel like adding it only to block 2 or 3 annotations.
I tried to edit a bit the code in the TeeTools.pas file, but I couldn't find exactly what function is called when the user is moving the annotation. Do you have another suggestion ?
I tried to edit a bit the code in the TeeTools.pas file, but I couldn't find exactly what function is called when the user is moving the annotation. Do you have another suggestion ?
Hi,
I think you're referencing to the TRectangle tool. which can be dragged using the mouse. If so, one way to lock some of the TRectangle tool could be to use similar code to the following (in the OnDragging event, locking the second TRectangle tool) :
Another way around this could be to use TAnnotation tools (setting the same brushes, pens, etc.. to get the same aspect) for the annotation which must be locked and TRectangle tools for the other.
I think you're referencing to the TRectangle tool. which can be dragged using the mouse. If so, one way to lock some of the TRectangle tool could be to use similar code to the following (in the OnDragging event, locking the second TRectangle tool) :
Code: Select all
procedure TForm1.ChartTool2Dragging(Sender: TObject);
begin
ChartTool2.Left:=30;
ChartTool2.Top:=30;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ChartTool2.Left:=30;
ChartTool2.Top:=30;
Chart1.Draw;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com