combobox

Terry Judd tsj at unimelb.edu.au
Sun Mar 20 20:01:10 EDT 2011


On 21/03/11 9:47 AM, "Kee Nethery" <kee at kagi.com> wrote:

> OK, comboboxes appear to be rather complicated and I'm stumped.
> 
> As a user types into a combobox I use
>    on rawKeyUp keyCode
> to notice that a new character has been added to the combobox.
> 
> I then do a database search to see all the data that matches the characters
> currently in the combobox.
> 
> I then replace all the data in the combobox with the data returned from the
> database. This puts the first alphabetical value as the combobox label (or
> whatever that is referred to).
> 
> This all works fine.
> 
> The thing I want to do next is to select the characters after what the user
> actually typed in the ?label? of the combobox so that the next character they
> type replaces all those. For example:
> 
> user types:
> 
> joe
> 
> script returns
> 
> joebill
> joebob
> joemammy
> joemomma
> 
> The value displayed in the combobox is now
> 
> joebill
> 
> and what I want "selected" in the combobox is "bill" (if capital letters
> signify a selection ...)
> 
> joeBILL
> 
> so that if the user types "m" the combobox the script is now going to display
> 
> joemAMMY
> 
> and the selections presented will just be
> 
> joemammy
> joemomma
> 
> what script would select some of the characters within "joemammy" like for
> example characters "ammy" (aka characters 5 to 8)?

Hi Kee,

It seems like you need to target field 0 of the control so I'd...
1. get the length of line 1 of the text of the control (tLength)
2. update the control's text as you are already doing
3. do something like "select char tLength+1 to -1 of fld 0 of me"

Hopefully that will work

Terry...

> Thanks,
> Kee Nethery
> _______________________________________________
> 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
> 

--
Dr Terry Judd | Senior Lecturer in Medical Education
Medical Education Unit
Melbourne Medical School
The University of Melbourne







More information about the Use-livecode mailing list