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:
cobines 2012-05-06 07:50:45 +00:00
commit 07655ae26f
2 changed files with 12 additions and 3 deletions

View file

@ -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;

View file

@ -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;