LCL, dbgrid: enables buttoncolumn's button click even if is not the current record, fix issue #28074

git-svn-id: trunk@49033 -
This commit is contained in:
jesus 2015-05-15 18:17:07 +00:00
parent 46c90d4df2
commit 98a26c9a5a
2 changed files with 21 additions and 12 deletions

View File

@ -2553,6 +2553,8 @@ begin
if InsertCancelable and IsEOF then
doCancel;
doMoveBy;
if IsMouseOverCellButton(X, Y) then
StartPushCell;
end;
if ssCtrl in Shift then
ToggleSelectedRow

View File

@ -780,6 +780,7 @@ type
function doColSizing(X,Y: Integer): Boolean;
function doRowSizing(X,Y: Integer): Boolean;
procedure doColMoving(X,Y: Integer);
procedure doPushCell;
procedure doRowMoving(X,Y: Integer);
procedure doTopleftChange(DimChg: Boolean);
procedure DrawXORVertLine(X: Integer);
@ -1058,6 +1059,7 @@ type
procedure ShowCellHintWindow(APoint: TPoint);
procedure SizeChanged(OldColCount, OldRowCount: Integer); virtual;
procedure Sort(ColSorting: Boolean; index,IndxFrom,IndxTo:Integer); virtual;
procedure StartPushCell;
procedure TopLeftChanged; virtual;
function TryMoveSelection(Relative: Boolean; var DCol, DRow: Integer): Boolean;
procedure UnLockEditor;
@ -3731,6 +3733,12 @@ begin
Application.CancelHint;
end;
procedure TCustomGrid.StartPushCell;
begin
fGridState := gsButtonColumnClicking;
DoPushCell;
end;
function TCustomGrid.SelectCell(ACol, ARow: Integer): Boolean;
begin
Result:=true;
@ -4980,6 +4988,16 @@ begin
doTopleftChange(False)
end;
procedure TCustomGrid.doPushCell;
begin
with FGCache do
begin
PushedCell := ClickCell;
ClickCellPushed:=True;
InvalidateCell(PushedCell.x, PushedCell.y);
end;
end;
function TCustomGrid.IsCellButtonColumn(ACell: TPoint): boolean;
var
Column: TGridColumn;
@ -6052,16 +6070,6 @@ end;
procedure TCustomGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
procedure DoPushCell;
begin
with FGCache do
begin
PushedCell := ClickCell;
ClickCellPushed:=True;
InvalidateCell(PushedCell.x, PushedCell.y);
end;
end;
function DoAutoEdit: boolean;
begin
result := FAutoEdit and EditingAllowed(FCol) and
@ -6152,8 +6160,7 @@ begin
FIgnoreClick := False;
UnlockEditor;
if IsMouseOverCellButton(X, Y) then begin
fGridState := gsButtonColumnClicking;
DoPushCell;
StartPushCell;
Exit;
end else
if FExtendedColSizing and