HMG 2.8.3 (Forum Test)

HMG announcements; Latest HMG-related news, releases, fixes and updates.

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: About 2.8.3 and Esgici Sample...

Post by Roberto Lopez »

esgici wrote:
Roberto Lopez wrote: Spinners has its own 'OnChange' events that programmatically changes the selection of the grid again to its current values already changed interactively by the users... :)

The result is that Grid 'OnChange' event is fired multiple times and the sample is not working as expected.
Sorry, I couldn't understand this theory :(

Let look at this verbose animation :

User : You GRID, set your value to { x, y }
GRID : Ok, setted; you SPNR, my value changed to { x, y }
SPNR : Ok, me too setted; you GRID, my value changed to { x, y }
GRID : Ok, me too setted; you SPNR, my value changed to { x, y }
...

If events goes this way this is clearly an endless loop !

Whereas we haven't any signal about such loop; cursor in its own place, don't disappear; prg accept and responds subsequent user inputs.

IMHO events goes that way :

User : You GRID, set your value to { x, y }
GRID : Ok, setted; you SPNR, my value changed to { x, y }
SPNR : Ok, me too setted; you GRID, my value changed to { x, y }
GRID : Opps, my value is already that; no CHANGE made, so no signal required to SPNR !!!

or

GRID : Ok, me too setted; Does my value changed ?; No. So no signal required to SPNR !!!

I'm not an expert of Win32. Sorry, If I'm wrong.

Regards

--

Esgici
Well... I'm released 2.8.4, so I can give you a better answer now.

As you said, apparently there is not infinite loop in your sample.

This is because controls does not respond in the same way to INTERACTIVE and PROGRAMATIC changes.

Besides that, for simplicity, HMG defines an 'OnChange' for each control, but there is not direct correspondence, between HMG OnChange event and a UNIQUE WIN32 notification message for all controls. So, is very difficult to establish a general rule.

In the cases like exposed in your sample, I recommend you that CHECK if the Grid value has TRULY CHANGED (in Spinner Onchange event) BEFORE attempt to programmatically change again. This should eliminate any possible problems (yet I've not tested, so I could be missing something).

I hope being clear enough.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: About 2.8.3 and Esgici Sample...

Post by esgici »

Roberto Lopez wrote: ...
I hope being clear enough.
Thanks to clarification.

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply