AnnHyperlinkMenu example for Delphi
//The AnnHyperLinkMenu event occurs whenever the user clicks on the Hyperlink menu //item provided for automated annotations.
//The menu item is enabled and disabled using AnnHyperlinkMenuEnable property.
//The following is an example of AnnHyperlinkMenu event code, which includes a call to //AnnSetHyperlinkMsg.
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
x: Integer;
nCount: OleVariant;
RasterVarObjects: LEADRasterVariant;
begin
case (DispID) of
LEADRASTERANNOTATIONEVENTS_ANNHYPERLINKMENU:
begin
nCount:= OleVariant(Params.rgvarg^[0]);
RasterVarObjects:= LEADRasterVariant(Params.rgvarg^[1].dispVal);
//set HyperLink to type ANNLINK_ANNEVENT5
//and set theC 5 params to some values.
for x:= 0 to nCount - 1 do
RasterAnn.AnnSetHyperlinkMsg(RasterVarObjects.LongItemValue[x],
ANN_LINK_ANNEVENT5,
5,
4,
3,
2,
1);
end;
end;
end;