Page 1 of 1

wxAutoTextCtrl

Posted: Fri Jan 27, 2006 6:13 pm
by priyank_bolia
A text control which automatically predicts the list of possible values based on the user input, and completes the text.

Code: Select all

wxArrayString strArray;
strArray.Add("Priya");
strArray.Add("Priyank");
strArray.Add("Priyanka");
strArray.Add("Bolia");
wxAutoTextCtrl *pAutoTextCtrl = new wxAutoTextCtrl(this, wxID_ANY, wxEmptyString, strArray);
NB: Use up & down arrow keys to see different list of possible values.

http://www.priyank.in/downloads/

Posted: Fri Jan 27, 2006 6:25 pm
by Jorg
Cool :-) so it can cache a number of items, and it automatically completes them? What if you have this;

aab

And

aac

And I type 'aa' does it present me a list of items I can choose? I have not downloaded your source yet due to limited time but I am interested if you present a list or not (I can remember there was somethign like this already floating around).

- Jorgen

Posted: Sat Jan 28, 2006 7:39 am
by priyank_bolia
Jorg wrote:Cool :-) so it can cache a number of items, and it automatically completes them? What if you have this;

aab

And

aac

And I type 'aa' does it present me a list of items I can choose? I have not downloaded your source yet due to limited time but I am interested if you present a list or not (I can remember there was somethign like this already floating around).

- Jorgen

I don't display a list instead it uses up and down arrow keys to navigate, displaying a separte list on high cost real estate, it sometimes looks bad.

Posted: Sat Jan 28, 2006 9:04 am
by Jorg
Agreed :-)

Thanks,
- Jorgen

Posted: Mon Jan 30, 2006 1:02 pm
by phlox81
samething for a Combobox would be nice :)

Posted: Mon Jan 30, 2006 1:20 pm
by Jorg
Well ofcourse you can make this optional, as for many situations it might prove handy.

- Jorgen

Posted: Wed Mar 01, 2006 8:47 am
by hgiritzer
I would also say that a version which displays a list of possible items would be great.
The list should shrink when typing as less suitable items will be available.

The Up and Down keys should then be usable to highlight an item in the list, which can be choosen for text completion by pressing Enter.

Furthermore I would suggest a member function to dynamically change the set of items (your array of strings), so it would be possible to construct the item with an empty array and set/reset them later during runtime.

Posted: Wed Mar 01, 2006 11:03 am
by priyank_bolia
I would rather use a combo box, rather than a list box popping up.

Posted: Wed Mar 01, 2006 11:13 am
by hgiritzer
Let's agree on: it should be configurable if a (dropdown-)list appears automatically when typing the first letter, or if the user has to press the down arrow symbol to show the dropdown-list :-)

For the application in my mind, the automatic version is more suitable.
For others, it might be not.

Posted: Tue Mar 07, 2006 6:46 am
by markw
I would love to have a control to show a popup list of matches using a combobox. This would be useful as a search control where there are several hundred or several thousand records in a database.

I tried to implement this myself but didn't get very far. I use wxPerl which comes with limitations, but if/when you decide to go there I will gladly provide testing and feedback.

Posted: Tue Mar 07, 2006 10:36 am
by priyank_bolia
I think I told you earlier also that I don;t know PERL.

Posted: Tue Mar 07, 2006 10:46 am
by markw
Yes you did, and it is totally irrelevant. Perl simply creates a wrapper around the C++ class and calls the class methods as appropriate.

Simply put: Forget I mentioned Perl. I am not a C programmer so I am unable to create this class but I can assist with testing and feedback.

From the replies to this thread, other users are also looking for this functionality too. Are you going to consider extending or replacing this class to support popup lists?