Subject Re: [IBO] IBO4_5_Ah_Full, IB_Grid decimal separator management broken
Author Marco Menardi
--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...> wrote:
> Thank you, I will double check the user contributions and make sure
I merged
> them correctly. I probably did something wrong in my merge.
>
> About the decimal separator, what do you recommend be done to
resolve this
> while also still being flexible as the person desired?
>

Hi Jason!
As I told, in Italy (and many other countries as well...) we have ","
as decimal separator, but "." as thousand separator. Unfortunatly, our
numeric keypad has ".", so it has to be translated by program code
(Windows is too lazy for that).
This problem affects also, for instance, Openoffice.org, with a big
number of users disappointed because of this, me included (see:
http://www.openoffice.org/issues/show_bug.cgi?id=1820 you find also
my posts there).
This has historical reasons (the "USA centric" developement and
marketing power in PC and IT field, also our keyboard layout was
re-designed by IBM in a different manner than our typewriter) and we
must take it as "a fact".
What is the solution?
In IBO code, before 4.5, we have:

IBC_Currency.IMP
if Key = '.' then Key := DecimalSeparator;

IBC_Edit.IMP
if ( Field.IsNumeric ) and
( Key = '.' ) and
( DecimalSeparator = ',' ) then
Key := DecimalSeparator

IB_Grid.pas
if (SelectedField.IsNumeric) and (Key = '.') then
Key := DecimalSeparator


You are asking me: "About the decimal separator, what do you recommend
be done to resolve this while also still being flexible as the person
desired?"

What is the problem? What "flexibility" is needed? The paramount
problem is make people be able to use numeric keypad to enter decimal
separator, even if the keypad is "wrong". Every other need comes far
second to this, but I can't imagin what is this need... If it's a
numeric field, the only values that make sense are: +-[0-9] and
DecimalSeparator.
You have code in IBC_Edit.IMP (right above the piece of code I put
above) that checks if the control is in search mode and disables the
"." -> decimalseparator translation, in the rare case you have to
really enter "." to build a piece of query (a thing that the user will
*never* do, OMHO, while for sure he well be disappointed and have a
wrong result entering "." as usual and not having it translated to the
decimalseparator! And I will prefer this "limit" above the difference
in behaviour just because you are in search mode). Is this that you
are looking for?
Give me more details about the problem, and I will be glad to try to
help you and test the patches against italian keyboard.
I'm really happy you have start improving/developing IBO again, the
more I use it, the more I love it.
Btw, I would like to give IBO a further contribution with a
"UpdateWorkBar" I've developed, and a specialized form, that will help
data entry with automatic commit. Let me know if you are interested in
it, that it takes me some time to document it and make it usable for
other people.

Best regards
Marco Menardi