mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-09 11:47:44 +02: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;
|
HintWinRect: TRect;
|
||||||
begin
|
begin
|
||||||
HintWinRect := HintTextWindow.CalcHintRect(Screen.Width, TheHint, Nil);
|
HintWinRect := HintTextWindow.CalcHintRect(Screen.Width, TheHint, Nil);
|
||||||
HintTextWindow.HintRectAdjust := HintWinRect; // Adds borders.
|
HintTextWindow.HintRect := HintWinRect; // Adds borders.
|
||||||
HintTextWindow.OffsetHintRect(ScreenPos);
|
HintTextWindow.OffsetHintRect(ScreenPos);
|
||||||
HintTextWindow.ActivateHint(TheHint);
|
HintTextWindow.ActivateHint(TheHint);
|
||||||
end;
|
end;
|
||||||
|
@ -4229,7 +4229,7 @@ begin
|
|||||||
Rect.Right := Rect.Left + Rect.Right;
|
Rect.Right := Rect.Left + Rect.Right;
|
||||||
Rect.Bottom := Rect.Top + Rect.Bottom;
|
Rect.Bottom := Rect.Top + Rect.Bottom;
|
||||||
|
|
||||||
FHintWindow.HintRectAdjust := Rect;
|
FHintWindow.HintRect := Rect;
|
||||||
FHintWindow.ActivateHint(AHint);
|
FHintWindow.ActivateHint(AHint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1679,7 +1679,7 @@ begin
|
|||||||
TheHint:='';
|
TheHint:='';
|
||||||
end else begin
|
end else begin
|
||||||
HintWinRect := aHintWindow.CalcHintRect(Screen.Width, TheHint, Nil);
|
HintWinRect := aHintWindow.CalcHintRect(Screen.Width, TheHint, Nil);
|
||||||
aHintWindow.HintRectAdjust := HintWinRect; // Adds borders.
|
aHintWindow.HintRect := HintWinRect; // Adds borders.
|
||||||
end;
|
end;
|
||||||
OffsetRect(HintWinRect, ScreenPos.X, ScreenPos.Y+30);
|
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 FHintWindow.Color=',dbgs(FHintWindow.Color),' HintInfo.HintColor=',dbgs(HintInfo.HintColor)]);
|
||||||
|
|
||||||
//debugln('TApplication.ShowHintWindow B HintWinRect=',dbgs(HintWinRect),' HintStr="',DbgStr(HintInfo.HintStr),'"');
|
//debugln('TApplication.ShowHintWindow B HintWinRect=',dbgs(HintWinRect),' HintStr="',DbgStr(HintInfo.HintStr),'"');
|
||||||
FHintWindow.HintRectAdjust := HintWinRect;
|
FHintWindow.HintRect := HintWinRect;
|
||||||
FHintWindow.ActivateHint(HintInfo.HintStr);
|
FHintWindow.ActivateHint(HintInfo.HintStr);
|
||||||
FHintRect := HintInfo.CursorRect;
|
FHintRect := HintInfo.CursorRect;
|
||||||
// start hide timer
|
// start hide timer
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
{
|
{
|
||||||
use:
|
use:
|
||||||
HintWindow := THintWindow.Create(nil);
|
HintWindow := THintWindow.Create(nil);
|
||||||
Rect := HintWindow.CalcHintRect(0,'This is the hint');
|
Rect := HintWindow.CalcHintRect(0,'This is the hint', Nil);
|
||||||
HintWindow.ActivateWithBounds(Rect,'This is the hint');
|
HintWindow.ActivateHint(Rect,'This is the hint');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ end;
|
|||||||
|
|
||||||
procedure THintWindow.ActivateHintData(ARect: TRect; const AHint: String; AData: pointer);
|
procedure THintWindow.ActivateHintData(ARect: TRect; const AHint: String; AData: pointer);
|
||||||
begin
|
begin
|
||||||
HintRectAdjust := ARect;
|
HintRect := ARect;
|
||||||
ActivateHint(AHint); // AData is not used now.
|
ActivateHint(AHint); // AData is not used now.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -265,6 +265,9 @@ begin
|
|||||||
ThemeServices.GetElementDetails(tttStandardNormal), AHint, Flags, @Result)
|
ThemeServices.GetElementDetails(tttStandardNormal), AHint, Flags, @Result)
|
||||||
else
|
else
|
||||||
DrawText(uh, PChar(AHint), Length(AHint), Result, Flags);
|
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));
|
//debugln('THintWindow.CalcHintRect Result=',dbgs(Result));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user