Additional features for Stringgrid.
Original Reporter info from Mantis: K155LA3
-
Reporter name:
Original Reporter info from Mantis: K155LA3
- Reporter name:
Description:
Hello.
Some users to edit the table is used in conjunction with key combination 'Ctrl+C', 'Ctrl+V' and 'Ctrl+X', other key combination, such as 'Ctrl+A', 'Ctrl+Ins', 'Shift+Ins', 'Shift+Del' and 'Del':
1 Select all cells by 'Ctrl+A'.
2 'Ctrl+Ins' as alternative 'Ctrl+C'.
3 'Shift+Ins' as alternative 'Ctrl+V'.
4 'Shift+Del' as alternative 'Ctrl+X'.
5 'Del' to clear selected cells.
Regards.
Steps to reproduce:
1 Add to class description 'TCustomGrid' in section 'protected': --------------cut------------- procedure DoDeleteSelection; virtual; --------------cut-------------
2 Add procedure TCustomGrid.DoDeleteSelection:
--------------cut-------------
procedure TCustomGrid.DoDeleteSelection;
begin
end;
--------------cut-------------
3 Add to class description 'TCustomStringGrid' in section 'protected': --------------cut------------- procedure DoDeleteSelection; override; --------------cut-------------
4 Add procedure TCustomGrid.DoDeleteSelection:
--------------cut-------------
procedure TCustomStringGrid.DoDeleteSelection;
begin
if EditingAllowed(Col) then Clean(Selection, []);
end;
--------------cut-------------
5 Add to 'case Key of' in procedure TCustomGrid.KeyDown:
--------------cut-------------
VK_A:
if not FEditorKey then begin
if ssCtrl in Shift then begin //Select all Ctrl+A
Key := 0;
R:=FGCache.FullVisibleGrid;
Selection := R;
end;
end;
VK_DELETE:
begin
if not FEditorKey then begin
if ssShift in Shift then begin //Alternative Ctrl+X
Key := 0;
doCutToClipboard;
end;
if not(ssShift in Shift) then begin //Delete selected region
Key := 0;
DoDeleteSelection;
end;
end;
end;
VK_INSERT:
if not FEditorKey then begin
if ssCtrl in Shift then begin //Alternative Ctrl+C
Key := 0;
doCopyToClipboard;
end;
if ssShift in Shift then begin //Alternative Ctrl+V
Key := 0;
doPasteFromClipboard;
end;
end;
--------------cut-------------
Mantis conversion info:
- Mantis ID: 24661
- OS: Windows 7, Windows XP
- Version: 1.0.8