mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 11:19:23 +02:00
Merged revision(s) 49170 #8077f55310 from trunk:
LCL-Win: Prevent flicker in TListbox. Issue #28146, patch from wp. ........ git-svn-id: branches/fixes_1_4@49198 -
This commit is contained in:
parent
5c2960c762
commit
922c2ab8bb
@ -583,6 +583,9 @@ var
|
|||||||
WindowInfo: PWin32WindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
NCCreateParams: PNCCreateParams;
|
NCCreateParams: PNCCreateParams;
|
||||||
LMessage: TLMessage;
|
LMessage: TLMessage;
|
||||||
|
Count: LResult;
|
||||||
|
Top: Integer;
|
||||||
|
ARect: TRect;
|
||||||
begin
|
begin
|
||||||
case Msg of
|
case Msg of
|
||||||
WM_NCCREATE:
|
WM_NCCREATE:
|
||||||
@ -609,6 +612,26 @@ begin
|
|||||||
LMessage.Result := 0;
|
LMessage.Result := 0;
|
||||||
Exit(DeliverMessage(WindowInfo^.WinControl, LMessage));
|
Exit(DeliverMessage(WindowInfo^.WinControl, LMessage));
|
||||||
end;
|
end;
|
||||||
|
WM_ERASEBKGND:
|
||||||
|
// Avoid unnecessary background paints to avoid flickering of the listbox
|
||||||
|
begin
|
||||||
|
WindowInfo := GetWin32WindowInfo(Window);
|
||||||
|
Count := SendMessage(Window, LB_GETCOUNT, 0, 0);
|
||||||
|
if Assigned(WindowInfo^.WinControl) and
|
||||||
|
(TCustomListBox(WindowInfo^.WinControl).Columns < 2) and
|
||||||
|
(Count <> LB_ERR) and (SendMessage(Window, LB_GETITEMRECT, Count - 1, Windows.LParam(@ARect)) <> LB_ERR) then
|
||||||
|
begin
|
||||||
|
Top := ARect.Bottom;
|
||||||
|
Windows.GetClientRect(Window, ARect);
|
||||||
|
ARect.Top := Top;
|
||||||
|
if not IsRectEmpty(ARect) then
|
||||||
|
Windows.FillRect(HDC(WParam), ARect, WindowInfo^.WinControl.Brush.Reference.Handle);
|
||||||
|
Result := 1;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
// normal processing
|
// normal processing
|
||||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||||
|
Loading…
Reference in New Issue
Block a user