mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
UPD: Set mouse capture when selecting with right mouse button so that messages still come in when mouse it outside the panel.
This commit is contained in:
parent
5898567558
commit
07655ae26f
2 changed files with 12 additions and 3 deletions
|
|
@ -48,6 +48,7 @@ type
|
|||
|
||||
protected
|
||||
function CanAutoScroll: Boolean; override;
|
||||
function CanScroll(const ClientMousePos: TPoint): Boolean; override;
|
||||
function DetermineScrollDirections(X, Y: Integer): TScrollDirections; override;
|
||||
function DoKeyAction(var CharCode: Word; var Shift: TShiftState): Boolean; override;
|
||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X,Y: Integer); override;
|
||||
|
|
@ -1471,6 +1472,11 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function TColumnsDrawTree.CanScroll(const ClientMousePos: TPoint): Boolean;
|
||||
begin
|
||||
Result := ColumnsView.IsMouseSelecting;
|
||||
end;
|
||||
|
||||
procedure TColumnsDrawTree.UpdateView;
|
||||
|
||||
function CalculateDefaultRowHeight: Integer;
|
||||
|
|
|
|||
|
|
@ -299,7 +299,8 @@ end;
|
|||
|
||||
function TFileViewWithMainCtrl.IsMouseSelecting: Boolean;
|
||||
begin
|
||||
Result := FMainControlMouseDown and (FMainControlLastMouseButton = mbRight);
|
||||
Result := FMainControlMouseDown and (FMainControlLastMouseButton = mbRight) and
|
||||
gMouseSelectionEnabled and (gMouseSelectionButton = 1);
|
||||
end;
|
||||
|
||||
procedure TFileViewWithMainCtrl.MainControlDblClick(Sender: TObject);
|
||||
|
|
@ -549,6 +550,7 @@ begin
|
|||
tmContextMenu.Enabled:= True; // start context menu timer
|
||||
MarkFile(AFile, FMouseSelectionLastState, False);
|
||||
DoSelectionChanged(FileIndex);
|
||||
SetCaptureControl(MainControl);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -609,8 +611,6 @@ end;
|
|||
|
||||
procedure TFileViewWithMainCtrl.MainControlMouseLeave(Sender: TObject);
|
||||
begin
|
||||
if (gMouseSelectionEnabled) and (gMouseSelectionButton = 1) then
|
||||
FMainControlMouseDown:= False;
|
||||
end;
|
||||
|
||||
procedure TFileViewWithMainCtrl.MainControlMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
||||
|
|
@ -729,6 +729,9 @@ begin
|
|||
if not FMainControlMouseDown then
|
||||
Exit;
|
||||
|
||||
if IsMouseSelecting and (GetCaptureControl = MainControl) then
|
||||
SetCaptureControl(nil);
|
||||
|
||||
FMainControlMouseDown := False;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue