View Issue Details

IDProjectCategoryView StatusLast Update
0024922LazarusLCLpublic2014-11-06 16:57
ReporterPetr-KAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1 (SVN)Product Buildtrunk #42516 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0024922: DBGrid loses focus after CompositeCellEditor is closed
DescriptionIn function TCustomGrid.EditorHide calling Editor.Focused returns bad value
for TCompositeCellEditor. We need to override TCompositeCellEditor.Focused to return right value.

I attach the patch which solves it.
Steps To ReproduceSelect cell in DBGrid with CompositeCellEditor. Press F2 - inplace editor with ellipsis button is showed. Press Esc inplace edit dissapear, but dbgrid loses focus. You cannot move to another column with keyboard.
TagsNo tags attached.
Fixed in Revision44415
LazTarget1.4
WidgetsetGTK 2
Attached Files
  • grids.patch (873 bytes)
    Index: lcl/grids.pas
    ===================================================================
    --- lcl/grids.pas	(revision 42516)
    +++ lcl/grids.pas	(working copy)
    @@ -297,6 +297,7 @@
         destructor Destroy; override;
         procedure AddEditor(aEditor: TWinControl; aAlign: TAlign; ActiveCtrl:boolean);
         procedure SetFocus; override;
    +    function Focused: Boolean; override;
         property MaxLength: Integer read GetMaxLength write SetMaxLength;
         property ActiveControl: TWinControl read GetActiveControl;
       end;
    @@ -12013,6 +12014,17 @@
       inherited SetFocus;
     end;
     
    +function TCompositeCellEditor.Focused: Boolean;
    +var
    +  c: TWinControl;
    +begin
    +  c := GetActiveControl;
    +  if Assigned(c) then
    +    Result := c.Focused
    +  else
    +    Result := inherited Focused;
    +end;
    +
     procedure TCompositeCellEditor.WndProc(var TheMessage: TLMessage);
     begin
       with TheMessage do
    
    grids.patch (873 bytes)

Relationships

related to 0025824 closedJesus Reyes DBGrid Focus regression 

Activities

Petr-K

2013-08-29 15:36

reporter  

grids.patch (873 bytes)
Index: lcl/grids.pas
===================================================================
--- lcl/grids.pas	(revision 42516)
+++ lcl/grids.pas	(working copy)
@@ -297,6 +297,7 @@
     destructor Destroy; override;
     procedure AddEditor(aEditor: TWinControl; aAlign: TAlign; ActiveCtrl:boolean);
     procedure SetFocus; override;
+    function Focused: Boolean; override;
     property MaxLength: Integer read GetMaxLength write SetMaxLength;
     property ActiveControl: TWinControl read GetActiveControl;
   end;
@@ -12013,6 +12014,17 @@
   inherited SetFocus;
 end;
 
+function TCompositeCellEditor.Focused: Boolean;
+var
+  c: TWinControl;
+begin
+  c := GetActiveControl;
+  if Assigned(c) then
+    Result := c.Focused
+  else
+    Result := inherited Focused;
+end;
+
 procedure TCompositeCellEditor.WndProc(var TheMessage: TLMessage);
 begin
   with TheMessage do
grids.patch (873 bytes)

Petr-K

2014-11-06 13:43

reporter   ~0078956

Was fixed in r44415 by jesus.
You can close this issue.

Issue History

Date Modified Username Field Change
2013-08-29 15:36 Petr-K New Issue
2013-08-29 15:36 Petr-K File Added: grids.patch
2013-08-30 19:58 Jesus Reyes Assigned To => Jesus Reyes
2013-08-30 19:58 Jesus Reyes Status new => assigned
2014-11-06 13:43 Petr-K Note Added: 0078956
2014-11-06 16:13 Jesus Reyes Relationship added related to 0025824
2014-11-06 16:15 Jesus Reyes Fixed in Revision => 44415
2014-11-06 16:15 Jesus Reyes LazTarget => 1.4
2014-11-06 16:15 Jesus Reyes Status assigned => resolved
2014-11-06 16:15 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-11-06 16:15 Jesus Reyes Resolution open => fixed
2014-11-06 16:15 Jesus Reyes Target Version => 1.4
2014-11-06 16:57 Petr-K Status resolved => closed