View Issue Details

IDProjectCategoryView StatusLast Update
0034689LazarusIDEpublic2019-03-17 10:17
ReporterZhengji Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platform64bitOSWindows 
Product Version2.0RC2 
Summary0034689: TTIPropertyGrid.OnPropertyHint not work
DescriptionTTIPropertyGrid.OnPropertyHint can be used to show customized hint when mouse is over a name.

procedure TForm1.FormCreate(Sender: TObject);
begin
  TIPropertyGrid1.OnPropertyHint := @OnPropertyHint;
  TIPropertyGrid1.ShowHint := True;
end;

function TForm1.OnPropertyHint(Sender: TObject; PointedRow: TOIPropertyGridRow;
  out AHint: string): Boolean;
begin
  AHint := 'Test';
  Result := True;
end;

But actually this handler can't be called because GetHintTypeAt is called with X on screen (while on client area is expected), so HintType never equals to pehName, expect when near the left side of screen.

Test project and patch are attached.
Steps To Reproduce1. run the test project;

2. when mouse is over a name (such as Action) in the object inspector, a hint 'Test' should be shown.
TagsNo tags attached.
Fixed in Revisionr60708
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

has duplicate 0034726 resolvedJuha Manninen Packages TTIPropertyGrid.OnPropertyHint not work 

Activities

Zhengji

2018-12-12 08:35

reporter  

test_and_patch.zip (130,082 bytes)

Zhengji

2018-12-12 08:37

reporter  

objectinspector.pp.patch (524 bytes)   
Index: components/ideintf/objectinspector.pp
===================================================================
--- components/ideintf/objectinspector.pp	(revision 59797)
+++ components/ideintf/objectinspector.pp	(working copy)
@@ -3556,7 +3556,7 @@
 
   // Get hint
   OkToShow := True;
-  HintType := GetHintTypeAt(Index, Position.X);
+  HintType := GetHintTypeAt(Index, ClientPosition.X);
   if (HintType = pehName) and Assigned(OnPropertyHint) then
     OkToShow := OnPropertyHint(Self, PointedRow, AHint)
   else
objectinspector.pp.patch (524 bytes)   

Juha Manninen

2019-03-17 10:17

developer   ~0114892

Applied, thanks.

Issue History

Date Modified Username Field Change
2018-12-12 08:35 Zhengji New Issue
2018-12-12 08:35 Zhengji File Added: test_and_patch.zip
2018-12-12 08:37 Zhengji File Added: objectinspector.pp.patch
2019-03-17 01:53 Juha Manninen Assigned To => Juha Manninen
2019-03-17 01:53 Juha Manninen Status new => assigned
2019-03-17 02:43 Juha Manninen Relationship added has duplicate 0034726
2019-03-17 10:17 Juha Manninen Fixed in Revision => r60708
2019-03-17 10:17 Juha Manninen LazTarget => -
2019-03-17 10:17 Juha Manninen Note Added: 0114892
2019-03-17 10:17 Juha Manninen Status assigned => resolved
2019-03-17 10:17 Juha Manninen Resolution open => fixed