mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-15 12:39:07 +02:00
LCL, fix toggle checkbox on column on right click, it should be left click, issue #16482
git-svn-id: trunk@25442 -
This commit is contained in:
parent
aa6b21a51f
commit
15ace269d6
@ -362,7 +362,7 @@ type
|
|||||||
procedure AddAutomaticColumns;
|
procedure AddAutomaticColumns;
|
||||||
procedure BeforeMoveSelection(const DCol,DRow: Integer); override;
|
procedure BeforeMoveSelection(const DCol,DRow: Integer); override;
|
||||||
procedure BeginLayout;
|
procedure BeginLayout;
|
||||||
procedure CellClick(const aCol,aRow: Integer); override;
|
procedure CellClick(const aCol,aRow: Integer; const Button:TMouseButton); override;
|
||||||
procedure InvalidateSizes;
|
procedure InvalidateSizes;
|
||||||
procedure ColRowMoved(IsColumn: Boolean; FromIndex,ToIndex: Integer); override;
|
procedure ColRowMoved(IsColumn: Boolean; FromIndex,ToIndex: Integer); override;
|
||||||
function ColumnEditorStyle(aCol: Integer; F: TField): TColumnButtonStyle;
|
function ColumnEditorStyle(aCol: Integer; F: TField): TColumnButtonStyle;
|
||||||
@ -2262,8 +2262,12 @@ begin
|
|||||||
{$ifdef dbgDBGrid}DebugLn('DBGrid.EditorDoGetValue FIN');{$endif}
|
{$ifdef dbgDBGrid}DebugLn('DBGrid.EditorDoGetValue FIN');{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDBGrid.CellClick(const aCol, aRow: Integer);
|
procedure TCustomDBGrid.CellClick(const aCol, aRow: Integer; const Button:TMouseButton);
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
if Button<>mbLeft then
|
||||||
|
exit;
|
||||||
|
|
||||||
if (aCol>=FirstGridColumn)and(aRow>=FixedRows) then
|
if (aCol>=FirstGridColumn)and(aRow>=FixedRows) then
|
||||||
begin
|
begin
|
||||||
if ColumnEditorStyle(ACol, SelectedField) = cbsCheckboxColumn then begin
|
if ColumnEditorStyle(ACol, SelectedField) = cbsCheckboxColumn then begin
|
||||||
|
@ -796,7 +796,7 @@ type
|
|||||||
procedure CalcFocusRect(var ARect: TRect);
|
procedure CalcFocusRect(var ARect: TRect);
|
||||||
function CanEditShow: Boolean; virtual;
|
function CanEditShow: Boolean; virtual;
|
||||||
function CanGridAcceptKey(Key: Word; Shift: TShiftState): Boolean; virtual;
|
function CanGridAcceptKey(Key: Word; Shift: TShiftState): Boolean; virtual;
|
||||||
procedure CellClick(const aCol,aRow: Integer); virtual;
|
procedure CellClick(const aCol,aRow: Integer; const Button:TMouseButton); virtual;
|
||||||
procedure CheckLimits(var aCol,aRow: Integer);
|
procedure CheckLimits(var aCol,aRow: Integer);
|
||||||
procedure CheckLimitsWithError(const aCol, aRow: Integer);
|
procedure CheckLimitsWithError(const aCol, aRow: Integer);
|
||||||
procedure CMMouseLeave(var Message :TLMessage); message CM_MouseLeave;
|
procedure CMMouseLeave(var Message :TLMessage); message CM_MouseLeave;
|
||||||
@ -1113,7 +1113,7 @@ type
|
|||||||
protected
|
protected
|
||||||
FGrid: TVirtualGrid;
|
FGrid: TVirtualGrid;
|
||||||
procedure CalcCellExtent(acol, aRow: Integer; var aRect: TRect); virtual;
|
procedure CalcCellExtent(acol, aRow: Integer; var aRect: TRect); virtual;
|
||||||
procedure CellClick(const aCol,aRow: Integer); override;
|
procedure CellClick(const aCol,aRow: Integer; const Button:TMouseButton); override;
|
||||||
procedure ColRowDeleted(IsColumn: Boolean; index: Integer); override;
|
procedure ColRowDeleted(IsColumn: Boolean; index: Integer); override;
|
||||||
procedure ColRowExchanged(IsColumn: Boolean; index,WithIndex: Integer); override;
|
procedure ColRowExchanged(IsColumn: Boolean; index,WithIndex: Integer); override;
|
||||||
procedure ColRowInserted(IsColumn: boolean; index: integer); override;
|
procedure ColRowInserted(IsColumn: boolean; index: integer); override;
|
||||||
@ -5469,14 +5469,14 @@ begin
|
|||||||
|
|
||||||
gsNormal:
|
gsNormal:
|
||||||
if not FixedGrid then
|
if not FixedGrid then
|
||||||
CellClick(cur.x, cur.y);
|
CellClick(cur.x, cur.y, Button);
|
||||||
|
|
||||||
gsSelecting:
|
gsSelecting:
|
||||||
begin
|
begin
|
||||||
if SelectActive then
|
if SelectActive then
|
||||||
MoveExtend(False, Cur.x, Cur.y)
|
MoveExtend(False, Cur.x, Cur.y)
|
||||||
else
|
else
|
||||||
CellClick(cur.x, cur.y);
|
CellClick(cur.x, cur.y, Button);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
gsColMoving:
|
gsColMoving:
|
||||||
@ -6329,7 +6329,7 @@ begin
|
|||||||
}
|
}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomGrid.CellClick(const aCol, aRow: Integer);
|
procedure TCustomGrid.CellClick(const aCol, aRow: Integer; const Button:TMouseButton);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -8408,9 +8408,9 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDrawGrid.CellClick(const ACol, ARow: Integer);
|
procedure TCustomDrawGrid.CellClick(const ACol, ARow: Integer; const Button:TMouseButton);
|
||||||
begin
|
begin
|
||||||
if CellNeedsCheckboxBitmaps(ACol, ARow) then
|
if (Button=mbLeft) and CellNeedsCheckboxBitmaps(ACol, ARow) then
|
||||||
ToggleCheckbox;
|
ToggleCheckbox;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user