mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 22:29:37 +01:00 
			
		
		
		
	LCL: Fix THintWindow.CalcHintRect. Issue #26674. Inspired by patch from Denis Golovan.
git-svn-id: trunk@46165 -
This commit is contained in:
		
							parent
							
								
									51415f926a
								
							
						
					
					
						commit
						78afb4c373
					
				| @ -328,7 +328,7 @@ var | ||||
|     HintWinRect: TRect; | ||||
|   begin | ||||
|     HintWinRect := HintTextWindow.CalcHintRect(Screen.Width, TheHint, Nil); | ||||
|     HintTextWindow.HintRectAdjust := HintWinRect;      // Adds borders. | ||||
|     HintTextWindow.HintRect := HintWinRect;      // Adds borders. | ||||
|     HintTextWindow.OffsetHintRect(ScreenPos); | ||||
|     HintTextWindow.ActivateHint(TheHint); | ||||
|   end; | ||||
|  | ||||
| @ -4229,7 +4229,7 @@ begin | ||||
|   Rect.Right := Rect.Left + Rect.Right; | ||||
|   Rect.Bottom := Rect.Top + Rect.Bottom; | ||||
| 
 | ||||
|   FHintWindow.HintRectAdjust := Rect; | ||||
|   FHintWindow.HintRect := Rect; | ||||
|   FHintWindow.ActivateHint(AHint); | ||||
| end; | ||||
| 
 | ||||
|  | ||||
| @ -1679,7 +1679,7 @@ begin | ||||
|     TheHint:=''; | ||||
|   end else begin | ||||
|     HintWinRect := aHintWindow.CalcHintRect(Screen.Width, TheHint, Nil); | ||||
|     aHintWindow.HintRectAdjust := HintWinRect;      // Adds borders. | ||||
|     aHintWindow.HintRect := HintWinRect;      // Adds borders. | ||||
|   end; | ||||
|   OffsetRect(HintWinRect, ScreenPos.X, ScreenPos.Y+30); | ||||
| 
 | ||||
|  | ||||
| @ -860,7 +860,7 @@ begin | ||||
|     //DebugLn(['TApplication.ShowHintWindow FHintWindow.Color=',dbgs(FHintWindow.Color),' HintInfo.HintColor=',dbgs(HintInfo.HintColor)]);
 | ||||
| 
 | ||||
|     //debugln('TApplication.ShowHintWindow B HintWinRect=',dbgs(HintWinRect),' HintStr="',DbgStr(HintInfo.HintStr),'"');
 | ||||
|     FHintWindow.HintRectAdjust := HintWinRect; | ||||
|     FHintWindow.HintRect := HintWinRect; | ||||
|     FHintWindow.ActivateHint(HintInfo.HintStr); | ||||
|     FHintRect := HintInfo.CursorRect; | ||||
|     // start hide timer
 | ||||
|  | ||||
| @ -12,8 +12,8 @@ | ||||
| { | ||||
|    use: | ||||
|    HintWindow := THintWindow.Create(nil); | ||||
|    Rect := HintWindow.CalcHintRect(0,'This is the hint'); | ||||
|    HintWindow.ActivateWithBounds(Rect,'This is the hint'); | ||||
|    Rect := HintWindow.CalcHintRect(0,'This is the hint', Nil); | ||||
|    HintWindow.ActivateHint(Rect,'This is the hint'); | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| @ -242,7 +242,7 @@ end; | ||||
| 
 | ||||
| procedure THintWindow.ActivateHintData(ARect: TRect; const AHint: String; AData: pointer); | ||||
| begin | ||||
|   HintRectAdjust := ARect; | ||||
|   HintRect := ARect; | ||||
|   ActivateHint(AHint);                // AData is not used now.
 | ||||
| end; | ||||
| 
 | ||||
| @ -265,6 +265,9 @@ begin | ||||
|       ThemeServices.GetElementDetails(tttStandardNormal), AHint, Flags, @Result) | ||||
|   else | ||||
|     DrawText(uh, PChar(AHint), Length(AHint), Result, Flags); | ||||
|   // compensate for InflateRect in Paint method
 | ||||
|   Inc(Result.Right, 4 * HintBorderWidth); | ||||
|   Inc(Result.Bottom, 4 * HintBorderWidth); | ||||
|   //debugln('THintWindow.CalcHintRect Result=',dbgs(Result));
 | ||||
| end; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 juha
						juha