ButtonVisible 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;
Procedure ToggleVisibleState(AnnToolBar: LEADRasterAnnToolBar; iButtonIndex: Integer);
begin
AnnToolBar.ButtonVisible [iButtonIndex]:= Not AnnToolBar.ButtonVisible[iButtonIndex];
if(AnnToolBar.ButtonVisible[iButtonIndex]) then
ShowMessage ('Button Index ' + IntToStr(iButtonIndex) + ' visible state is True' )
else
ShowMessage ('Button Index ' + IntToStr(iButtonIndex) + ' visible state is False' )
end;