wxAutoTextCtrl

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

wxAutoTextCtrl

Post by priyank_bolia » Fri Jan 27, 2006 6:13 pm

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/

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Fri Jan 27, 2006 6:25 pm

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
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia » Sat Jan 28, 2006 7:39 am

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.

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Sat Jan 28, 2006 9:04 am

Agreed :-)

Thanks,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 » Mon Jan 30, 2006 1:02 pm

samething for a Combobox would be nice :)

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Mon Jan 30, 2006 1:20 pm

Well ofcourse you can make this optional, as for many situations it might prove handy.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

hgiritzer
Knows some wx things
Knows some wx things
Posts: 34
Joined: Wed Mar 09, 2005 10:24 am
Location: Austria

Post by hgiritzer » Wed Mar 01, 2006 8:47 am

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.

priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia » Wed Mar 01, 2006 11:03 am

I would rather use a combo box, rather than a list box popping up.

hgiritzer
Knows some wx things
Knows some wx things
Posts: 34
Joined: Wed Mar 09, 2005 10:24 am
Location: Austria

Post by hgiritzer » Wed Mar 01, 2006 11:13 am

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.

markw
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Mar 07, 2006 6:37 am

Post by markw » Tue Mar 07, 2006 6:46 am

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.

priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia » Tue Mar 07, 2006 10:36 am

I think I told you earlier also that I don;t know PERL.

markw
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Mar 07, 2006 6:37 am

Post by markw » Tue Mar 07, 2006 10:46 am

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?

Post Reply