Recent

Author Topic: TDBEdit - why data is updated in WMKillFocus instead of EditingDone?  (Read 416 times)

korba812

  • Full Member
  • ***
  • Posts: 196
Currently, data is updated in dataset in the WMKillFocus message handler. This can cause data update problems. The EditingDone method seems to be a more appropriate place, even the documentation mentions it:
https://lazarus-ccr.sourceforge.io/docs/lcl/controls/tcontrol.editingdone.html

But maybe there is some reason why it was implemented this way?

Thaddy

  • Hero Member
  • *****
  • Posts: 10912
Re: TDBEdit - why data is updated in WMKillFocus instead of EditingDone?
« Reply #1 on: April 17, 2021, 06:42:31 pm »
It is the separation between presentation (GUI) and actual compute.
The latter should always be done to keep everything OK. The former is less interesting. You can mitigate that by calling update just before you close.
What you see is not always what you get if you do not understand that difference.
« Last Edit: April 17, 2021, 07:03:25 pm by Thaddy »
The average programmer productivity is 4-5 hours per day. Peak performance 72 hours for short bursts. MTBF is 1 second or less.

 

TinyPortal © 2005-2018