TextAutoComplete on a long line of text with smaller drop downs?
AK
andrei.avk at gmail.com
Mon Mar 17 17:04:40 PDT 2008
Hello,
I need some advice on what is the best way to enter a lot of tags into
an app text ctrl. I'm not sure whether to go with a single long ctrl or
with a row of smaller ones, in latter case I could use
TextCtrlAutoComplete. The use pattern is this: when entering a new
record, (which could be very short and many of them may be entered in
sequence), user has to input a number of tags, most of them will already
be in the database, but some may be new. I want to make it as easy and
hassle-free as possible to enter the tags that are already in the db.
One thing I already know how to do is to use TextCtrlAutoComplete and
make a bunch of entry fields in a row, and then an optional 2nd and
maybe 3rd row which can be activated if needed. But I'm leaning towards
using a single long line, which has an advantage that short tags will
take very little space and therefore you won't need to have more lines,
and line can scroll off for cases when you need to add a huge amount of
tags, or some extra-long tags. That practically should never happen,
though, but it is significantly better to be able to avoid the 2nd line.
I also feel that having one long line where you type tags and separate
them by commas feels like a more streamlined, easier process than
tabbing between several textctrls - i.e. with tabbing you will feel more
inclined to have to look at the screen after entering each tag, whereas
with single control you'll just type all of them and then check if
they're good.
At first I wanted to try using TextCtrlAutoComplete and set it to
smaller size, but I could not find a way to do this. I looked at the
source file and it does not set its size anywhere, only the size of
listctrl is set, which is the drop down, it is set to wx.DefaultSize,
but if I override it with a different size, both textctrl and the
listctrl end up being the same size as before. I think TextCtrl then
somehow follows the size of the list, but I could be wrong. I tried
changing it with .SetSize, but that does not work either.
If going with the long line, the way it should work is similar to text
completion in terminal, i.e. on incomplete word you can hit tab to
either complete it or show possible choices, then add more letters and
hit tab again. The drop down should not be the whole width of line, of
course, but only about 100px.
What's the best way to do this? Thanks! -ak
More information about the wxpython-users
mailing list