the package installed correctly in my Delphi 2007, and is working beauty,
then come on, I with a probema's time to use the Event OnGuideSearchClick,
I am not able to make more of a word to search.
I'm using the code below is for the demonstration,
but when places two searches, the code checks only the search for low
First check the search
PS. there is not this one
- Code: Select all
if Pos('cadastrar' , LowerCase(Request)) <> 0 then
Second verification of search
PS. there is only this
- Code: Select all
if Pos('Vendas' , LowerCase(Request)) <> 0 then
below the code of the entire event
- Code: Select all
procedure TFrmPrincipal.AssistenteGuideSearchClick(Sender: TObject);
var
I: Integer;
begin
if Writing then
begin
Writing := False;
{Exibe ele procurando}
Assistente.Play('WriteReturn');
end;
{Se for digitado as palavras abaixo ele exibe os Topicos a seguir}
with Assistente.GuideDlg do
begin
if Pos('cadastrar' , LowerCase(Request)) <> 0 then
begin
Description := 'Você perguntou alguma coisa sobre '+ Request +', aqui tem opções que eu posso te oferecer.';
Topics.Clear;
Topics.AddStyle('', [tsHeader]);
Topics.AddStyle('Selecione um dos seguintes itens:', [tsHeader, tsBold]);
for I := 0 to Random(8) do
case Random(100) of
00..33:
Topics.AddID('Cadastro de Clientes', 1);
34..66:
Topics.AddID('Cadastro de Vendedores', 2);
67..99:
Topics.AddID('Cadastro de Produtos', 3);
end;
if Random(5) = 0 then
Assistente.Play(aaCongratulate)
else
Assistente.Play(aaPleased);
RequestResult := True;
end
else
begin
Description := 'Eu não sei o que você quer dizer. Por favor reformular a sua pergunta.';
Topics.Clear;
Topics.AddStyle('Mostre-me um exemplo', [tsHoverUnderline]);
{$IFDEF COMPILER4_UP}
Assistente.Play([aaConfused, aaDecLine, aaSad]);
{$ELSE}
Assistente.PlayRandom([aaConfused, aaDecLine, aaSad]);
{$ENDIF}
RequestResult := False;
end;
end;
begin
if Writing then
begin
Writing := False;
{Exibe ele procurando}
Assistente.Play('WriteReturn');
end;
{Se for digitado as palavras abaixo ele exibe os Topicos a seguir}
with Assistente.GuideDlg do
begin
if Pos('Vendas' , LowerCase(Request)) <> 0 then
begin
Description := 'Você perguntou alguma coisa sobre '+ Request +', aqui tem opções que eu posso te oferecer.';
Topics.Clear;
Topics.AddStyle('', [tsHeader]);
Topics.AddStyle('Selecione um dos seguintes itens:', [tsHeader, tsBold]);
for I := 0 to Random(8) do
case Random(100) of
00..33:
Topics.AddID('Como Gerar Vendas', 4);
34..66:
Topics.AddID('Como faço para apagar a vendas', 5);
67..99:
Topics.AddID('Gerando pedido de vendas', 6);
end;
if Random(5) = 0 then
Assistente.Play(aaCongratulate)
else
Assistente.Play(aaPleased);
RequestResult := True;
end
else
begin
Description := 'Eu não sei o que você quer dizer. Por favor reformular a sua pergunta.';
Topics.Clear;
Topics.AddStyle('Mostre-me um exemplo', [tsHoverUnderline]);
{$IFDEF COMPILER4_UP}
Assistente.Play([aaConfused, aaDecLine, aaSad]);
{$ELSE}
Assistente.PlayRandom([aaConfused, aaDecLine, aaSad]);
{$ENDIF}
RequestResult := False;
end;
end;
end;
end;
Thank you
Grato
[]'s
Charles