mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 16:40:32 +02:00
win32 interface: fixed calculating text size on bitbtns (bug #11618)
git-svn-id: trunk@15690 -
This commit is contained in:
parent
e8071d14a8
commit
ae5a3cc7b8
@ -1251,7 +1251,7 @@ var
|
||||
begin
|
||||
winHandle := AWinControl.Handle;
|
||||
canvasHandle := Windows.GetDC(winHandle);
|
||||
oldFontHandle := SelectObject(canvasHandle, Windows.SendMessage(winHandle, WM_GetFont, 0, 0));
|
||||
oldFontHandle := SelectObject(canvasHandle, AWinControl.Font.Reference.Handle);
|
||||
DeleteAmpersands(Text);
|
||||
|
||||
Result := LCLIntf.GetTextExtentPoint32(canvasHandle, PChar(Text), Length(Text), textSize);
|
||||
|
@ -1874,7 +1874,7 @@ begin
|
||||
// the length of utf8 vs Wide/Ansi the strings differ, so recalc.
|
||||
if UnicodeEnabledOS then
|
||||
begin
|
||||
// TODO: use the real number of chars (and not the lenght)
|
||||
// TODO: use the real number of chars (and not the length)
|
||||
w := Utf8Decode(S);
|
||||
Result := Windows.GetTextExtentPoint32W(DC, PWideChar(W), Length(W), @Size);
|
||||
end else
|
||||
|
@ -167,7 +167,7 @@ var
|
||||
// fill with background color
|
||||
OldBitmapHandle := SelectObject(hdcNewBitmap, NewBitmap);
|
||||
|
||||
// dont use BitBtn.Brush.Reference.Handle - since button is painted with BtnFact color and
|
||||
// dont use BitBtn.Brush.Reference.Handle - since button is painted with BtnFace color and
|
||||
// only glyph will have that bg - this will look very ugly
|
||||
|
||||
Windows.FillRect(hdcNewBitmap, BitmapRect, GetSysColorBrush(COLOR_BTNFACE));
|
||||
|
Loading…
Reference in New Issue
Block a user