mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Virtual terminal - speed up scroll by mouse wheel
This commit is contained in:
parent
778c9d11ad
commit
a5846ca9ff
1 changed files with 16 additions and 0 deletions
|
|
@ -230,6 +230,7 @@ type
|
|||
procedure DoStrRecieved(var Str: string); dynamic;
|
||||
procedure DoUnhandledCode(Code: TEscapeCode; Data: string); dynamic;
|
||||
procedure DoUnhandledMode(const Data: string; OnOff: Boolean); dynamic;
|
||||
function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
|
@ -1880,6 +1881,21 @@ begin
|
|||
FOnUnhandledMode(Self, Data, OnOff);
|
||||
end;
|
||||
|
||||
function TCustomComTerminal.DoMouseWheel(Shift: TShiftState;
|
||||
WheelDelta: Integer; MousePos: TPoint): Boolean;
|
||||
var
|
||||
APos: Integer;
|
||||
begin
|
||||
Result:= True;
|
||||
APos:= GetScrollPos(Handle, SB_VERT);
|
||||
if WheelDelta < 0 then
|
||||
APos:= APos + Mouse.WheelScrollLines
|
||||
else begin
|
||||
APos:= APos - Mouse.WheelScrollLines;
|
||||
end;
|
||||
ModifyScrollBar(SB_VERT, SB_THUMBPOSITION, APos);
|
||||
end;
|
||||
|
||||
// create escape codes processor
|
||||
procedure TCustomComTerminal.CreateEscapeCodes;
|
||||
begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue