Recent

Author Topic: More on DBGrid exit problems  (Read 5805 times)

iru

  • Sr. Member
  • ****
  • Posts: 321
More on DBGrid exit problems
« on: May 14, 2010, 10:23:26 pm »
Gentlefolk,

Using Laz 0.9.28, ZEOS 6.6.6, Windows XP SP3.

I am back on the "DBGrid exit" problem as other problems were resolved by ZEOS 7.0.

I have created a simple one form test application of DBGrid>DataSource>ZQuery structure (NO user code). All works Ok, data displays nicely, etc.

Run the program, click on the cell in the DBGrid which is highlighted and the 'OnExit' event fires. The highlight dissapears, type in one character and the highlight re-appears, type in a second character and the 'OnEvent' event fires.

Reset and run the program again, type in one character (into the 'selected cell/?) and the 'OnExit' event fires.

So why, what is going on?

A look at the stack trace seems to indicate that this is initiated by windows, as follows:

#0 TFORM1__DBGRID1EXIT(0x2f0f8d0, 0x2f0f470) at unit1.pas:39
#1 TWINCONTROL__DOEXIT(0x2f0f8d0) at wincontrol.inc:6091
#2 TCUSTOMGRID__DOEXIT(0x2f0f8d0) at grids.pas:5500
#3 TCUSTOMDBGRID__DOEXIT(0x2f0f8d0) at dbgrids.pas:2350
#4 TWINCONTROL__WMKILLFOCUS({MSG = 8, ) at wincontrol.inc:6203
#5 TCUSTOMGRID__WMKILLFOCUS({MSG = 8, ) at grids.pas:3795
#6 SYSTEM_TOBJECT_$__DISPATCH$formal at :0
#7 NEXTROWHEIGHT(44037616, 49346768, 0x0) at grids.pas:3695
#8 TWINCONTROL__WNDPROC({MSG = 8, ) at wincontrol.inc:4920
#9 TCUSTOMGRID__WNDPROC({MSG = 8, ) at grids.pas:3850
#10 TCUSTOMDBGRID__WNDPROC({MSG = 8, ) at dbgrids.pas:1211
#11 DELIVERMESSAGE(0x2f0f8d0, void) at lclmessageglue.pas:111
#12 WINDOWPROC(3473878, 8, 2359732, 0) at win32callback.inc:2574
#13 USER32!GetDC at :0
#14 ?? at :0

I beleive the MSG=8 is the LM_KILLFOCUS messaage/command from windows.

I have changed the structure to DBgrid/DataSource/MemDataset and the same things happen.

Whats going on? Any help appreciated, Ian


jesusr

  • Sr. Member
  • ****
  • Posts: 489
Re: More on DBGrid exit problems
« Reply #1 on: May 15, 2010, 05:16:16 am »
this looks like the focus change between the grid and the string cell editor. Exactly what is the problem? what are you trying to achieve?

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: More on DBGrid exit problems
« Reply #2 on: May 18, 2010, 09:59:34 pm »
Gentlefolk,

My program has a large grid where athletics data is input, modified, deleted, etc. The user can exit the grid by clicking on a number of other objects on the screen.

On the exit from the grid I need to write any changes to the database, only once, when control leaves the grid. I can set all sorts of flags in the grid code and check them on exit but this is extremely ugly and I wanted something stateless.

Thats it, I need to know when (and only when) control leaves the grid.

Thanks, Ian 


jesusr

  • Sr. Member
  • ****
  • Posts: 489
Re: More on DBGrid exit problems
« Reply #3 on: May 19, 2010, 05:37:00 pm »
Could you please make your test application available?, Preferable submit a bug report in bugtracker ( http://bugs.freepascal.org/view_all_bug_page.php?project_id=1 ) and attach your test application code and precise instructions on how to reproduce there. I want to be sure to fix this issue before next release.

If you could reproduce the problem using a simple tdbf component (for a test database see lazarus/components/lazreport/samples/editor/db) it would be even better as we don't have to deal with different db engines.

At the moment it looks like is a windows only problem (but I have not tested myself), because I cannot reproduce it in Linux and this is where an independent test app could help.

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: More on DBGrid exit problems
« Reply #4 on: May 20, 2010, 01:55:01 am »
Thanks for the response,

I have raised a problem with the bugtracker.

Ian.

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: More on DBGrid exit problems
« Reply #5 on: May 25, 2010, 09:51:49 pm »
Gentlefolk,

Raised the issue in the BugTrack, it was suggested that I move to a more recent version of lazarus.

Did so, version 0.9.29 build 25626.

Problem solved, thanks, Ian

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: More on DBGrid exit problems - even more, it is back!!!!
« Reply #6 on: June 28, 2010, 01:32:21 pm »
Gentlefolk,

I have been working away on my projectand during some testing I note that the problem of unwanted EXITS from a DBGrid has re-appeared!!!

Yes, enter some data in a cell, hit the enter button and the 'onexit' event fires.

Problem does not appear on my simple test program.

On my project I created an additional form, added a grid and pointed it to the same database as the other failing DBGrids.

Works OK, no exit.

Added a new grid to the same form as the grids that have the exit problem.

The new grid has the same exit problem as the original grids!!!!!!!!!!!!!!!!

I have checked all the grid configurations, all look OK, nothing strange or different.

Errrrkkkkk!

Ian

 

TinyPortal © 2005-2018