mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 12:40:25 +02:00
Message window can be scrolled beyond second to last item
This commit is contained in:
parent
550fd24d29
commit
8e5f22383f
@ -3405,9 +3405,30 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TMessageListBox.HandleEvent(var Event: TEvent);
|
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;
|
var DontClear: boolean;
|
||||||
begin
|
begin
|
||||||
case Event.What of
|
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 :
|
evKeyDown :
|
||||||
begin
|
begin
|
||||||
DontClear:=false;
|
DontClear:=false;
|
||||||
|
Loading…
Reference in New Issue
Block a user