Completion in TextEdit (TextField / TextArea)

I already wrote a bug report about a special new feature that is called by Apple in TextEdit: “Compléter” (Completion) in TextFields.

Note: I forgot the details.

Now that I know the name of the feature, I come back here to talk about it.

Do not get me wront: I consider this as unwanted in either my project(s) and in Xojo own IDE (excepted in case I do only feel / I do not have an example handly).

BUT: in Xojo’s IDE, I found one cse (and I understand why) where this feature does not happens: the window size fields !

I let you think about what happens if, like me sometimes, you have a second of low attention and press the escape key at the same time… How many time will you waste before finding where the error lies.

Honestly, how good is there a Completion in a search field ?
How useful is a Completion that I cannot set the default string values ?

OK: while writing this text, a crazy idea (sometimes the best !) has born in my mind and here’s the working code:

Function KeyDown(Key As String) As Boolean // Disable this f***g Completion feature If Key = Chr(27) Then Return True ENd If End Function

AND THIS WORKS !

as far as I tested it.

It would be nice to get that in Xojo 2015r3 (when such version will come).

BTW: a Super change cannot be undoed (or the Undo is not reflected in the Super field) by cmd-z on OS X / Xojo 2015r1.

[quote=201043:@Emile Schwarz]Honestly, how good is there a Completion in a search field ?
How useful is a Completion that I cannot set the default string values ?
[/quote]

Honestly, it is already a rather unknown feature, so I would not be too worried.

Second, the default string values are probably here to prevent misspelling and that is darn useful in a search field. Unless you implement phonetic research, a badly spelt word will not give you any result.

About choice of words, I tried to popup a contextual menu in Keydown. Problem is, the contextual menu appears next to the mouse cursor that can be away from the field. A listbox would be preferable. Maybe a declare is possible to change the words in the original suggestion. No doubt if it is possible it will get posted.

But you can also use the Contextual menu to display your choice of words available through Right Click :

Function ConstructContextualMenu(base as MenuItem, x as Integer, y as Integer) As Boolean base.append(New MenuItem("Podologue")) base.append(New MenuItem("Poméranie")) base.append(New MenuItem("Pomme")) base.append(New MenuItem("Pompon")) Return True //display the contextual menu End Function

Function ContextualMenuAction(hitItem as MenuItem) As Boolean me.Text = hitItem.Text me.SelStart = len(me.text) End Function

This is just a very limited example. A full fledged suggestion system calls for a dictionary or a database, and more complex of a code.

Just thinking about it, the Contextual menu thing will work cross platform, unlike an eventual declare.

rather unknow feature
How I would it be like this. A simple esc keypress in a field reveal it. Just try.
OS X Yosemite.

Rename Files (in the Yosemite Finder) was a rather unknow feature for me until last week: very poserful ! ;-:slight_smile:

Sorry folks, this one is in French.

Michel,

merci pour la rponse.

En fait, vas dans TextEdit (Apple), Menu dition, Complter (avant tout slectionner).

Ou, dans lIDE, presse la touche escape pour faire apparatre la “fentre” Complter. La liste des suggestion se trouve dans cette fentre.

Rien voir avec un menu contextuel.

Ceci dit, lide de laide dans un menu contextuel est sympa. Pas sr que j’y aurais pens tout seul.