fix drawing of listbox, combobox, edit to be non-transparent even in winxp tabpage (fixes black background upon scroll)

git-svn-id: trunk@6190 -
This commit is contained in:
micha 2004-11-03 16:32:54 +00:00
parent 8960dd3810
commit 4abc2f15e5
2 changed files with 19 additions and 13 deletions

View File

@ -538,7 +538,9 @@ Begin
// transparently
// only static and button controls have transparent parts
// others need to erased with their window color
if ((Msg = WM_CTLCOLORSTATIC) or (Msg = WM_CTLCOLORBTN)) then
// scrollbar also has buttons
if (Msg = WM_CTLCOLORSTATIC) or (Msg = WM_CTLCOLORBTN)
or (Msg = WM_CTLCOLORSCROLLBAR) then
begin
if WindowInfo^.isGroupBox then
begin
@ -546,18 +548,11 @@ Begin
end else
if GetWindowInfo(LParam)^.hasTabParent then
begin
// comboboxes send WM_CTLCOLORSTATIC to their parent, but:
// 1) they are opaque, so don't need transparent background
// 2) we will overwrite combobox control, erasing the image!
GetClassName(LParam, winClassName, 10);
if not CompareMem(@winClassName, @ComboboxClsName, High(ComboBoxClsName)+1) then
begin
// need to draw transparently, draw background
GetWin32ControlPos(LParam, Window, P.X, P.Y);
MoveWindowOrgEx(WParam, -P.X, -P.Y);
SendMessage(Window, WM_PAINT, WParam, 0);
MoveWindowOrgEx(WParam, P.X, P.Y);
end;
// need to draw transparently, draw background
GetWin32ControlPos(LParam, Window, P.X, P.Y);
MoveWindowOrgEx(WParam, -P.X, -P.Y);
SendMessage(Window, WM_PAINT, WParam, 0);
MoveWindowOrgEx(WParam, P.X, P.Y);
LMessage.Result := GetStockObject(HOLLOW_BRUSH);
SetBkMode(WParam, TRANSPARENT);
WinProcess := false;
@ -1441,6 +1436,9 @@ end;
{
$Log$
Revision 1.153 2004/11/03 16:32:54 micha
fix drawing of listbox, combobox, edit to be non-transparent even in winxp tabpage (fixes black background upon scroll)
Revision 1.152 2004/10/29 18:55:30 micha
speed up menu creation

View File

@ -433,6 +433,8 @@ begin
end;
// create window
FinishCreateWindow(AWinControl, Params, false);
// listbox is not a transparent control -> no need for parentpainting
Params.WindowInfo^.hasTabParent := false;
Result := Params.Window;
end;
@ -586,6 +588,8 @@ begin
end;
// create window
FinishCreateWindow(AWinControl, Params, false);
// combobox is not a transparent control -> no need for parentpainting
Params.WindowInfo^.hasTabParent := false;
// get edit window within
with Params do
begin
@ -761,6 +765,8 @@ begin
end;
// create window
FinishCreateWindow(AWinControl, Params, false);
// edit is not a transparent control -> no need for parentpainting
Params.WindowInfo^.hasTabParent := false;
Result := Params.Window;
end;
@ -870,6 +876,8 @@ begin
end;
// create window
FinishCreateWindow(AWinControl, Params, false);
// memo is not a transparent control -> no need for parentpainting
Params.WindowInfo^.hasTabParent := false;
Result := Params.Window;
end;