TStringGrid works incorrectly with goEditing in option.
Original Reporter info from Mantis: K155LA3
-
Reporter name:
Original Reporter info from Mantis: K155LA3
- Reporter name:
Description:
Hello.
In Russian version Windows XP, TStringGrid property Options -> goEditing set to 'True', when set language to English, when press key 0..9 or A..Z editor does not show and nothing happens. In Windows 7 it work correctly.
Regards.
P.S.: Product Version set as 1.0.8, but this problem is present also in 1.0.10 version.
Steps to reproduce:
1 Place StringGrid to form.
2 Change property Options->goEditing in object inspector to 'True'.
3 Run programm in Windows XP.
4 Set language to English, when press key 0..9 or A..Z - nothing happens.
5 Set language to Russian, when press key A..Z - editor will be shown and letter will be shown in editor, but when press key 0..9 nothing happens.
6 Run programm in Windows 7.
7 Set language to English, when press key 0..9 or A..Z - editor will be shown and letter will be shown in editor.
8 Set language to Russian, when press key 0..9 or A..Z - editor will be shown and letter will be shown in editor.
P.S.: May be problem with other languages.
Additional information:
I'm think Windows XP send letter in UTF8 charset and Windows 7 send letter in Unicode charset. I'm do some change in lcl\grids.pas in TStringGrid class:
1 In function TCustomGrid.DoUTF8KeyPress:
if EditingAllowed(FCol) and (not result) and (Length(UTF8Key)>1) then begin
change to:
if EditingAllowed(FCol) and (not result) and (Length(UTF8Key)>0) then begin
because in UTF8 numbers and English charset have one char for letter, but Russian charset have two char for letter.
2 In procedure TCustomGrid.KeyDown in case uncommented 'Key := 0;' in VK_C, VK_V, VK_X:
...
VK_C:
if not FEditorKey then begin
if ssCtrl in Shift then begin
Key := 0;
doCopyToClipboard;
end;
end;
VK_V:
if not FEditorKey then begin
if ssCtrl in Shift then begin
Key := 0;
doPasteFromClipboard;
end;
end;
VK_X:
if not FEditorKey then begin
if ssCtrl in Shift then begin
Key := 0;
doCutToClipboard;
end;
end;
...
because witout 'Key := 0;' after 'Ctrl+C', 'Ctrl+V' or 'Ctrl+X' will be called DoUTF8KeyPress procedure.
3 After this cahge programm works correctly in Windows 7 and Windows XP (tested on Russian version Windows).
Mantis conversion info:
- Mantis ID: 24658
- OS: Windows XP
- OS Build: Rusian, SP3
- Version: 1.0.8