mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 08:58:23 +02:00
THintWindow: adjust for BidiMode in CalcHintRect.
Issue #0025275. git-svn-id: trunk@43367 -
This commit is contained in:
parent
dbfc98eda7
commit
9e3191112e
@ -244,6 +244,8 @@ end;
|
||||
|
||||
function THintWindow.CalcHintRect(MaxWidth: Integer; const AHint: String;
|
||||
AData: Pointer): TRect;
|
||||
var
|
||||
Flags: Cardinal;
|
||||
begin
|
||||
if AHint = '' then
|
||||
begin
|
||||
@ -253,12 +255,14 @@ begin
|
||||
if MaxWidth <= 0 then
|
||||
MaxWidth := Screen.Width - 4 * HintBorderWidth;
|
||||
Result := Rect(0, 0, MaxWidth, Screen.Height - 4 * HintBorderWidth);
|
||||
Flags := DT_CALCRECT or DT_NOPREFIX or DT_WORDBREAK;
|
||||
if (BidiMode <> bdLeftToRight) then Flags := Flags or DT_RTLREADING;
|
||||
if UseThemes then
|
||||
Result := ThemeServices.GetTextExtent(Canvas.GetUpdatedHandle([csFontValid]),
|
||||
ThemeServices.GetElementDetails(tttStandardNormal), AHint, DT_NOPREFIX or DT_WORDBREAK, @Result)
|
||||
ThemeServices.GetElementDetails(tttStandardNormal), AHint, Flags, @Result)
|
||||
else
|
||||
DrawText(Canvas.GetUpdatedHandle([csFontValid]), PChar(AHint), Length(AHint),
|
||||
Result, DT_CALCRECT or DT_NOPREFIX or DT_WORDBREAK);
|
||||
Result, Flags);
|
||||
inc(Result.Right, 4 * HintBorderWidth);
|
||||
inc(Result.Bottom, 4 * HintBorderWidth);
|
||||
//debugln('THintWindow.CalcHintRect Result=',dbgs(Result));
|
||||
|
Loading…
Reference in New Issue
Block a user