Doubleclick on TextField

TextField (nor parent controls TextEdit or RecControl) has no DoubleClick event.
However if you double click a TextField all the contents is selected, so that you can change it just by entering new text.
I don’t know if this is done by Xojo or by the OS, although I suppose it is the latter.
But if you have a negative number, for example -36.784, when I double click on this control minus sign is not selected, only 36.784.
Well, in fact it is still weirder: if you double click before the minus sign, only this sign is selected, and if you do it behind the rest is selected.

At this moment I only have a Windows to check it, so I don’t know what happens on Linus or OS X.

Is this a bug or expected behaviour?
Have you noticed it?
How could I simulate a double click selecting “all” the text.

Thanks for your comments.

[quote=160417:@Ramon SASTRE]TextField (nor parent controls TextEdit or RecControl) has no DoubleClick event.
However if you double click a TextField all the contents is selected, so that you can change it just by entering new text.
I don’t know if this is done by Xojo or by the OS, although I suppose it is the latter.
But if you have a negative number, for example -36.784, when I double click on this control minus sign is not selected, only 36.784.
Well, in fact it is still weirder: if you double click before the minus sign, only this sign is selected, and if you do it behind the rest is selected.

At this moment I only have a Windows to check it, so I don’t know what happens on Linus or OS X.

Is this a bug or expected behaviour?
Have you noticed it?
How could I simulate a double click selecting “all” the text.
[/quote]

What you describe is done by the system, and is expected. Double click selects the word under the cursor, right after and up until the separators such as space, comma, dot, hyphen/minus, and punctuation in general. So the -123.45 is seen as a word preceded by “-”. The normal way of selecting an entire paragraph is triple click.

If you want to modify that, you can detect the double click with System.MouseDown in a timer, and modify the SelStart and Sellength.

Thanks Michel for your clarifying.
In fact, as I use a subclass of TextField for numbers, it should be easy to implement what I expect for a double click.

On the Mac one would use a triple click to select all of the text. If you modify the system behavior to bring it in line with your expectations, will that still match your user’s expectations?

Triple-click on Windows should select the entire paragraph. Your users should be used to that.

Nope. On Mac standard applications such as Pages and TextEdit, triple click selects the entire paragraph, NOT the entire text. It works that way in the forum as well.

So is it on Mac. Triple click selects the entire paragraph.

And in a TextField, that would be the entire contents.

Indeed. I was thinking TextArea. Sorry.