Has anybody ever written a nice "labelled text entry" class?
I mean, the situation of having a text enty widget associated with a
static text label is quite common, yet we always need to go through the
cumbersome process of doing something like:
[cumbersome process snipped]
Agreed!
If nobody has done it yet, I would do it.
Thank's Horst. Great!
Of course, the advantage of defining the separately is that you can
get the alignment just the way you like it... You might want the
label above the text entry like this:
Spam
[________]
or before, like this:
Spam [________]
If you want several entry fields, you probably want them aligned,
not just the labels. (Proper viewing of text below required non
proportional font).
E.g. you don't want:
Name [__________]
Adress [_______________]
Phone [_________]
But rather:
Name [__________]
Adress [_______________]
Phone [_________]
Or maybe:
Name [__________]
Adress [_______________]
Phone [_________]
I haven't played around enough with layout to know
how difficult this is to solve so that it works
right with sizers etc.
My first thought was that one would need to have
some kind of anchor on the beginning of the entry
field to align by, but then I realized that it
might be ok just to specify a big enough width
for the label. Then it shouldn't be so bad.
I've have some clients who would probably give
comments such as wanting the label to be 0.7 mm
closer to the entry field...
Then you have the issue of vertical alignment. My
experience is that you might have to fiddle a bit
with these things. It usually works best with
wxALIGN_CENTER_VERTICAL in my wxPython experience,
but NOT if you have a multi line entry field I guess...
But if you can make something that works well with
only single lines, it's a good start.
I guess it would be a good thing if this combo
widget would somehow encapsulate all the functionality
in the normal two-controls-and-sizer solution so
that there are good defaults, but if I want some
variation on exact label location etc, I can make
a subclass of your control and use that through out
my design. I'd love to be able to change *all* my labels
to be left aligned, bold, in a different font, or two
pixels closer to the entry control by making a change
in just one place in the code.
···
At 22:23 2002-02-12 +1100, Horst wrote:
--
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se