Hi All,

I few months ago, I was wishing (again): why can’t  a listBox have focus and 
then the user just type some characters and the listbox highlights the matching 
row?
You know, like so many other windows can do in programs / OS’s.

4D does not let you ‘see’ or process keystrokes when the listBox has focus.

But I managed to figure out a way to get what I wanted :) :) :)

I have a Project form “LB”.

It is thereafter used in another form as a SUBFORM. So that means that the 
mechanism it uses to do the clairvoyance does not impact anything else.
When the listBox has focus, the clairvoyance works; when it loses focus, it is 
’turned off’.

If you are curious about how this can be done, just reply with your email 
address and I can forward it to you.

I made a sample DB with the pertinent technique in it. I borrowed data from one 
of 4D’s sample DBs that has 15,000 ‘people’ records.
Whether the listbox is SORTED or not, it instantaneously works.
When you start the demo, it searches in the first column; but if you thereafter 
sort by one of the other columns (click on column title), it then searches on 
that column. It works whether the ‘search column’ is sorted ascending, 
descending, or unsorted.

Got you curious? Find out how it’s done!

You can test it out, as the demo opens in application mode. Just choose ‘People 
Browser…’ from the File menu (the only option). Then start typing away!

Also, there is an easy mechanism to ‘reset’ the search text.
For example, say you type ‘Johns’ in reasonably-rapid keystrokes.  Then wait 
two seconds. Type ‘ralp’ and you will see that the system has ‘cancelled’ the 
‘Johns’ characters and looked for ‘ralp’. Just like, say, the Finder in apple 
systems does.
You can set this ‘delay’ very easily. Basically, as you enter the keystrokes, 
the millisecond is ‘remembered’. When you enter a keystroke, if a certain 
threshold time has occurred since the last keystroke, then the search text is 
‘reset’ to contain just that single keystroke.

I hope you guys take me up on this. I mentioned it to 4D blog as a ‘guest 
author’ 2 months ago, but they have not responded for some peculiar reason.

My way to give back to the 4D community,

Chris Belanger
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to