Re: [wxPython-users] Question re right-aligned text control
by Frank Millman other posts by this author
Apr 21 2003 8:39AM messages near this date
[wxPython-users] wxGlade and Events. HOW?!
|
Re: [wxPython-users] wxGlade and Events. HOW?!
> Frank Millman wrote:
> > Hi all,
> >
> > I am trying to use the right-aligned text control that was kindly
> > contributed by Josu Oyanguren in one the earlier demos. It is a subclass
of
> > wxTextCtrl that traps an EVT_PAINT event, and then does the following -
> >
> >
> > Josu states that it only works on wxMSW, and he is correct. Under wxGTK,
it
> > seems that EVT_PAINT is never called from a text control. Does anyone
know
> > why?
>
Robin Dunn wrote:
> In wxGTK many controls are not true windows but are just drawn directly
> on their parent. I didn't think that wxTextCtrl was this way but it
> could be.
>
>
> > Is there any workaround?
>
> Not that I know of, other than padding the value with leading spaces...
>
Thanks, Robin. This is such an obvious idea that it did not occur to me. It
works quite well. It is not perfect, because, sticking to the default fonts,
a space takes up 4 pixels on Linux and 3 pixels on Windows. This means that
in a worst case the right hand margin can be misaligned by 3 or 2 pixels
respectively, and this is noticeable. I guess I should start looking into
using a fixed-pitch font for numeric controls.
> I think that the widget in GTK2 does support right-aligned text, but I
> don't know if wxGTK2 is supporting it yet. Doesn't look like it is
> doing anything with the wxTE_RIGHT style in the code. Enter a feature
> request for it so it doesn't get lost.
>
I have entered a request to add support for wxTE_RIGHT under GTK2. I have
also entered a request to add support for EVT_PAINT in a wxTextCtrl under
GTK2. I understand from your comments above that this may not be possible,
but if it could be done it would be great.
Many thanks
Frank Millman
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@[...].org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Thread:
Eladio Ventura
Frank Millman
Chris Munchenberg
Eladio Ventura
Eladio Ventura
Robin Dunn
Chris Munchenberg
Eladio Ventura
Chris Munchenberg
Eladio Ventura
Eladio Ventura
Alberto Griggio
Frank Millman
Robin Dunn
|