mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 02:59:41 +02:00
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:
parent
74a4ec4286
commit
68e504e4e8
@ -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 }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user