LCL, fix dbgrid right click selection when dgAnyButtonCanSelect option is active, patch by Emil Totev, issue #37357

This commit is contained in:
Jesus Reyes A 2021-08-14 16:42:06 -05:00
parent 1c87dc96eb
commit a80484b538

View File

@ -2820,10 +2820,10 @@ begin
if ssCtrl in Shift then if ssCtrl in Shift then
ToggleSelectedRow ToggleSelectedRow
else begin else begin
if Button=mbLeft then if (Button=mbLeft) or (dgAnyButtonCanSelect in Options) then
ClearSelection(true) ClearSelection(true);
// Select row before popupmenu // Select row before popupmenu
else if (Button=mbRight) and Assigned(PopupMenu) and not FSelectedRows.CurrentRowSelected then if (Button=mbRight) and Assigned(PopupMenu) and not FSelectedRows.CurrentRowSelected then
ToggleSelectedRow; ToggleSelectedRow;
doMoveToColumn; doMoveToColumn;
end; end;