About 'Values' to be Preserved and Mr. Spock :)
Moderator: Rathinagiri
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
About 'Values' to be Preserved and Mr. Spock :)
Hi All,
I've done a little research and found the following:
There are 17 controls in HMG having an 'OnChange' event.
Seven of these, don't fires the 'OnChange' event when its value is changed programmatically.
We have here a very clear case of 'collision' of two values that should be preserved: Library consistency and backwards compatibility.
As an (ex) Star Trek fan, while thinking about this I've recalled a Mr. Spock recurrent phrase:
"the good of the many outweighs the good of the few, or the one"
It's very clear for me that "the good of the many" here is to have a consistent, easy to learn and bug-free GUI library.
Making another decision could drive us to 'legalize' a bug simply because someone could created an application relying on it.
Doing that as a policy across time, will give as a library plenty of exceptions in controls behaviors, making it difficult to learn.
In such case, we should say to the users something like this:
"Onchange event, will fires when an interactive change occurs for all controls and when a programmatic change occurs only for some controls"
IMHO this is unacceptable.
We must be able to define 'OnChange' event like this:
"Onchange event, will fires when an interactive or programmatic change occurs for all controls"
Please, let me know what is your opinion about that.
Regards,
Roberto.
I've done a little research and found the following:
There are 17 controls in HMG having an 'OnChange' event.
Seven of these, don't fires the 'OnChange' event when its value is changed programmatically.
We have here a very clear case of 'collision' of two values that should be preserved: Library consistency and backwards compatibility.
As an (ex) Star Trek fan, while thinking about this I've recalled a Mr. Spock recurrent phrase:
"the good of the many outweighs the good of the few, or the one"
It's very clear for me that "the good of the many" here is to have a consistent, easy to learn and bug-free GUI library.
Making another decision could drive us to 'legalize' a bug simply because someone could created an application relying on it.
Doing that as a policy across time, will give as a library plenty of exceptions in controls behaviors, making it difficult to learn.
In such case, we should say to the users something like this:
"Onchange event, will fires when an interactive change occurs for all controls and when a programmatic change occurs only for some controls"
IMHO this is unacceptable.
We must be able to define 'OnChange' event like this:
"Onchange event, will fires when an interactive or programmatic change occurs for all controls"
Please, let me know what is your opinion about that.
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: About 'Values' to be Preserved and Mr. Spock :)
Hi Roberto,Roberto Lopez wrote:Hi All,
...
Please, let me know what is your opinion about that.
I have a small suggestion: we can add a new command
SET PROGRAMMATICCHANGE ON | OFF
and guard the programmatic OnChange events in code by if condition.
When program will required an old behaviour then programmer may used a command
SET PROGRAMMATICCHANGE OFF
and by default it will be
SET PROGRAMMATICCHANGE ON
That's all.
![Idea :idea:](./images/smilies/icon_idea.gif)
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: About 'Values' to be Preserved and Mr. Spock :)
My vote is for Mr. SpockRoberto Lopez wrote: Please, let me know what is your opinion about that.
![Smile :)](./images/smilies/icon_e_smile.gif)
'Legalize' a bug, whatever reason is, certainly isn't befit to HMG.
I don't guess someone built a logic on "this control doesn't notice when ON CHANGE event fired by a programmatic intervention"
Only my humble opinion. I'm sure that Le Roy will decide the best, as always.
Best Regards
--
Esgici
Viva INTERNATIONAL HMG ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: About 'Values' to be Preserved and Mr. Spock :)
IMHO there isn't a difference between programmatic and manual changes.
Change is change, whatever its source, must fire the appropriate event.
Regards
--
Esgici
Change is change, whatever its source, must fire the appropriate event.
Regards
--
Esgici
Viva INTERNATIONAL HMG ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: About 'Values' to be Preserved and Mr. Spock :)
It's very clear for me that "the good of the many" here is to have a consistent, easy to learn and bug-free GUI library.
Thank you Roberto. As of now, I call the 'on change event function/procedure' as and when I change the value programmatically.
IMHO, on change event shall be fired on both the occasions.
My doubt is, how come 10 controls have this property and 7 controls don't have? Is this windows bug?
Thank you Roberto. As of now, I call the 'on change event function/procedure' as and when I change the value programmatically.
IMHO, on change event shall be fired on both the occasions.
My doubt is, how come 10 controls have this property and 7 controls don't have? Is this windows bug?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: About 'Values' to be Preserved and Mr. Spock :)
It's an interesting idea, but, IMHO, in the case that this command be implemented, it should work for all controls supporting 'OnChange' event, not only for the seven 'buggy' ones.gfilatov wrote:Hi Roberto,Roberto Lopez wrote:Hi All,
...
Please, let me know what is your opinion about that.
I have a small suggestion: we can add a new command
SET PROGRAMMATICCHANGE ON | OFF
and guard the programmatic OnChange events in code by if condition.
When program will required an old behaviour then programmer may used a command
SET PROGRAMMATICCHANGE OFF
and by default it will be
SET PROGRAMMATICCHANGE ON
That's all.
The reason for this, is the same that I've explained before (consistency across all controls).
Something that could help to keep backwards compatibility, will be check (for programmatic changes) that the new value be different from previous one, as a condition to execute 'OnChange' procedure. This should avoid the creation of endless loops in some situations (I've faced that myself when fixed checkbox/checkbutton OnCHange).
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: About 'Values' to be Preserved and Mr. Spock :)
Thanks in behalf of Mr Spockesgici wrote: My vote is for Mr. SpockHis logic was always robust and consistent.
![Smile :)](./images/smilies/icon_e_smile.gif)
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: About 'Values' to be Preserved and Mr. Spock :)
Thanks for your opinion.rathinagiri wrote:It's very clear for me that "the good of the many" here is to have a consistent, easy to learn and bug-free GUI library.
Not at all.rathinagiri wrote: My doubt is, how come 10 controls have this property and 7 controls don't have? Is this windows bug?
It's a lot more complicated and it's very difficult to explain on less than 20 pages
![Smile :)](./images/smilies/icon_e_smile.gif)
I'll try...
Win32 API is a lot much more different and complex than you can see in VB, VFP or MiniGUI library.
When I talked about that I've attempted to hide operating system complexities in MiniGUI, please... believe me... I've really done
![Smile :)](./images/smilies/icon_e_smile.gif)
From a Win32 API point of view, controls are handled in various different ways, usually according their 'age'.
Some controls are inherited from Win16 (Windows 3.x) epoch (yes... it's true
![Smile :)](./images/smilies/icon_e_smile.gif)
The concept of 'change' and 'value' are (in some cases) MiniGUI 'inventions' with no direct counterparts in WIn32..
This is the reason because MiniGUI is, by far, easier to use than other libraries, that only 'mimics' the Win32 behavior and structure.
A brief look to this (http://msdn.microsoft.com/en-us/library ... S.85).aspx) will give you an idea of the difficulties that implies to hide all that ******* things
![Smile :)](./images/smilies/icon_e_smile.gif)
An example:
For WIn32 API, MiniGUI controls like button, checkbox, checkbutton, and radiogruop are all the same.
Yes, for Win32, all of these controls are buttons with different styles. Even worst, WIn32 buttons has no change event.
So, OnChange event for these controls are pure MiniGUI inventions.
The bottom line is: It's my fault and not a Win32 problem.
I hope I've clear enough (in less than 20 pages
![Smile :)](./images/smilies/icon_e_smile.gif)
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: About 'Values' to be Preserved and Mr. Spock :)
Ya. Crystal clear.
And I know now, how much efforts you had put forth to achieve simplicity. Hats off man. Bravo.
And I know now, how much efforts you had put forth to achieve simplicity. Hats off man. Bravo.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: About 'Values' to be Preserved and Mr. Spock :)
Now for the backward compatibility, IMHO, you can freeze this version and go for the next version, so that, the new version have cleared this.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.