...insert PopUp-menu items for MS Agent component?
Author: Manfred Ruzicka
procedure TForm1.FormCreate(Sender: TObject);
begin
Agent1.Characters.Load('Merlin', 'merlin.acs');
with Agent1.Characters.Item['Merlin'] do
begin
Show(0);
Commands.Add('Test', '&Test', 1, 1, True);
Commands.Add('Demo', '&Demo', 1, 1, True);
end;
end;
procedure TForm1.Agent1Command(ASender: TObject;
const UserInput: IDispatch);
var
Cmd: IAgentCtlUserInput;
begin
Cmd := UserInput as IAgentCtlUserInput;
if Cmd.Name = 'Test' then
Agent1.Characters.Item['Merlin'].Speak('Test', '')
else if Cmd.Name = 'Demo' then
Agent1.Characters.Item['Merlin'].Speak('Demo', '');
end;
printed from
www.swissdelphicenter.ch
developers knowledge base