AnnSetAutoMenuItemEnable Example for Delphi

Note:

This topic is for Document/Medical only.

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);
begin
   // disable the Delete menu item from all the selected objects
   RasterAnn.AnnSetAutoMenuItemEnable (RasterAnn.AnnContainer, 0, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, ANN_FLAG_RECURSE + ANN_FLAG_SELECTED, '');
   // disable the Delete menu item from all the ellipse objects
   RasterAnn.AnnSetAutoMenuItemEnable (RasterAnn.AnnAutomation, ANN_OBJECT_ELLIPSE, ANN_AUTOTEXT_MENU_DELETE, ANN_MENU_DISABLED, 0, '');
end;