ButtonMenuTool example for Delphi
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
//Makes the first rubber stamp tool draw a rectangle
Procedure SetToolToRect(AnnToolBar: LEADRasterAnnToolBar);
var
I: Integer;
begin
for I:= 0 to AnnToolBar.ButtonCount do
begin
//is this the button with the rubber stamps ?
if (AnnToolBar.ButtonToolCount [I] > 1) then
AnnToolBar.ButtonMenuTool [I, 0]:= ANN_TOOL_RECT
end;
end;