Improvements for InputItems property in HMG 2.5.3

Source code related resources

Moderator: Rathinagiri

Post Reply
User avatar
gfilatov
Posts: 497
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 5 times
Been thanked: 23 times
Contact:

Improvements for InputItems property in HMG 2.5.3

Post by gfilatov » Fri Aug 01, 2008 9:57 am

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!
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

User avatar
Rathinagiri
Posts: 5039
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 76 times
Been thanked: 89 times
Contact:

Post by Rathinagiri » Fri Aug 01, 2008 10:59 am

Welcome aboard Grigory Filatov!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3873
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 6 times
Been thanked: 99 times

Post by Roberto Lopez » Fri Aug 01, 2008 12:19 pm

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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
gfilatov
Posts: 497
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 5 times
Been thanked: 23 times
Contact:

Post by gfilatov » Fri Aug 01, 2008 1:23 pm

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.
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
Roberto Lopez
HMG Founder
Posts: 3873
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 6 times
Been thanked: 99 times

Post by Roberto Lopez » Fri Aug 01, 2008 2:08 pm

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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3873
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 6 times
Been thanked: 99 times

Post by Roberto Lopez » Fri Aug 01, 2008 11:50 pm

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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3873
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 6 times
Been thanked: 99 times

Post by Roberto Lopez » Sat Aug 02, 2008 12:32 am

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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
gfilatov
Posts: 497
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 5 times
Been thanked: 23 times
Contact:

Post by gfilatov » Sat Aug 02, 2008 6:04 pm

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...
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
gfilatov
Posts: 497
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 5 times
Been thanked: 23 times
Contact:

Post by gfilatov » Sat Aug 02, 2008 6:08 pm

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:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
Roberto Lopez
HMG Founder
Posts: 3873
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 6 times
Been thanked: 99 times

Post by Roberto Lopez » Sat Aug 02, 2008 8:09 pm

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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest