View Issue Details

IDProjectCategoryView StatusLast Update
0026929LazarusDatabase Componentspublic2014-10-26 16:06
ReporterLuca OlivettiAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.6Product Build 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0026929: TDBGrid prevents record insertion due to spurious exit event
DescriptionWhen a TDBGrid is not the first control in the taborder and a cell editor is visible (e.g. with dgAlwaysShowEditor) and dgCancelOnExit is true, it's impossible to insert a record, since a spurious exit event is generated which cancels the insert.
Steps To ReproduceUsing the attached project:

1) make sure the grid is populated with some rows (it should be since there's a data file in the project)

2) click somewhere in the middle of the grid

3) click the "Insert record" (+) button in the db navigator

no record is inserted and, if you look carefully, you'll see that edit1 will flicker.

If you then click button1 to hide edit1 then it's possible to insert the record.
It would also work if the grid is the first control in the taborder.
Additional InformationWin32 specific (doesn't happen in Linux) I cannot currently test win64.

This is the call stack when I put a breakpoint in TCustomDBGrid.DoExit but I don't know what triggers the event.

#0 TCUSTOMDBGRID__DOEXIT(<error reading variable>) at dbgrids.pas:2630
0000001 TWINCONTROL__CMEXIT({MSG = 45083, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}, <error reading variable>) at .\include\wincontrol.inc:8134
0000002 TOBJECT__DISPATCH(void, <error reading variable>) at D:\fpc-2.6.4\rtl\inc\objpas.inc:592
0000003 TCONTROL__WNDPROC({MSG = 45083, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}, <error reading variable>) at .\include\control.inc:2108
0000004 TWINCONTROL__WNDPROC({MSG = 45083, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}, <error reading variable>) at .\include\wincontrol.inc:5326
0000005 TCUSTOMGRID__WNDPROC({MSG = 45083, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}, <error reading variable>) at grids.pas:4580
0000006 TCUSTOMDBGRID__WNDPROC({MSG = 45083, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {}}, <error reading variable>) at dbgrids.pas:1308
0000007 TCONTROL__PERFORM(45083, 0, 0, <error reading variable>) at .\include\control.inc:1445
0000008 SENDENTEREXITLOOP(0x161ec24) at .\include\customform.inc:2339
0000009 TCUSTOMFORM__SETFOCUSEDCONTROL(0xc2778, <error reading variable>) at .\include\customform.inc:2446
0000010 TWINCONTROL__WNDPROC({MSG = 7, WPARAM = 0, LPARAM = 0, RESULT = 1, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {}, LPARAMLO = 0, LPARAMHI = 0, LPARAMFILLER = {}, RESULTLO = 1, RESULTHI = 0, RESULTFILLER = {}}, <error reading variable>) at .\include\wincontrol.inc:5245
0000011 DELIVERMESSAGE(0xc2778, void) at lclmessageglue.pas:112
0000012 WINDOWPROC(5243578, 7, 3277580, 0) at .\win32\win32callback.inc:2480
0000013 USER32!GetDC at :0
0000014 TWINCONTROL__AUTOSIZEPHASES(<error reading variable>) at .\include\wincontrol.inc:2371
0000015 USER32!GetDC at :0
0000016 DISPOSECOMBOEDITWINDOWINFO(0x0) at .\win32\win32callback.inc:216
0000017 USER32!DefWindowProcW at :0
0000018 ?? at :0
TagsNo tags attached.
Fixed in Revision46680
LazTarget1.4
WidgetsetWin32/Win64
Attached Files

Activities

Luca Olivetti

2014-10-23 11:31

reporter  

bug3.zip (2,995 bytes)

Jesus Reyes

2014-10-26 01:08

developer   ~0078611

Thanks for your samples, please test.

Can be merged to fixes if needed.

Luca Olivetti

2014-10-26 16:06

reporter   ~0078627

Thank you Jesús.

Issue History

Date Modified Username Field Change
2014-10-23 11:31 Luca Olivetti New Issue
2014-10-23 11:31 Luca Olivetti File Added: bug3.zip
2014-10-23 19:38 Jesus Reyes Assigned To => Jesus Reyes
2014-10-23 19:38 Jesus Reyes Status new => assigned
2014-10-26 01:08 Jesus Reyes Fixed in Revision => 46680
2014-10-26 01:08 Jesus Reyes LazTarget => 1.4
2014-10-26 01:08 Jesus Reyes Note Added: 0078611
2014-10-26 01:08 Jesus Reyes Status assigned => resolved
2014-10-26 01:08 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-10-26 01:08 Jesus Reyes Resolution open => fixed
2014-10-26 01:08 Jesus Reyes Target Version => 1.4
2014-10-26 16:06 Luca Olivetti Note Added: 0078627
2014-10-26 16:06 Luca Olivetti Status resolved => closed