Auto completion of a text field

Peter Haworth pete at lcsql.com
Sat Apr 6 17:23:23 EDT 2013


Thanks Colin/Mark/Jacque.

I've actually got this working reasonably well by locking messages before
issuing the type command, but I'll give all the suggestions a whirl.


Pete
lcSQL Software <http://www.lcsql.com>


On Sat, Apr 6, 2013 at 1:03 PM, J. Landman Gay <jacque at hyperactivesw.com>wrote:

> On 4/6/13 2:20 PM, Peter Haworth wrote:
>
>> Trying to implement an auto completion function for a text field.
>>
>> I have a keyUp handler that gets the current contents of the field and
>> searches though a list of possible matches.  If one is found, I tried
>> setting the text of the field to it. I see the match turn up in the field,
>> but when I leave the field, an exitField message is sent rather than a
>> closeField message, indicating that the field contents didn't change,
>> which
>> they clearly did.
>>
>> Next I tried using the type command to put the extra characters of the
>> matched string into the field. That works but looks kinda
>> clunky especially if it's a lengthy string, even though I set the typing
>> rate to zero before issuing the type command, .
>>
>> Setting the text of the field is very smooth but the lack of a closeField
>> message makes it impractical for me.  Seems like setting a field's
>> contents
>> should make it aware that its contents have changed but apparently not.
>>   Any tricks to achieve this?
>>
>
> Send "closefield" yourself at the end of the insertion handler. Though I'm
> not sure you need that message; if there is some action a closefield
> handler does, separate it out and then call that handler instead.
>
> --
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
>
>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>



More information about the use-livecode mailing list