TMSFMXEdit in etSignedFloat EditType

When this editor has the EditType set to edSignedFloat and there is an existing value with a decimal separator in it (0.36 for example) and you tab into the control it will select/highlight all of the text in the control but does not allow you to start typing with a decimal place.


If the existing text does not include a decimal seperator it does allow to you start typing with one..

So when it does not already contain a decimal separator you can type .36, and get the result of 0.36.

When it does already contain one and you type .36 you get the result of 36.

It seems like I can't do anything in my application code with the events because the decimal seperator keypress is eaten before the events are called.

In your procedure TTMSFMXEdit.KeyDown

around line 1175 (not sure if I am on the latest version at this stage). I think the following change would help with this inconsistency in behaviour, but I have not looked to hard into what else it would cause.

        if not(SelLength = Text.Length) and (Pos(FormatSettings.DecimalSeparator, Text) > 0) and (KeyChar = FormatSettings.DecimalSeparator) then
          EatKey;

Is there any chance you could have a look at this and see if this is a good improvement, or if there is another one to get consistent behaviour. Preferably always allowing to being typing with a decimal separator.

Hi,


We have looked into this issue but after applying this improvement get a series of stranged results. When the text is being typed, the TTMSFMXEdit expects the leading zero to be typed as well. We'll investigate if we can improve this, but until we have an improvement, the number 0,36 needs to be typed with a leading zero.