Page 1 of 1

Improvements for InputItems property in HMG 2.5.3

Posted: Fri Aug 01, 2008 9:57 am
by gfilatov
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!

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Fri Aug 01, 2008 10:59 am
by Rathinagiri
Welcome aboard Grigory Filatov!

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Fri Aug 01, 2008 12:19 pm
by Roberto Lopez
gfilatov wrote:Hello Friends,

I have a small suggestions for improvement of the 'InputItems' property in HMG 2.5.3:
...
Is a gread pleasure to find you here Grigory!

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.

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Fri Aug 01, 2008 1:23 pm
by gfilatov
Roberto Lopez wrote:It could be good if you add a explanation for proposed changes.
Roberto,

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.

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Fri Aug 01, 2008 2:08 pm
by Roberto Lopez
gfilatov wrote:
Roberto Lopez wrote:It could be good if you add a explanation for proposed changes.
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.
Thanks.

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.

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Fri Aug 01, 2008 11:50 pm
by Roberto Lopez
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've confirmed the bug, but your fix is incorrect.

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.

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Sat Aug 02, 2008 12:32 am
by Roberto Lopez
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.
And...

I can't see the point of creating polls for bug reports... seriously ;)

Regards,

Roberto.

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Sat Aug 02, 2008 6:04 pm
by gfilatov
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.
Roberto,

Thanks a lot for your explanation!

You are right, of course.

My suggestion was a quick fix for array access error only...

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Sat Aug 02, 2008 6:08 pm
by gfilatov
Roberto Lopez wrote:I can't see the point of creating polls for bug reports... seriously ;)
Roberto,

It was a forum's poll possibility test only...
:oops:

Re: Improvements for InputItems property in HMG 2.5.3

Posted: Sat Aug 02, 2008 8:09 pm
by Roberto Lopez
gfilatov wrote:
Roberto,
It was a forum's poll possibility test only...
:oops:
No problem!!!

Many thanks for the report!

Please, if you find any other bugs, please, let me know. I'll try to fix ASAP.

Regards,

Roberto.