fix groupbox background erasing

git-svn-id: trunk@5566 -
This commit is contained in:
micha 2004-06-15 15:37:29 +00:00
parent de5188fb17
commit b77559cc9b
2 changed files with 21 additions and 7 deletions

View File

@ -1002,7 +1002,21 @@ Begin
{$ENDIF VER1_1_MSG}
case Msg of
WM_ERASEBKGND, WM_SETCURSOR:
WM_ERASEBKGND:
begin
// Groupbox (which is a button) doesn't erase it's background properly
// it's needed for winxp themes where controls send the WM_ERASEBKGND
// message to their parent to clear their background and then draw
// transparently
if (LMessage.Result = 0) and (TheWinControl <> nil) and
(TheWinControl.FCompStyle = csGroupBox) then
begin
TheWinControl.EraseBackground(WParam)
end else begin
WinProcess := true;
end;
end;
WM_SETCURSOR:
begin
if LMessage.Result = 0 then
WinProcess := true;
@ -1217,6 +1231,9 @@ end;
{
$Log$
Revision 1.114 2004/06/15 15:37:29 micha
fix groupbox background erasing
Revision 1.113 2004/06/14 12:54:02 micha
fix designer cursor to not set Form.Cursor directly

View File

@ -1978,9 +1978,6 @@ Begin
Flags := Flags or BS_PUSHBUTTON;
pClassName := 'BUTTON';
WindowTitle := StrCaption;
// weird drawing bug in winxp when using themes, button on groupbox:
// background button is drawn in black, ws_ex_transparent seems to fix this
FlagsEx := FlagsEx or WS_EX_TRANSPARENT;
End;
csCalendar:
Begin
@ -2139,9 +2136,6 @@ Begin
// BS_AUTORADIOBUTTON may hang the application,
// if the radiobuttons are not consecutive controls.
Flags := Flags Or BS_RADIOBUTTON;
// weird drawing bug in winxp when using themes, button on groupbox:
// background button is drawn in black, ws_ex_transparent seems to fix this
FlagsEx := FlagsEx or WS_EX_TRANSPARENT;
End;
csScrollBar:
Begin
@ -3009,6 +3003,9 @@ End;
{
$Log$
Revision 1.205 2004/06/15 15:37:29 micha
fix groupbox background erasing
Revision 1.204 2004/06/15 14:41:38 micha
fix drawing bug in xp with themes