Re: Automatic type-ahead on single-column listbox?

2017-06-29 Thread David Adams via 4D_Tech
Hey Keith, yeah that's a great interface, for sure. In this case all I'm
after is navigating quickly by typing. But what you describe is the default
behavior in DataGrid and I find it's really, really nice.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Automatic type-ahead on single-column listbox?

2017-06-29 Thread Keith Goebel via 4D_Tech
Probably not what you are looking for and perhaps this approach has already 
been discussed…
When I want to let the user reduce the selection shown in a listbox, I add a 
search field above it and they just enter what they are looking for in that.
You can create a “type-ahead” response to an entry in the search field.

A nice touch it to actually search all columns for values that start with the 
entered value, to prevent having to assign a specific column to the search.
Users seem to like it…
Cheers, Keith

> On 29/06/2017, at 6:21 pm, Davis Adams wrote:
>> Is that actually type-ahead or simply setting the scroll on the edited
> text with a wildcard?
> 
> Don't know...but it's just what I need for my simple uses. It would be nice
> to have it in listboxes, but I guess that would take having a mechanism for
> identifying with column has focus. Although in the case of a listbox with
> one visible column, that's not too hard to figure out, I should think.

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

Re: Automatic type-ahead on single-column listbox?

2017-06-28 Thread David Adams via 4D_Tech
> Is that actually type-ahead or simply setting the scroll on the edited
text with a wildcard?

Don't know...but it's just what I need for my simple uses. It would be nice
to have it in listboxes, but I guess that would take having a mechanism for
identifying with column has focus. Although in the case of a listbox with
one visible column, that's not too hard to figure out, I should think.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Automatic type-ahead on single-column listbox?

2017-06-28 Thread Kirk Brooks via 4D_Tech
David,
Oh, that. Makes me realize how fast you must type to get more than a couple
of letters deep.

Not really great for lists with a few thousand rows I don't think.

Is that actually type-ahead or simply setting the scroll on the edited text
with a wildcard?

On Wed, Jun 28, 2017 at 5:53 AM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> ​...
> Set up an hlist and populate it. Sort of a one-column
> listbox without all of the glitter. Give the area focus and start typing.
> You automatically move to the right item.


-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

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

Re: Automatic type-ahead on single-column listbox?

2017-06-28 Thread David Adams via 4D_Tech
> They do? ​Remind me how that works. I don't think I ever knew that.

They work great! Set up an hlist and populate it. Sort of a one-column
listbox without all of the glitter. Give the area focus and start typing.
You automatically move to the right item. Handy for navigating something
like a list of tables. If you want the hlist to react to elements being
clicked/typed to, you'll want code something like this:

*Case of *

* : *(*Form event*=On Clicked) | (*Form event*=On Selection Change)

*C_LONGINT*($table_number)

*C_TEXT*($table_name)

*GET LIST ITEM*(JoinBuilder_TableNames_hlist;*Selected list items*(
JoinBuilder_TableNames_hlist);$table_number;$table_name)

*C_LONGINT*($relations_count)

$relations_count:=*JoinBuilder_LoadRelations *($table_number)

*End case *

In the code above, "JoinBuilder_TableNames_hlist" is the hlist, and each
list item holds a table number (that's the item ref, it isn't displayed)
and a table name (the visible label.) That just the code that I was working
with so it came to hand

It's pretty smooth and easy to use. Of course, you don't get all of the
nice formatting options like alternate row colors...and I find I do miss
thatbut the usability is so much higher this way with code that's no
harder than with an array in a listbox.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Automatic type-ahead on single-column listbox?

2017-06-28 Thread Kirk Brooks via 4D_Tech
David,

On Wed, Jun 28, 2017 at 3:04 AM, David Adams via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> > It does if it’s only a single column. You don’t use a listbox, you use a
> hierarchical list.
>
> ​...
> Hlists don't have all of the nice style
> ​ ​
> features of a listbox, but they do have built-in type ahead, thanks.
>
​
They do? ​Remind me how that works. I don't think I ever knew that.

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

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

Re: Automatic type-ahead on single-column listbox?

2017-06-28 Thread Jeffrey Kain via 4D_Tech
4D's search widget works pretty well as a type-ahead alternative, and it's very 
easy to integrate with any listbox.

> On Jun 28, 2017, at 6:04 AM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I primarily use 4D to crunch up stuff and spit it out for other programs to
> consume, not so much with users sitting in front of 4D screens. So, much of
> my screen effort is for developer tools - and we're just not worth a huge
> investment of time 

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

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread Guy Algot via 4D_Tech
It does if it’s only a single column. You don’t use a listbox, you use a 
hierarchical list.

If it’s more than one column then ditch the listbox and use DisplayList or ALP.

> On Jun 27, 2017, at 3:14 AM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I might be remembering this wrong, but I thought that 4D had a built-in way
> of letting you type ahead to a row in a listbox. I have a one-column
> listbox based on an array and want to select items by type. Like, typing
> 'ca' selects the first item starting with 'ca'.


Later,
Guy

--
Guy Algot, Solutions Specialist
Edmonton, Alberta
(780) 974-8538

hardware, installation, training, support, programming, internet
specializing in 4th Dimension
=-= =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Microsoft is a cross between the Borg and the Ferengi. Unfortunately,
they use Borg to do their marketing and Ferengi to do their programming."
-- Simon Slavin



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

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread Sujit Shah via 4D_Tech
There are some really nice TA examples on the french forum  also our Man
Keisuke.. I think it is a KB called Address Validation or something
similar. I like the way Keisuke use Styled text to generate double row list
boxes that pretty much look like JS drop downs.


On Wed, Jun 28, 2017 at 12:52 PM, John DeSoi via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > On Jun 27, 2017, at 8:54 PM, Wayne Stewart via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Have 36 buttons that trigger to the 26 characters and 10 numerals.
> >
> > These are combined into a string and if that text is found (in the
> current
> > sorted column) that line is highlighted.
> >
> > If there is no typing after one second then the buffer is cleared.
>
> I did the same thing years ago for AreaList. But bringing this up again
> makes me wonder if you could make it much nicer now by just putting one
> button and duplicating it on the fly for all the letters and numbers. Maybe
> even a subform (or master form) somehow to make it easy to add to any form.
>
> John DeSoi, Ph.D.
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



-- 

xxx
"There must be ingenuity as well as intention, strategy as well as
strength. "
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread John DeSoi via 4D_Tech

> On Jun 27, 2017, at 8:54 PM, Wayne Stewart via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Have 36 buttons that trigger to the 26 characters and 10 numerals.
> 
> These are combined into a string and if that text is found (in the current
> sorted column) that line is highlighted.
> 
> If there is no typing after one second then the buffer is cleared.

I did the same thing years ago for AreaList. But bringing this up again makes 
me wonder if you could make it much nicer now by just putting one button and 
duplicating it on the fly for all the letters and numbers. Maybe even a subform 
(or master form) somehow to make it easy to add to any form.

John DeSoi, Ph.D.

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

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread Justin Carr via 4D_Tech
On 28 Jun 2017, at 12:01 pm, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> On Wed, Jun 28, 2017 at 11:54 AM, Wayne Stewart via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Hi,
>> 
>> I did it with help from Dave Batton (so you can imagine how fresh this
>> solution is)!
>> 
>> The way it works is this and you will laugh/wince.
>> 
> 
> Dang, I'm kind of impressed. That's actually a lot easier than a lot of
> solutions would be! I guess that you could set it up to be pretty easy to
> copy and paste between forms and then just tweak it a bit for the target
> object. Hmmm.

Hey David

We do it using ON EVENT CALL to trap the keystrokes. Slightly less clunkier 
than Wayne's approach but to be fair I'm not a huge fan of ON EVENT CALL. Its 
scope is application wide so you need to take care to disable it or uninstall 
it when the window you need it for no longer has the focus. Which way to go 
depends on your particular situation. We use an event handler pretty much 
continuously in our appointments book and we found that it was better to 
enable/disable it (with accessor methods on an IP var) rather than uninstall it 
and re-install it every time the window loses/gains focus. The event handler is 
actually instantiated by 4D as a separate local process so we were creating and 
destroying the process more or less continuously, i.e. every time the user did 
anything other than type a keystroke.

Certainly if 4D were to make it a listbox option we would breathe a little 
easier. :)

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

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread David Adams via 4D_Tech
On Wed, Jun 28, 2017 at 11:54 AM, Wayne Stewart via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi,
>
> I did it with help from Dave Batton (so you can imagine how fresh this
> solution is)!
>
> The way it works is this and you will laugh/wince.
>

Dang, I'm kind of impressed. That's actually a lot easier than a lot of
solutions would be! I guess that you could set it up to be pretty easy to
copy and paste between forms and then just tweak it a bit for the target
object. Hmmm.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread Wayne Stewart via 4D_Tech
Hi,

I did it with help from Dave Batton (so you can imagine how fresh this
solution is)!

The way it works is this and you will laugh/wince.

Here is a screenshot of the form:

http://www.4dsupport.guru/iNUGPictures/2017/Select.png

Have 36 buttons that trigger to the 26 characters and 10 numerals.

These are combined into a string and if that text is found (in the current
sorted column) that line is highlighted.

If there is no typing after one second then the buffer is cleared.



Regards,

Wayne


[image: --]
Wayne Stewart
[image: http://]about.me/waynestewart



On 28 June 2017 at 11:07, David Adams via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> On Wed, Jun 28, 2017 at 1:01 AM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> I've been messing around with type ahead recently. I came across that as
> > well and I seem to recall the solution was some 'regular' type ahead
> > methodology wired up to the list box. So you'd still have the list object
> > as a separate object on your form and move/show it when doing entry on
> the
> > listbox cell. Then hide it when done. And if you want to include a
> 'shadow'
> > TA object (to show what the TA completion would be if you selected it at
> > that moment - looks like the placeholder) it's more complicated by issues
> > of transparency and z-axis locations. Sigh.
> >
>
> Sigh :( Thanks for letting me know all the same
>
> If anyone can think up a clear feature request, post back here! This looks
> like something a lot of folks would vote for. It's an ideal request in a
> few ways because
> * Lots of people already want it.
> * Lots more people would want it as soon as it was available.
> * It's sounds pretty over-the-top hard to do today.
>
> I'd bet 4D could do a very nice job of adding as an optional behavior on a
> listbox column. Like, 'it has to be sorted and then when the object has
> focus, we'll use a binary search to find the best place for where they've
> typed.' After that, they could apply the same logic to the Explorer window
> where type-ahead only seems to respect 2-3 characters...
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread David Adams via 4D_Tech
On Wed, Jun 28, 2017 at 1:01 AM, Kirk Brooks via 4D_Tech <
4d_tech@lists.4d.com> wrote:

I've been messing around with type ahead recently. I came across that as
> well and I seem to recall the solution was some 'regular' type ahead
> methodology wired up to the list box. So you'd still have the list object
> as a separate object on your form and move/show it when doing entry on the
> listbox cell. Then hide it when done. And if you want to include a 'shadow'
> TA object (to show what the TA completion would be if you selected it at
> that moment - looks like the placeholder) it's more complicated by issues
> of transparency and z-axis locations. Sigh.
>

Sigh :( Thanks for letting me know all the same

If anyone can think up a clear feature request, post back here! This looks
like something a lot of folks would vote for. It's an ideal request in a
few ways because
* Lots of people already want it.
* Lots more people would want it as soon as it was available.
* It's sounds pretty over-the-top hard to do today.

I'd bet 4D could do a very nice job of adding as an optional behavior on a
listbox column. Like, 'it has to be sorted and then when the object has
focus, we'll use a binary search to find the best place for where they've
typed.' After that, they could apply the same logic to the Explorer window
where type-ahead only seems to respect 2-3 characters...
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Automatic type-ahead on single-column listbox?

2017-06-27 Thread Arnaud de Montard via 4D_Tech

> Le 27 juin 2017 à 17:01, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> [...]
> I've been playing around with the idea of trying to implement TA in a text
> field, the way the method editor looks up method names for instance. Not
> really liking anything I've got yet.

That thing in the editor makes me dream; I wish it will be available in 4D one 
day… 
I made some type ahead in text but without list of values during input and I 
use a trigger char = @. 
If the user's input is "@", I get the word before @, search with it in list of 
values, then:
- none -> nothing
- one -> complete word
- many -> choose in list and complete 
better than nothing  :-/

-- 
Arnaud de Montard  



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

Automatic type-ahead on single-column listbox?

2017-06-27 Thread David Adams via 4D_Tech
I might be remembering this wrong, but I thought that 4D had a built-in way
of letting you type ahead to a row in a listbox. I have a one-column
listbox based on an array and want to select items by type. Like, typing
'ca' selects the first item starting with 'ca'.

I messed around with the various attributes (16.1) but didn't find anything
like what I was looking for. Am I remembering something from the old-style
form arrays before listboxes? Am I missing something?

Any help appreciated. It's not worth a ton of code, unless there's some
very generic solution available. Just to be clear, I'm not talking about
type-ahead based on an entry area, I'm talking about a listbox has focus
and you just type. The Finder does this on macOS when you type - it picks
the first matching file or folder. I don't know if there's a shorthand name
for this behavior, but it's widespread in common in the world

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