mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 09:29:10 +02:00
LCL, grid improvement (inplace editing of cell values with picklisteditor and stringeditor), from Oleg, issue #15833
git-svn-id: trunk@27317 -
This commit is contained in:
parent
05a65583d1
commit
90bf8f4f5e
@ -226,6 +226,7 @@ type
|
|||||||
procedure DropDown; override;
|
procedure DropDown; override;
|
||||||
procedure CloseUp; override;
|
procedure CloseUp; override;
|
||||||
procedure Select; override;
|
procedure Select; override;
|
||||||
|
procedure Change; override;
|
||||||
procedure msg_GetValue(var Msg: TGridMessage); message GM_GETVALUE;
|
procedure msg_GetValue(var Msg: TGridMessage); message GM_GETVALUE;
|
||||||
procedure msg_SetGrid(var Msg: TGridMessage); message GM_SETGRID;
|
procedure msg_SetGrid(var Msg: TGridMessage); message GM_SETGRID;
|
||||||
procedure msg_SetValue(var Msg: TGridMessage); message GM_SETVALUE;
|
procedure msg_SetValue(var Msg: TGridMessage); message GM_SETVALUE;
|
||||||
@ -9528,6 +9529,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomStringGrid.SetEditText(aCol, aRow: Longint; const aValue: string);
|
procedure TCustomStringGrid.SetEditText(aCol, aRow: Longint; const aValue: string);
|
||||||
begin
|
begin
|
||||||
|
if not EditorIsReadOnly then begin
|
||||||
GridFlags := GridFlags + [gfEditorUpdateLock];
|
GridFlags := GridFlags + [gfEditorUpdateLock];
|
||||||
try
|
try
|
||||||
if Cells[aCol, aRow]<>aValue then
|
if Cells[aCol, aRow]<>aValue then
|
||||||
@ -9535,6 +9537,7 @@ begin
|
|||||||
finally
|
finally
|
||||||
GridFlags := GridFlags - [gfEditorUpdateLock];
|
GridFlags := GridFlags - [gfEditorUpdateLock];
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
inherited SetEditText(aCol, aRow, aValue);
|
inherited SetEditText(aCol, aRow, aValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -10746,14 +10749,20 @@ end;
|
|||||||
procedure TPickListCellEditor.Select;
|
procedure TPickListCellEditor.Select;
|
||||||
begin
|
begin
|
||||||
if FGrid<>nil then begin
|
if FGrid<>nil then begin
|
||||||
if FGrid.EditorIsReadOnly then
|
|
||||||
exit;
|
|
||||||
FGrid.SetEditText(FCol, FRow, Text);
|
FGrid.SetEditText(FCol, FRow, Text);
|
||||||
FGrid.PickListItemSelected(Self);
|
FGrid.PickListItemSelected(Self);
|
||||||
end;
|
end;
|
||||||
inherited Select;
|
inherited Select;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPickListCellEditor.Change;
|
||||||
|
begin
|
||||||
|
if FGrid<>nil then begin
|
||||||
|
FGrid.SetEditText(FCol, FRow, Text);
|
||||||
|
end;
|
||||||
|
inherited Change;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPickListCellEditor.msg_GetValue(var Msg: TGridMessage);
|
procedure TPickListCellEditor.msg_GetValue(var Msg: TGridMessage);
|
||||||
begin
|
begin
|
||||||
Msg.Col := FCol;
|
Msg.Col := FCol;
|
||||||
|
Loading…
Reference in New Issue
Block a user