DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Assistant.Think does not work... sometimes

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
w2m
Member


Joined: 08 Mar 2003
Posts: 27
Location: New York, USA

PostPosted: 04/01/04 15:42    Post subject: Assistant.Think does not work... sometimes Reply with quote

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
View user's profile Send e-mail Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 235

PostPosted: 07/01/04 18:17    Post subject: Reply with quote

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
View user's profile Send e-mail Visit poster's website
w2m
Member


Joined: 08 Mar 2003
Posts: 27
Location: New York, USA

PostPosted: 08/01/04 19:42    Post subject: AssistantBalloonShow not called by Assistant.Think Reply with quote

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
View user's profile Send e-mail Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 235

PostPosted: 11/01/04 22:31    Post subject: Reply with quote

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
View user's profile Send e-mail Visit poster's website
w2m
Member


Joined: 08 Mar 2003
Posts: 27
Location: New York, USA

PostPosted: 12/01/04 15:55    Post subject: Fix was sucessful Reply with quote

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
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group