AnnSetAutoText Example for Delphi

Note:

This topic is for Document/Medical only.

This example modifies the text string that is used for the undo option on the annotation pop-up menu.

var
//Global declarations
RasterAnn: LEADRasterAnnotation;
procedure TForm1.Button1Click(Sender: TObject);
begin
   RasterAnn:= CoLEADRasterAnnotation.Create ();
   RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
   LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
   RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
   TestText: WideString;
begin
   RasterAnn.AnnGetAutoText (ANN_AUTOTEXT_MENU_UNDO);
   TestText:= RasterAnn.AnnAutoText;
   TestText:= TestText + ' - New';
   RasterAnn.AnnSetAutoText (ANN_AUTOTEXT_MENU_UNDO, TestText);
end;