View Issue Details

IDProjectCategoryView StatusLast Update
0017092LazarusLCLpublic2011-12-01 11:24
ReportertjonesAssigned ToPaul Ishenin 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindows 2000 Prof SP4OS VersionWindows 2000 SP4
Product VersionProduct BuildLazarus 0.9.29 SVN 26845 
Target VersionFixed in Version0.9.29 (SVN) 
Summary0017092: REGRESSION: Hint isn't updating anymore after updating Lazarus from 0.9.26.2 to 0.9.28.2
DescriptionAfter updating from Lazarus 0.9.26.2 (FPC 2.2.2) to 0.9.28.2 (FPC 2.2.4) the hint isn't updating anymore when I'm hovering the mouse over a PaintBox inside an "OnMouseMove" event. It only updates when I "enter" the PaintBox control with the mouse cursor, leaving it, and entering it again. I've also tested it with the latest snapshot including FPC 2.4.3 (Lazarus 0.9.29 SVN 26845) with the same result. Compiling it AGAIN with FPC 2.2.2 under Lazarus 0.9.26.2 it works fine. I've been trying many things to make it work again, with no luck. It's a key element of my application, therefore I need this working.

Example code:

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;

Steps To Reproduce-create new GUI application
-add a PaintBox
-add the code given above
-compile/build project
-start
-move mouse pointer inside the paintbox
=> will NOT update hint anymore (showing X/Y coordinates)
TagsNo tags attached.
Fixed in Revision27014
LazTarget-
Widgetset
Attached Files

Activities

Mattias Gaertner

2010-08-03 09:57

manager   ~0039925

I can not confirm the regression, but I can confirm the bug. There is no code in TControl.SetHint to update the current hint.
Under linux/qt I have to leave the TPaintBox before the hint is updated.

Mattias Gaertner

2010-08-03 10:33

manager   ~0039934

The TApplication part seems to be correct.

Maybe a TApplication.UpdateHint method can be added, that does not reset the timer and if the hint is shown, hides and shows it again.
Also it might be useful to add a
  property HintControl: TControl read FHintControl;

Felipe Monteiro de Carvalho

2010-08-04 21:21

developer   ~0039988

Just to inform the reporter:

The following code should work (after fixing the bug):

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

Paul Ishenin

2010-08-05 04:24

manager   ~0039995

First of all this is not a bug. This is how VCL was designed to work and how LCL works now. Try the same code with delphi and you find that it does not update hint too.

But in delphi you are able to force hint update by calling Application.ActivateHint(Mouse.CursorPos) method. Sad but this method was not present in LCL before the r27014 and there is no easy way for you in 0.9.28.2 But you can update to development version of lazarus and try the suggested solution there.

In any case this is imposible to fix for 0.9.28.2 since 0.9.28.2 was already released and the next version will be 0.9.30 which is in the development now and where the problem has a solution.

Please test and close if it works ok for you.

tjones

2010-08-06 08:38

reporter   ~0040016

Last edited: 2010-08-06 11:15

It's working fine now, thanks !
First I wasn't aware of the new method that has been implemented in 27014, hence
the edit. For everyone else interested, the following code works now:

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

Issue History

Date Modified Username Field Change
2010-08-03 04:51 tjones New Issue
2010-08-03 09:57 Mattias Gaertner FPCOldBugId => 0
2010-08-03 09:57 Mattias Gaertner Note Added: 0039925
2010-08-03 09:57 Mattias Gaertner Status new => confirmed
2010-08-03 10:08 Jonas Maebe Project FPC => Lazarus
2010-08-03 10:15 Vincent Snijders LazTarget => -
2010-08-03 10:15 Vincent Snijders Category FCL => LCL
2010-08-03 10:15 Vincent Snijders Product Version 2.4.3 =>
2010-08-03 10:33 Mattias Gaertner Note Added: 0039934
2010-08-04 21:21 Felipe Monteiro de Carvalho Note Added: 0039988
2010-08-05 04:24 Paul Ishenin Fixed in Revision => 27014
2010-08-05 04:24 Paul Ishenin Status confirmed => resolved
2010-08-05 04:24 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-08-05 04:24 Paul Ishenin Resolution open => no change required
2010-08-05 04:24 Paul Ishenin Assigned To => Paul Ishenin
2010-08-05 04:24 Paul Ishenin Note Added: 0039995
2010-08-06 08:38 tjones Status resolved => assigned
2010-08-06 08:38 tjones Resolution no change required => reopened
2010-08-06 08:38 tjones Note Added: 0040016
2010-08-06 10:48 tjones Note Edited: 0040016
2010-08-06 11:15 tjones Note Edited: 0040016
2010-08-06 12:10 Felipe Monteiro de Carvalho Status assigned => resolved
2010-08-06 12:10 Felipe Monteiro de Carvalho Resolution reopened => fixed
2011-12-01 11:24 Marc Weustink Status resolved => closed