Message window can be scrolled beyond second to last item

This commit is contained in:
Margers 2025-01-09 21:46:44 +00:00 committed by Michael Van Canneyt
parent 550fd24d29
commit 8e5f22383f

View File

@ -3405,9 +3405,30 @@ end;
procedure TMessageListBox.HandleEvent(var Event: TEvent);
procedure ScrollTo (req : sw_integer);
begin
TopItem:=Max(0,Min(Range-1,req));
If (VScrollBar <> Nil) Then
VScrollBar^.SetValue(TopItem);
DrawView;
end;
var DontClear: boolean;
begin
case Event.What of
evMouseDown: Begin { Mouse down event }
if (Event.Buttons=mbScrollUp) then { mouse scroll up}
begin
if Event.Double then ScrollTo(TopItem+7) else ScrollTo(TopItem+1);
ClearEvent(Event); { Event was handled }
end else
if (Event.Buttons=mbScrollDown) then { mouse scroll down }
begin
if Event.Double then ScrollTo(TopItem-7) else ScrollTo(TopItem-1);
ClearEvent(Event); { Event was handled }
end;
end;
evKeyDown :
begin
DontClear:=false;