esgici wrote: So I can say only : "Yes sir, you have already told me !"
Is this a bug ?
Moderator: Rathinagiri
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Is this a bug ?
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: Is this a bug ?
You could make your original sample to work also making this change to _SetValue() function in h_controlmisc.prg HMG library code (you should replace the 'case T == "GRID"' section with the following):
Basically, it allows the execution of the OnCgange procedure only if some of the cell coordinates are different from previous value.
Regards,
Roberto.
Code: Select all
case T == "GRID"
IF _HMG_SYSDATA [32] [ix] == .F.
ListView_SetCursel ( c, value )
ListView_EnsureVisible( C , VALUE )
ELSE
IF VALTYPE ( VALUE ) == 'A'
IF VALUE [1] == 0 .OR. VALUE [2] == 0
_HMG_SYSDATA [ 39 ] [ix] := 0
_HMG_SYSDATA [ 15 ] [ix] := 0
REDRAWWINDOW(C)
_DoControlEventProcedure ( _HMG_SYSDATA [ 12 ] [ix] , ix )
ELSE
IF _HMG_SYSDATA [ 39 ] [ix] <> value [1] ;
.OR. ;
_HMG_SYSDATA [ 15 ] [ix] <> value [2]
ListView_SetCursel ( c, value [1] )
ListView_EnsureVisible( C , VALUE [1] )
_HMG_SYSDATA [ 39 ] [ix] := value [1]
_HMG_SYSDATA [ 15 ] [ix] := value [2]
_DoControlEventProcedure ( _HMG_SYSDATA [ 12 ] [ix] , ix )
ENDIF
ENDIF
ENDIF
ENDIF
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: Is this a bug ?
Thanks for the explanations and suggestions.
This is my long term doubt. When we change the value of a control through "form.control.value := x" statement, whether on change event would be fired or not? Whether it is fired only when an user changes the value of the control manually?
This is my long term doubt. When we change the value of a control through "form.control.value := x" statement, whether on change event would be fired or not? Whether it is fired only when an user changes the value of the control manually?
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.
Re: Is this a bug ?
Thanks for the explanation.
I faced the same problem in my initial project One-to-Many form
With best regards.
Sudip
I faced the same problem in my initial project One-to-Many form
With best regards.
Sudip
With best regards,
Sudip
Sudip
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Is this a bug ?
Well...rathinagiri wrote:Thanks for the explanations and suggestions.
This is my long term doubt. When we change the value of a control through "form.control.value := x" statement, whether on change event would be fired or not? Whether it is fired only when an user changes the value of the control manually?
When started HMG, 'OnChange' event behavior was completely inherited from WIN32.
This meant, that when the content of a control changes, the operating system sends a message that is 'picked up' by MiniGUI library that executes the procedure specified as 'OnChange' event.
When a report pointed that programmatic changes do not fired OnChange event procedure for a specific control, I've fixed that, since IMHO this is the reasonable and 'logical' behavior (Look at 2.6.2 changelog).
Anyway, these fixes, are difficult decisions to make, because, since this behavior comes from the HMG beginnings, they could break lots of already written (working) applications.
In fact, 2.6.2 fix, caused HMG print preview to fail (it was corrected on 2.6.5).
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: Is this a bug ?
Oh. In my programmes, I had always called for the onchange procedure again, whenever I change the value of the control programmatic.
So, I need not do so, in future. That's nice. Thank you Roberto.
So, I need not do so, in future. That's nice. Thank you Roberto.
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: Is this a bug ?
Please, if you find a control that not work so, report the problem.rathinagiri wrote:So, I need not do so, in future. That's nice. Thank you Roberto.
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Is this a bug ?
Hi Roberto
--
Esgici
I applied, but sorry, can't runRoberto Lopez wrote:You could make your original sample to work also making this change to _SetValue() function in h_controlmisc.prg HMG library code
Best RegardsHMG wrote:Error BASE/1003 Variable does not exist: VALUE
Called from _GETVALUE(253)
Called from GETPROPERTY(6775)
Called from (b)MAIN(107)
Called from _DOCONTROLEVENTPROCEDURE(4675)
Called from EVENTS(1407)
Called from SETSPINNERVALUE(0)
Called from _DEFINESPINNER(165)
Called from MAIN(109)
--
Esgici
Viva INTERNATIONAL HMG
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Is this a bug ?
I've took the code posted from my own h_controlmisc.prg (it is working for me). Perhaps you missed something...esgici wrote:Hi Roberto
I applied, but sorry, can't runRoberto Lopez wrote:You could make your original sample to work also making this change to _SetValue() function in h_controlmisc.prg HMG library code
Best RegardsHMG wrote:Error BASE/1003 Variable does not exist: VALUE
Called from _GETVALUE(253)
Called from GETPROPERTY(6775)
Called from (b)MAIN(107)
Called from _DOCONTROLEVENTPROCEDURE(4675)
Called from EVENTS(1407)
Called from SETSPINNERVALUE(0)
Called from _DEFINESPINNER(165)
Called from MAIN(109)
--
Esgici
Anyway, I've attached the entire file to this message.
Regards,
Roberto.
- Attachments
-
- h_controlmisc.rar
- (28.98 KiB) Downloaded 584 times
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Is this a bug ?
Yeah ! That's all !Roberto Lopez wrote: ... Perhaps you missed something...
Anyway, I've attached the entire file to this message.
My defendant test prg now acquited
Un gran abrazo Roberto
Best Regards
--
Esgici
Viva INTERNATIONAL HMG