mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 14:00:18 +02:00
fixed AutoSize of TCustomLabel and TButtonControl with & in the caption (issue #1799)
git-svn-id: trunk@8861 -
This commit is contained in:
parent
340a6fcb24
commit
d6b62f2146
@ -38,7 +38,7 @@ begin
|
||||
try
|
||||
R := Rect(0,0, Width, Height);
|
||||
OldFont:=SelectObject(DC, Font.Handle);
|
||||
Flags:=DT_CalcRect or DT_NoPrefix;
|
||||
Flags:=DT_CalcRect;
|
||||
if WordWrap then inc(Flags,DT_WordBreak);
|
||||
DrawText(DC, PChar(Caption), Length(Caption), R, Flags);
|
||||
SelectObject(DC, OldFont);
|
||||
|
@ -1106,6 +1106,7 @@ begin
|
||||
winHandle := AWinControl.Handle;
|
||||
canvasHandle := GetDC(winHandle);
|
||||
oldFontHandle := SelectObject(canvasHandle, Windows.SendMessage(winHandle, WM_GetFont, 0, 0));
|
||||
DeleteAmpersands(Text);
|
||||
Result := Windows.GetTextExtentPoint32(canvasHandle, PChar(Text), Length(Text), textSize);
|
||||
if Result then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user