win32 interface: fixed calculating text size on bitbtns (bug #11618)

git-svn-id: trunk@15690 -
This commit is contained in:
vincents 2008-07-07 08:09:30 +00:00
parent e8071d14a8
commit ae5a3cc7b8
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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

View File

@ -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));