From ae5a3cc7b8beb9db708381997755bed2475c3387 Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 7 Jul 2008 08:09:30 +0000 Subject: [PATCH] win32 interface: fixed calculating text size on bitbtns (bug #11618) git-svn-id: trunk@15690 - --- lcl/interfaces/win32/win32proc.pp | 2 +- lcl/interfaces/win32/win32winapi.inc | 2 +- lcl/interfaces/win32/win32wsbuttons.pp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lcl/interfaces/win32/win32proc.pp b/lcl/interfaces/win32/win32proc.pp index 8fca366009..6ca1af7225 100644 --- a/lcl/interfaces/win32/win32proc.pp +++ b/lcl/interfaces/win32/win32proc.pp @@ -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); diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index d5e44db23d..191b33d834 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -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 diff --git a/lcl/interfaces/win32/win32wsbuttons.pp b/lcl/interfaces/win32/win32wsbuttons.pp index 56985eb044..94742d9f70 100644 --- a/lcl/interfaces/win32/win32wsbuttons.pp +++ b/lcl/interfaces/win32/win32wsbuttons.pp @@ -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));