win32: revert r20538 #dda7ce7306 (fixes bug #0013940)

git-svn-id: trunk@20550 -
This commit is contained in:
paul 2009-06-09 14:01:40 +00:00
parent e12e8cb597
commit 1235f2dd11

View File

@ -148,22 +148,12 @@ var
{$ENDIF} {$ENDIF}
procedure DrawBitmap(AState: TButtonState; UseThemes: Boolean); procedure DrawBitmap(AState: TButtonState; UseThemes: Boolean);
const
ButtonsDetail: array[TButtonState] of TThemedButton = (
{ bsUp } tbPushButtonNormal,
{ bsDisabled } tbPushButtonDisabled,
{ bsDown } tbPushButtonPressed,
{ bsExclusive } tbPushButtonNormal,
{ bsHot } tbPushButtonHot
);
var var
TextFlags: integer; // flags for caption (enabled or disabled) TextFlags: integer; // flags for caption (enabled or disabled)
glyphWidth, glyphHeight: integer; glyphWidth, glyphHeight: integer;
OldBitmapHandle: HBITMAP; // Handle of the provious bitmap in hdcNewBitmap OldBitmapHandle: HBITMAP; // Handle of the provious bitmap in hdcNewBitmap
AIndex: Integer; AIndex: Integer;
AEffect: TGraphicsDrawEffect; AEffect: TGraphicsDrawEffect;
Details: TThemedElementDetails;
begin begin
glyphWidth := srcWidth; glyphWidth := srcWidth;
glyphHeight := srcHeight; glyphHeight := srcHeight;
@ -225,8 +215,6 @@ var
end; end;
end; end;
SetBkMode(hdcNewBitmap, TRANSPARENT); SetBkMode(hdcNewBitmap, TRANSPARENT);
if not UseThemes then
begin
{$IFDEF WindowsUnicodeSupport} {$IFDEF WindowsUnicodeSupport}
if UnicodeEnabledOS then if UnicodeEnabledOS then
begin begin
@ -240,13 +228,6 @@ var
{$ELSE} {$ELSE}
DrawState(hdcNewBitmap, 0, nil, LPARAM(ButtonCaption), 0, XDestText, YDestText, 0, 0, TextFlags); DrawState(hdcNewBitmap, 0, nil, LPARAM(ButtonCaption), 0, XDestText, YDestText, 0, 0, TextFlags);
{$ENDIF} {$ENDIF}
end
else
begin
Details := ThemeServices.GetElementDetails(ButtonsDetail[AState]);
ThemeServices.DrawText(hdcNewBitmap, Details, ButtonCaption,
Rect(XDestText, YDestText, XDestText + TextSize.cx, YDestText + TextSize.cy), 0, 0);
end;
SelectObject(hdcNewBitmap, OldBitmapHandle); SelectObject(hdcNewBitmap, OldBitmapHandle);
end; end;