win32: remove a mess with painting on notebook, add simple support for csParentBackground required for transparent frames painting

git-svn-id: trunk@28149 -
This commit is contained in:
paul 2010-11-08 08:17:16 +00:00
parent cd70f00a57
commit 0fa685a539
2 changed files with 6 additions and 17 deletions

View File

@ -355,7 +355,6 @@ var
isNotebook: boolean;
isNativeControl: boolean;
needParentPaint: boolean;
lNotebookFound: boolean;
BufferWasSaved: Boolean;
BackupBuffer: TDoubleBuffer;
begin
@ -370,24 +369,14 @@ var
// create a paint message
isNotebook := ThemeServices.ThemesEnabled and (WndClassName(Window) = TabControlClsName);
isNativeControl := GetIsNativeControl(Window);
ParentPaintWindow := 0;
needParentPaint := GetNeedParentPaint(WindowInfo, lWinControl);
// if needParentPaint and not isTabPage then background will be drawn in
// WM_ERASEBKGND and WM_CTLCOLORSTATIC for native controls
// sent by default paint handler
if WindowInfo^.isTabPage or (needParentPaint
and (not isNativeControl or (ControlDC <> 0))) then
begin
ParentPaintWindow := Window;
lNotebookFound := false;
while (ParentPaintWindow <> 0) and not lNotebookFound do
begin
// notebook is parent of window that has istabpage
if GetWin32WindowInfo(ParentPaintWindow)^.isTabPage then
lNotebookFound := true;
ParentPaintWindow := Windows.GetParent(ParentPaintWindow);
end;
end;
if WindowInfo^.isTabPage or (needParentPaint and (not isNativeControl or (ControlDC <> 0))) then
ParentPaintWindow := Windows.GetParent(Window)
else
ParentPaintWindow := 0;
// if painting background of some control for tabpage, don't handle erase background
// in parent of tabpage

View File

@ -285,8 +285,8 @@ begin
if not NCCreateParams.Handled then
begin
WindowInfo := AllocWindowInfo(Window);
if GetWin32WindowInfo(Parent)^.needParentPaint then
WindowInfo^.needParentPaint := true;
WindowInfo^.needParentPaint := GetWin32WindowInfo(Parent)^.needParentPaint or
(Assigned(AWinControl) and (csParentBackground in AWinControl.ControlStyle));
WindowInfo^.WinControl := AWinControl;
AWinControl.Handle := Window;
if Assigned(SubClassWndProc) then