Recent

Author Topic: Hint isn't updating anymore  (Read 7039 times)

tjones

  • New member
  • *
  • Posts: 8
Hint isn't updating anymore
« on: August 01, 2010, 12:18:08 pm »
Hi everyone,

After updating from Lazarus 0.9.26.2 to 0.9.28.2 my hint isn't updating anymore when I'm hovering the mouse over my PaintBox inside an "OnMouseMove" event. I've been trying a lot of different things for the past few hours, but just can't get it to work. Compiling it AGAIN with the older Lazarus version, it WAS working again. Most things I found related to my problem were Delphi related, using procedures not (yet) available on Lazarus. So how to make it work again ?

Example code:

Code: [Select]
procedure TForm1.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
begin
    PaintBox1.Hint := IntToStr(X) + '-' + IntToStr(Y);

// == THINGS I TRIED THAT DIDN'T WORK FOR ME ==
//   PaintBox1.Invalidate;
//   PaintBox1.Changed;
//   PaintBox1.Update;
//   PaintBox1.Repaint;
//   PaintBox1.Refresh;
//   Screen.UpdateScreen;
//   Application.ProcessMessages;
//   Application.CancelHint;
//   Application.HintPause := 10;
//   Application.HintShortPause := 1000;
//   Application.Hint := IntToStr(X) + '-' + IntToStr(Y);
//   Application.ShowHint := True;
end;                                           

The hint is never been updated as it used to be in the previous version 0.9.26.2 (FPC 2.2.2). It only updates when I "enter" the PaintBox control with the mouse cursor. Any help would be appreciated. Thank you !

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Hint isn't updating anymore
« Reply #1 on: August 01, 2010, 03:45:15 pm »
Could you test with a Snapshot? Which operating system?

tjones

  • New member
  • *
  • Posts: 8
Re: Hint isn't updating anymore
« Reply #2 on: August 01, 2010, 04:23:48 pm »
I tried this before already with a snapshot, and now I tried it again with Lazarus 0.9.29 (FPC 2.4.3) SVN 26845. This time not with all possible code variations that I tried before, but only with these 4 lines inside the mouse event:

PaintBox1.Hint := IntToStr(X) + '-' + IntToStr(Y);
Application.ProcessMessages;  // could be working
PaintBox1.Refresh; // probably not
PaintBox1.Update; // probably not

It's still the same issue here with my test application that only contains a single form, the PaintBox and a close button. I'm using WINDOWS 2000 SP4 by the way, but this hasn't changed from the previous Lazarus version where it worked. Can you reproduce it ?

tjones

  • New member
  • *
  • Posts: 8
Re: Hint isn't updating anymore
« Reply #3 on: August 01, 2010, 04:32:07 pm »
Btw, the "Identifier completion" (the code completion after a point) doesn't work anymore either in this snapshot, at least not for me. Not even by invoking it by CTRL+SPACE which takes me into LCLClasses window, strange...

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Hint isn't updating anymore
« Reply #4 on: August 02, 2010, 07:14:12 pm »
Please report both issues in the bug tracker and write explicitly that they are regressions, that way they will be targeted for 0.9.30 and the next version will have this working. I have also noticed the hint issue, but code completion works for me, although I haven't updated svn in the last weeks

tjones

  • New member
  • *
  • Posts: 8
Re: Hint isn't updating anymore
« Reply #5 on: August 06, 2010, 11:37:40 am »
SOLVED:

I reported the issue to the bug tracker team, and as a result the method 'Application.ActivateHint' (Delphi compatible) has been added and is available from SVN 27014. It works perfect now.

For everyone interested, the following code works from SVN 27014:

procedure TForm1.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
begin
  PaintBox1.Hint := IntToStr(X) + '-' + IntToStr(Y);
  Application.ActivateHint(Mouse.CursorPos);
end;

You might want to add 'Application.HintPause := 10' in the FormCreate procedure which brings the delay down to 10ms after entering the PaintBox (or whatever object and timing you prefer). The color can be changed this way: 'Application.HintColor := clAqua'. Working perfect...  :D

 

TinyPortal © 2005-2018