it has been so long since i have done a gui that
i have forgotten almost everything i ever knew about them, which was not much to begin with. i am looking for the dolphin widget which will continuously select from a list of strings as you type more characters. iow, when you type 'm', the list narrows to entries beginning with 'm'. then when you type 'a', the list narrows further to entries beginning with 'ma'. thanks in advance. |
Donald
You wrote in message news:aloshe$m99$[hidden email]... > it has been so long since i have done a gui that > i have forgotten almost everything i ever knew > about them, which was not much to begin with. > > i am looking for the dolphin widget which will > continuously select from a list of strings as you > type more characters. iow, when you type 'm', > the list narrows to entries beginning with 'm'. then > when you type 'a', the list narrows further to > entries beginning with 'ma'. You are talking about the sort of widget used for an "auto-completion" list right? Hmmm, maybe that is slightly different. Either way there is, unfortunately, no standard component to do that, so unless someone has something (or knows of an Active-X control) you'll have to roll your own. I am not an expert in the use of MVP, but it seems to me that this is a "view" issue, and ought therefore to be implemented as a specialised kind of list that plugs into the standard ChoicePresenter. One possible approach would be to subclass ListView and add a "filter" to it that restricts what the list displays. If the ListView is operating in "virtual" mode (the default) changing the filter could be made pretty efficient, as it is only necessary to tell the list how many items to display, with the content being determined dynamically at paint time. This hypothetical "narrowing" list view would override the #lvnFindItem: notification and use it to configure the filter, rather than to perform an incremental search. This would involve applying the filter to work out how many items would be in the revised list, and then just setting the new number of items with #lvmSetItemCount:. It would probably pay to cache the filtered list for better repaint performance, as otherwise you'll end up rebuilding the filtered list as each cell (row and column) is repainted. Maybe some kind soul would be willing to help you with a NarrowingListView, or perhaps has a better idea? If not I'll have a bash at when I get a spare moment, as it seems like it might be quite an interesting and useful little project. Regards Blair |
In reply to this post by jWarrior
Donald,
> i am looking for the dolphin widget which will > continuously select from a list of strings as you > type more characters. A listview has the builtin capability you may be looking for (though it doesn't actually narrow down the items in the list, as Blair was talking about). Methods can also be added to listbox and combobox to do the same thing. -- Louis |
In reply to this post by jWarrior
Donald MacQueen <[hidden email]> wrote in message
news:aloshe$m99$[hidden email]... ... > i am looking for the dolphin widget which will > continuously select from a list of strings as you > type more characters. iow, when you type 'm', > the list narrows to entries beginning with 'm'. then > when you type 'a', the list narrows further to > entries beginning with 'ma'. I am not aware of a control that does this automatically. A combo box will assist with a selection based on typing the first few characters of a string, but does not limit the list. I happen to have created a behavior similar to what you are asking for in my CJD Lookup tool http://www.mitchellscientific.com/smalltalk/CJDLookUp.htm . Look at the screen shot of the method selection dialog. It dynamically filters based on a partial string. Feel free to use this code as an example. I have a new (unreleased at the moment) version with much faster filter code, but the basic approach is the same. Chris |
Free forum by Nabble | Edit this page |