View Issue Details

IDProjectCategoryView StatusLast Update
0017801LazarusLCLpublic2010-11-06 07:45
ReporterStephanoAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0017801: StringGrid cell accepts only one character
DescriptionOnly the last character typed will be present in a StringGrid cell if focus is shifted to the StringGrid.

Lazarus 0.9.29 r28035 FPC 2.4.2 i386-linux-gtk 2

Test project attached.
TagsNo tags attached.
Fixed in Revision28104
LazTarget0.9.30
WidgetsetGTK 2
Attached Files
  • StringGridBug.zip (2,267 bytes)
  • gtk2focusdiffs.diff (2,190 bytes)
    Index: lcl/interfaces/gtk2/gtk2callback.inc
    ===================================================================
    --- lcl/interfaces/gtk2/gtk2callback.inc	(revision 28100)
    +++ lcl/interfaces/gtk2/gtk2callback.inc	(working copy)
    @@ -860,7 +860,8 @@
       DebugLn('');
       {$ENDIF}
     
    -  if LCLObject is TCustomForm then begin
    +  if LCLObject is TCustomForm then
    +  begin
         // a form became active
         // it does not mean: the control focus is switch to the form
         AForm:=TCustomForm(LCLObject);
    @@ -883,7 +884,7 @@
       FillChar(Mess,SizeOf(Mess),0);
       Mess.msg := LM_SETFOCUS;
       DeliverMessage(Data,  Mess);
    -  Result:=true;
    +  Result := CallBackDefaultReturn;
     end;
     
     function GTKKillFocusCB(widget: PGtkWidget; event:PGdkEventFocus;
    Index: lcl/interfaces/gtk2/gtk2widgetset.inc
    ===================================================================
    --- lcl/interfaces/gtk2/gtk2widgetset.inc	(revision 28100)
    +++ lcl/interfaces/gtk2/gtk2widgetset.inc	(working copy)
    @@ -57,7 +57,8 @@
     var
       Status : gBoolean;
     begin
    -  Status := GTKFocusCB(Widget, Event, Data);
    +  // Status := GTKFocusCB(Widget, Event, Data);
    +  Status := GTKFocusCBAfter(Widget, Event, Data);
     
       if GtkWidgetIsA(Widget,GTK_APIWIDGETCLIENT_TYPE) then
         Result := Status
    @@ -123,7 +124,8 @@
     var
       Status : gBoolean;
     begin
    -  Status := GTKKillFocusCB(Widget, Event, Data);
    +  Status := GTKKillFocusCBAfter(Widget, Event, Data);
    +  // GTKKillFocusCB(Widget, Event, Data);
     
       if GtkWidgetIsA(Widget,GTK_APIWIDGETCLIENT_TYPE) then
         Result := Status
    @@ -855,9 +857,9 @@
       begin
         //DebugLn(['ConnectFocusEvents ',GetWidgetDebugReport(PGtkWidget(AnObject))]);
         ConnectSenderSignal(AnObject, 'focus-in-event', @gtk2FocusCB);
    -    ConnectSenderSignalAfter(AnObject, 'focus-in-event', @gtk2FocusCBAfter);
    +    // ConnectSenderSignalAfter(AnObject, 'focus-in-event', @gtk2FocusCBAfter);
         ConnectSenderSignal(AnObject, 'focus-out-event', @gtk2KillFocusCB);
    -    ConnectSenderSignalAfter(AnObject, 'focus-out-event', @gtk2KillFocusCBAfter);
    +    // ConnectSenderSignalAfter(AnObject, 'focus-out-event', @gtk2KillFocusCBAfter);
       end;
     
       procedure ConnectKeyPressReleaseEvents(const AnObject: PGTKObject);
    
    gtk2focusdiffs.diff (2,190 bytes)

Activities

2010-11-02 10:47

 

StringGridBug.zip (2,267 bytes)

Stephano

2010-11-02 11:47

developer   ~0042595

Note: Once the project is run, click the stringgrid cell once and start typing. Double clicking will not show this bug.

2010-11-05 20:59

 

gtk2focusdiffs.diff (2,190 bytes)
Index: lcl/interfaces/gtk2/gtk2callback.inc
===================================================================
--- lcl/interfaces/gtk2/gtk2callback.inc	(revision 28100)
+++ lcl/interfaces/gtk2/gtk2callback.inc	(working copy)
@@ -860,7 +860,8 @@
   DebugLn('');
   {$ENDIF}
 
-  if LCLObject is TCustomForm then begin
+  if LCLObject is TCustomForm then
+  begin
     // a form became active
     // it does not mean: the control focus is switch to the form
     AForm:=TCustomForm(LCLObject);
@@ -883,7 +884,7 @@
   FillChar(Mess,SizeOf(Mess),0);
   Mess.msg := LM_SETFOCUS;
   DeliverMessage(Data,  Mess);
-  Result:=true;
+  Result := CallBackDefaultReturn;
 end;
 
 function GTKKillFocusCB(widget: PGtkWidget; event:PGdkEventFocus;
Index: lcl/interfaces/gtk2/gtk2widgetset.inc
===================================================================
--- lcl/interfaces/gtk2/gtk2widgetset.inc	(revision 28100)
+++ lcl/interfaces/gtk2/gtk2widgetset.inc	(working copy)
@@ -57,7 +57,8 @@
 var
   Status : gBoolean;
 begin
-  Status := GTKFocusCB(Widget, Event, Data);
+  // Status := GTKFocusCB(Widget, Event, Data);
+  Status := GTKFocusCBAfter(Widget, Event, Data);
 
   if GtkWidgetIsA(Widget,GTK_APIWIDGETCLIENT_TYPE) then
     Result := Status
@@ -123,7 +124,8 @@
 var
   Status : gBoolean;
 begin
-  Status := GTKKillFocusCB(Widget, Event, Data);
+  Status := GTKKillFocusCBAfter(Widget, Event, Data);
+  // GTKKillFocusCB(Widget, Event, Data);
 
   if GtkWidgetIsA(Widget,GTK_APIWIDGETCLIENT_TYPE) then
     Result := Status
@@ -855,9 +857,9 @@
   begin
     //DebugLn(['ConnectFocusEvents ',GetWidgetDebugReport(PGtkWidget(AnObject))]);
     ConnectSenderSignal(AnObject, 'focus-in-event', @gtk2FocusCB);
-    ConnectSenderSignalAfter(AnObject, 'focus-in-event', @gtk2FocusCBAfter);
+    // ConnectSenderSignalAfter(AnObject, 'focus-in-event', @gtk2FocusCBAfter);
     ConnectSenderSignal(AnObject, 'focus-out-event', @gtk2KillFocusCB);
-    ConnectSenderSignalAfter(AnObject, 'focus-out-event', @gtk2KillFocusCBAfter);
+    // ConnectSenderSignalAfter(AnObject, 'focus-out-event', @gtk2KillFocusCBAfter);
   end;
 
   procedure ConnectKeyPressReleaseEvents(const AnObject: PGTKObject);
gtk2focusdiffs.diff (2,190 bytes)

Zeljan Rikalo

2010-11-05 20:59

developer   ~0042812

Uploaded JUST test if it works now. This is not real patch !

Stephano

2010-11-05 23:13

developer   ~0042814

It works with the patch.

Paul Ishenin

2010-11-06 05:19

manager   ~0042817

Please test and close if ok.

Issue History

Date Modified Username Field Change
2010-11-02 10:47 Stephano New Issue
2010-11-02 10:47 Stephano File Added: StringGridBug.zip
2010-11-02 10:47 Stephano Widgetset => GTK 2
2010-11-02 11:30 Vincent Snijders LazTarget => 1.0
2010-11-02 11:30 Vincent Snijders Assigned To => Jesus Reyes
2010-11-02 11:30 Vincent Snijders Status new => assigned
2010-11-02 11:30 Vincent Snijders Target Version => 1.0.0
2010-11-02 11:47 Stephano Note Added: 0042595
2010-11-05 20:59 Zeljan Rikalo File Added: gtk2focusdiffs.diff
2010-11-05 20:59 Zeljan Rikalo Note Added: 0042812
2010-11-05 23:13 Stephano Note Added: 0042814
2010-11-06 05:19 Paul Ishenin Fixed in Revision => 28104
2010-11-06 05:19 Paul Ishenin LazTarget 1.0 => 0.9.30
2010-11-06 05:19 Paul Ishenin Status assigned => resolved
2010-11-06 05:19 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-11-06 05:19 Paul Ishenin Resolution open => fixed
2010-11-06 05:19 Paul Ishenin Note Added: 0042817
2010-11-06 05:19 Paul Ishenin Target Version 1.0.0 => 0.9.30
2010-11-06 07:45 Stephano Status resolved => closed