AnnSetAutoText example for Delphi
// This example is also for:
// AnnGetAutoText method.
//This example modifies the text string that is used for the undo option on the annotation pop-up menu.
procedure TForm1.Button1Click(Sender: TObject);
var
pTestText: PChar;
strSize: Integer;
begin
strSize:= LEADAnn1.AnnGetAutoText (ANNAUTOTEXT_MENU_UNDO, Nil);
if ( strSize > 0 ) then
begin
pTestText:= AllocMem ( strSize + 1 );
if ( pTestText = Nil ) then
begin
ShowMessage ('NO MEMORY');
Exit;
end;
LEADAnn1.AnnGetAutoText (ANNAUTOTEXT_MENU_UNDO, @pTestText);
StrCat (pTestText, PChar (' - New'));
LEADAnn1.AnnSetAutoText (ANNAUTOTEXT_MENU_UNDO, pTestText);
FreeMem (pTestText);
end;
end;