Improvements for InputItems property in HMG 2.5.3
Moderator: Rathinagiri
Improvements for InputItems property in HMG 2.5.3
Hello Friends,
I have a small suggestions for improvement of the 'InputItems' property in HMG 2.5.3:
1. combobox height correction: add in h_browse.prg at line #1528 the following string
...
If lInputItems == .T.
ControlType := 'X'
Ldelta := 1 // line #1528
ElseIf Type (FieldName) == 'C'
ControlType := 'C'
ElseIf Type (FieldName) == 'D'
ControlType := 'D'
ElseIf Type (FieldName) == 'L'
ControlType := 'L'
Ldelta := 1
ElseIf Type (FieldName) == 'M'
ControlType := 'M'
ElseIf Type (FieldName) == 'N'
If Decimals == 0
ControlType := 'I'
Else
ControlType := 'F'
EndIf
EndIf
...
2. corrections in Procedure _InPlaceEditOk:
add before the following line in three places
r := aInputItems [ CellColIndex ] [ r ] [ 2 ]
this checking for a new empty record
r := if( r == 0, 1, r )
3. typo in h_controlmisc.prg at line #3797
should be
...
ElseIf Arg3 == 'INPUTITEMS'
...
instead of
...
ElseIf Arg3 == 'INPUTOPITEMS'
...
Thanks for your attention!
I have a small suggestions for improvement of the 'InputItems' property in HMG 2.5.3:
1. combobox height correction: add in h_browse.prg at line #1528 the following string
...
If lInputItems == .T.
ControlType := 'X'
Ldelta := 1 // line #1528
ElseIf Type (FieldName) == 'C'
ControlType := 'C'
ElseIf Type (FieldName) == 'D'
ControlType := 'D'
ElseIf Type (FieldName) == 'L'
ControlType := 'L'
Ldelta := 1
ElseIf Type (FieldName) == 'M'
ControlType := 'M'
ElseIf Type (FieldName) == 'N'
If Decimals == 0
ControlType := 'I'
Else
ControlType := 'F'
EndIf
EndIf
...
2. corrections in Procedure _InPlaceEditOk:
add before the following line in three places
r := aInputItems [ CellColIndex ] [ r ] [ 2 ]
this checking for a new empty record
r := if( r == 0, 1, r )
3. typo in h_controlmisc.prg at line #3797
should be
...
ElseIf Arg3 == 'INPUTITEMS'
...
instead of
...
ElseIf Arg3 == 'INPUTOPITEMS'
...
Thanks for your attention!
Last edited by gfilatov on Sat Aug 02, 2008 4:02 pm, edited 2 times in total.
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
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Improvements for InputItems property in HMG 2.5.3
Welcome aboard Grigory Filatov!
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: Improvements for InputItems property in HMG 2.5.3
Is a gread pleasure to find you here Grigory!gfilatov wrote:Hello Friends,
I have a small suggestions for improvement of the 'InputItems' property in HMG 2.5.3:
...
I've already noticed and corrected the typo in property name.
I'll take a look to your other proposals (It could be good if you add a explanation for proposed changes).
Thanks.
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Improvements for InputItems property in HMG 2.5.3
Roberto,Roberto Lopez wrote:It could be good if you add a explanation for proposed changes.
Thanks for your kind words!
My explanation is below:
1. add one pixel to Input ComboBox height for showing of bottom border (similar to Combobox for logical value)
2. when you adde a new record to Browse by Alt+A hotkey pressing and then press Enter key in InputItem field without select a value from list, you can have an array access error now. It will be fixed by my proposal.
I think that these changes will be improved the Browse's InputItem property in Official HMG.
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
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Improvements for InputItems property in HMG 2.5.3
Thanks.gfilatov wrote:1. add one pixel to Input ComboBox height for showing of bottom border (similar to Combobox for logical value)Roberto Lopez wrote:It could be good if you add a explanation for proposed changes.
2. when you adde a new record to Browse by Alt+A hotkey pressing and then press Enter key in InputItem field without select a value from list, you can have an array access error now. It will be fixed by my proposal.
I think that these changes will be improved the Browse's InputItem property in Official HMG.
I hope to check it during weekend.
For future bug reports could be very useful to me if you send it to hmg bug tracker at SourceForge, including a little sample showing the bug. I'm check it daily now. It is very a very fast and efficient method to handle bug reports. I'll try to configure the tracker to send a copy of the report and my answers to the forum.
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: Improvements for InputItems property in HMG 2.5.3
I've confirmed the bug, but your fix is incorrect.gfilatov wrote: 2. corrections in Procedure _InPlaceEditOk:
add before the following line in three places
r := aInputItems [ CellColIndex ] [ r ] [ 2 ]
this checking for a new empty record
r := if( r == 0, 1, r )
I'll explain:
'InputItems' should work as a validation method.
Your fix allows to the user to select (press enter) in a blank combo (no selection) but saves the intem ID for array row 1 in the table!!!.
This is a very big mistake.
The correct solution is (when no match between table and array succeeds) is to display combo with first row selected. If the user
accepts it, the value saved in the table will be the same as the
user viewed in the screen when pressed [enter] key.
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: Improvements for InputItems property in HMG 2.5.3
And...Roberto Lopez wrote: For future bug reports could be very useful to me if you send it to hmg bug tracker at SourceForge, including a little sample showing the bug. I'm check it daily now. It is very a very fast and efficient method to handle bug reports. I'll try to configure the tracker to send a copy of the report and my answers to the forum.
I can't see the point of creating polls for bug reports... seriously
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Improvements for InputItems property in HMG 2.5.3
Roberto,Roberto Lopez wrote:'InputItems' should work as a validation method.
Your fix allows to the user to select (press enter) in a blank combo (no selection) but saves the intem ID for array row 1 in the table!!!.
This is a very big mistake.
The correct solution is (when no match between table and array succeeds) is to display combo with first row selected. If the user
accepts it, the value saved in the table will be the same as the
user viewed in the screen when pressed [enter] key.
Thanks a lot for your explanation!
You are right, of course.
My suggestion was a quick fix for array access error only...
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
Re: Improvements for InputItems property in HMG 2.5.3
Roberto,Roberto Lopez wrote:I can't see the point of creating polls for bug reports... seriously
It was a forum's poll possibility test only...
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
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Improvements for InputItems property in HMG 2.5.3
No problem!!!gfilatov wrote:
Roberto,
It was a forum's poll possibility test only...
Many thanks for the report!
Please, if you find any other bugs, please, let me know. I'll try to fix ASAP.
Regards,
Roberto.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)