win32: don't perform any logic in DrawFrameControl - just call the windows function. By Luiz Americo (issue #0015358)

git-svn-id: trunk@23230 -
This commit is contained in:
paul 2009-12-22 07:03:31 +00:00
parent ea9cf9905b
commit b09f9f224a

View File

@ -1178,21 +1178,8 @@ end;
Draws a frame control of the specified type and style. Draws a frame control of the specified type and style.
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TWin32WidgetSet.DrawFrameControl(DC: HDC; const Rect: TRect; UType, UState: Cardinal): Boolean; function TWin32WidgetSet.DrawFrameControl(DC: HDC; const Rect: TRect; UType, UState: Cardinal): Boolean;
var
Flags: dword;
begin begin
// flat button border cannot be drawn by DrawFrameControl, draw ourselves Result := Boolean(Windows.DrawFrameControl(DC, @Rect, UType, UState));
if (UType = DFC_BUTTON) and ((UState and DFCS_FLAT) <> 0) then
begin
if (UState and DFCS_PUSHED) <> 0 then
Flags := BDR_SUNKENOUTER
else
if (UState and DFCS_FLAT) <> 0 then Flags := 0
else Flags := BDR_RAISEDINNER;
Result := Boolean(Windows.DrawEdge(DC, @Rect, Flags, BF_RECT));
end else begin
Result := Boolean(Windows.DrawFrameControl(DC, @Rect, UType, UState));
end;
end; end;
function TWin32WidgetSet.DrawFocusRect(DC: HDC; const Rect: TRect): boolean; function TWin32WidgetSet.DrawFocusRect(DC: HDC; const Rect: TRect): boolean;