View Issue Details

IDProjectCategoryView StatusLast Update
0029202LazarusLCLpublic2015-12-17 20:01
Reporterabonic1Assigned ToOndrej Pokorny 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformOSWindowsOS Version
Product Version1.6RC1Product Build 
Target Version1.6Fixed in Version1.7 (SVN) 
Summary0029202: F2 key fails to activate proper inplace editor in TStringGrid
DescriptionF2 key activates inplace editor only if the editor is already activated earlier by mouse click. F2 always call previously active editor regardless of current column ButtonStyle.
Steps To Reproduce0. Run attached project (test_grid.zip).
1. Press F2 key in the first column (ButtonStyle=cbsAuto) of the Grid. Nothing happens.
2. Activate StringEditor in the first column by mouse click. Move to the second column (ButtonStyle=cbsPickList). Press F2. StringEditor is activated again.
Additional InformationPossible fix (f2grids.patch):

procedure TCustomGrid.KeyDown(var Key: Word; Shift: TShiftState);
...
    VK_F2:
      if not FEditorKey and EditingAllowed(FCol) then begin
        SelectEditor; // <- FIX
        EditorShow(False);
        Key:=0;
      end;
TagsNo tags attached.
Fixed in Revision50871
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • test grid.zip (5,698 bytes)
  • f2grids.patch (415 bytes)
    Index: lcl/grids.pas
    ===================================================================
    --- lcl/grids.pas	(revision 2)
    +++ lcl/grids.pas	(working copy)
    @@ -6946,6 +6946,7 @@
             EditorShow(False);               // Will show popup menu in the editor.
         VK_F2:
           if not FEditorKey and EditingAllowed(FCol) then begin
    +        SelectEditor;
             EditorShow(False);
             Key:=0;
           end ;
    
    f2grids.patch (415 bytes)

Activities

abonic1

2015-12-17 15:28

reporter  

test grid.zip (5,698 bytes)

abonic1

2015-12-17 15:28

reporter  

f2grids.patch (415 bytes)
Index: lcl/grids.pas
===================================================================
--- lcl/grids.pas	(revision 2)
+++ lcl/grids.pas	(working copy)
@@ -6946,6 +6946,7 @@
         EditorShow(False);               // Will show popup menu in the editor.
     VK_F2:
       if not FEditorKey and EditingAllowed(FCol) then begin
+        SelectEditor;
         EditorShow(False);
         Key:=0;
       end ;
f2grids.patch (415 bytes)

Ondrej Pokorny

2015-12-17 19:39

developer   ~0088050

Applied, thank you!

Issue History

Date Modified Username Field Change
2015-12-17 15:27 abonic1 New Issue
2015-12-17 15:28 abonic1 File Added: test grid.zip
2015-12-17 15:28 abonic1 File Added: f2grids.patch
2015-12-17 18:00 Ondrej Pokorny Assigned To => Ondrej Pokorny
2015-12-17 18:00 Ondrej Pokorny Status new => assigned
2015-12-17 19:39 Ondrej Pokorny Fixed in Revision => 50871
2015-12-17 19:39 Ondrej Pokorny LazTarget => -
2015-12-17 19:39 Ondrej Pokorny Status assigned => resolved
2015-12-17 19:39 Ondrej Pokorny Resolution open => fixed
2015-12-17 19:39 Ondrej Pokorny Note Added: 0088050
2015-12-17 19:40 Ondrej Pokorny Fixed in Version => 1.7 (SVN)
2015-12-17 19:40 Ondrej Pokorny Target Version => 1.6
2015-12-17 20:01 abonic1 Status resolved => closed