mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: File panel context menu by right mouse click
This commit is contained in:
parent
ec2510f8bf
commit
48937a6d76
1 changed files with 28 additions and 6 deletions
|
|
@ -38,6 +38,10 @@ type
|
|||
procedure CMMouseEnter(var Message :TLMessage); message CM_MouseEnter;
|
||||
procedure CMMouseLeave(var Message :TLMessage); message CM_MouseLeave;
|
||||
protected
|
||||
procedure MouseMove(Shift: TShiftState; X,Y: Integer); override;
|
||||
procedure MouseUp(Button: TMouseButton; Shift:TShiftState; X,Y:Integer); override;
|
||||
protected
|
||||
StartDrag: Boolean;
|
||||
DragRowIndex,
|
||||
DropRowIndex: Integer;
|
||||
end;
|
||||
|
|
@ -340,10 +344,8 @@ begin
|
|||
SetFocus;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if iRow >= dgPanel.FixedRows then begin // if not column header
|
||||
dgPanel.BeginDrag(False);
|
||||
end;
|
||||
// indicate that drag start at next mouse move event
|
||||
dgPanel.StartDrag:= True;
|
||||
end;
|
||||
|
||||
procedure TFrameFilePanel.dgPanelStartDrag(Sender: TObject; var DragObject: TDragObject);
|
||||
|
|
@ -1118,8 +1120,6 @@ begin
|
|||
lblLPath.Width:=pnlHeader.Width - 4;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
constructor TFrameFilePanel.Create(AOwner : TWinControl; lblDriveInfo : TLabel; lblCommandPath:TLabel; cmbCommand:TComboBox);
|
||||
var
|
||||
x:Integer;
|
||||
|
|
@ -1267,4 +1267,26 @@ begin
|
|||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TDrawGridEx.MouseMove(Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
iRow, iCol: Integer;
|
||||
begin
|
||||
// if begin drag and not column header
|
||||
if StartDrag then
|
||||
begin
|
||||
MouseToCell(X, Y, iCol, iRow);
|
||||
if (iRow >= FixedRows) then
|
||||
BeginDrag(False);
|
||||
StartDrag:= False;
|
||||
end;
|
||||
inherited MouseMove(Shift, X, Y);
|
||||
end;
|
||||
|
||||
procedure TDrawGridEx.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
|
||||
Y: Integer);
|
||||
begin
|
||||
StartDrag:= False;
|
||||
inherited MouseUp(Button, Shift, X, Y);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue