win32: invalidate window on WM_UPDATEUISTATE to fix occasional control disappearing, move some groupbox only code to groupbox message handler

git-svn-id: trunk@25022 -
This commit is contained in:
paul 2010-04-28 08:10:10 +00:00
parent 74a4ec4286
commit 68e504e4e8
3 changed files with 10 additions and 17 deletions

View File

@ -1834,12 +1834,6 @@ begin
begin
LMessage.Result := HTTRANSPARENT;
WinProcess := false;
end
else
if (lWinControl is TCustomGroupBox) then
begin
LMessage.Result := HTCLIENT;
WinProcess := false;
end;
end;
end;
@ -2118,7 +2112,7 @@ begin
end;
// cross-interface compatible: complete invalidate on resize
if (PWindowPos(LParam)^.flags and SWP_NOSIZE) = 0 then
Windows.InvalidateRect(Window, nil, true);
Windows.InvalidateRect(Window, nil, True);
end;
WM_MEASUREITEM:
begin
@ -2163,6 +2157,11 @@ begin
ThemeServices.IntfDoOnThemeChange;
end;
end;
WM_UPDATEUISTATE:
begin
if ThemeServices.ThemesEnabled then
InvalidateRect(Window, nil, True);
end;
{ >= WM_USER }

View File

@ -627,7 +627,7 @@ end;
class procedure TWin32WSWinControl.Invalidate(const AWinControl: TWinControl);
begin
// lpRect = nil updates entire client area of window
InvalidateRect(AWinControl.Handle, nil, true);
InvalidateRect(AWinControl.Handle, nil, True);
end;
class procedure TWin32WSWinControl.PaintTo(const AWinControl: TWinControl;

View File

@ -459,20 +459,14 @@ end;
function GroupBoxWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
LParam: Windows.LParam): LResult; stdcall;
var
WindowInfo: PWin32WindowInfo;
begin
// move groupbox specific code here
case Msg of
WM_UPDATEUISTATE:
begin
if ThemeServices.ThemesEnabled then
WM_NCHITTEST:
begin
WindowInfo := GetWin32WindowInfo(Window);
if (WindowInfo <> nil) and (WindowInfo^.WinControl <> nil) then
WindowInfo^.WinControl.Invalidate;
Result := HTCLIENT;
Exit;
end;
end;
end;
Result := WindowProc(Window, Msg, WParam, LParam);
end;