| View previous topic :: View next topic |
| Author |
Message |
w2m Member
Joined: 08 Mar 2003 Posts: 27 Location: New York, USA
|
Posted: 04/01/04 15:42 Post subject: Assistant.Think does not work... sometimes |
|
|
Sometimes, Assistant.Think does not work!
In the following situation the message is not shown.
| Code: | procedure Tfrm_Main.TBXItemPrintClick(Sender: TObject);
begin
Assistant.Think('Printing...',0);
HTMLEdit.Print(HTMLEdit.ClientRect);
Sleep(1000);
Assistant.CloseBalloon;
end; |
I even tried using Application.ProcessMessages without sucess:
| Code: | procedure Tfrm_Main.TBXItemPrintClick(Sender: TObject);
begin
Assistant.Think('Printing...',0);
Application.ProcessMessages;
HTMLEdit.Print(HTMLEdit.ClientRect);
Sleep(1000);
Assistant.CloseBalloon;
end; |
How can I force an update so the message appears?
Regards
Bill _________________ w2m |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 235
|
Posted: 07/01/04 18:17 Post subject: |
|
|
The balloons appear on the screen with an animating effect. So, for your case, you have to call application.processmessages inside a loop while OnBalloonShow event occurs.
Cheers,
Kambiz |
|
| Back to top |
|
 |
w2m Member
Joined: 08 Mar 2003 Posts: 27 Location: New York, USA
|
Posted: 08/01/04 19:42 Post subject: AssistantBalloonShow not called by Assistant.Think |
|
|
AssistantBalloonShow is not called by Assistant.Think('Printing...',0) but
if I hide the Assistant, then call "Think" then show the Assistant, then AssistantBalloonShow is called and the message appears.
If I place a breakpoint in AssistantBalloonShow then just call Assistant.Think then the breakpoint does not appear.
Is this a bug?
| Code: |
procedure Tfrm_Main.AssistantBalloonShow ( Sender: TObject );
begin
Application.ProcessMessages;
case Assistant.VisibleBalloon of
bkMessage:
case Assistant.BalloonPos of
bpTopLeft, bpTopRight:
if not Assistant.IsPlaying ( [aaGestureUp] ) then
Assistant.Play ( aaGestureUp );
bpBottomLeft, bpBottomRight:
if not Assistant.IsPlaying ( [aaGestureDown] ) then
Assistant.Play ( aaGestureDown );
bpLeftTop, bpLeftBottom:
if not Assistant.IsPlaying ( [aaGestureRight] ) then
Assistant.Play ( aaGestureRight );
bpRightTop, bpRightBottom:
if not Assistant.IsPlaying ( [aaGestureLeft] ) then
Assistant.Play ( aaGestureLeft );
end;
bkTips, bkHint:
if not Assistant.IsPlaying ( [aaSuggest] ) then
Assistant.Play ( aaSuggest );
end;
end;
|
| Code: |
procedure Tfrm_Main.TBXItemPrintClick(Sender: TObject);
begin
Assistant.Visible := False;
Assistant.Think('Printing...',0);
Assistant.Visible := True;
Sleep(1000);
HTMLEdit.Print(HTMLEdit.ClientRect);
Sleep(1000);
Assistant.CloseBalloon;
end;
|
_________________ w2m |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 235
|
Posted: 11/01/04 22:31 Post subject: |
|
|
Hi Bill,
Please use v2.35 of the package in conjunction with the following code:
| Code: | procedure Tfrm_Main.TBXItemPrintClick(Sender: TObject);
begin
Assistant.Think('Printing...',0);
Application.ProcessMessages;
HTMLEdit.Print(HTMLEdit.ClientRect);
Assistant.CloseBalloon;
end; |
Regards,
Kambiz |
|
| Back to top |
|
 |
w2m Member
Joined: 08 Mar 2003 Posts: 27 Location: New York, USA
|
Posted: 12/01/04 15:55 Post subject: Fix was sucessful |
|
|
It works now... even without Applicatio.ProcessMessages in OnBaloonShow event.
Thanks
| Code: |
procedure Tfrm_Main.TBXItemPrintClick(Sender: TObject);
begin
Assistant.Think('Printing...',0);
Application.ProcessMessages;
HTMLEdit.Print(HTMLEdit.ClientRect);
Assistant.CloseBalloon;
end;
|
_________________ w2m |
|
| Back to top |
|
 |
|