| knowledge-database (beta) |
 |
Current group: comp.soft-sys.wxwindows
wxDesigner: Strange Limitation
| DeMarco, Paul | | David Elliott |
|
|
 | | From: | DeMarco, Paul | | Subject: | wxDesigner: Strange Limitation | | Date: | Wed, 19 Jan 2005 19:58:09 +0000 (UTC) |
|
|
 | Is there some reason in wxDesigner that I cannot choose for a = wxTextCtrl:
Alignment->Expand Horizontally
AND
Alignment->Center Vertically
This is a really annoying problem because I want to take advantage of = the space left to right, but not in height because it makes the control = look awkward.
It seems that there may be some bug that has to do with this allignment = stuff because sometimes I see Center Horizontally and Expand = Horizontally checked at the same time. --> seems illogical.
I have tested on Windows and Linux both are the same.
Version 2.10b
Thanks,
-- Paul
--------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-help@lists.wxwidgets.org
|
|
 | | From: | David Elliott | | Subject: | Re: wxDesigner: Strange Limitation | | Date: | Wed, 19 Jan 2005 20:39:34 +0000 (UTC) |
|
|
 | On Jan 19, 2005, at 2:57 PM, DeMarco, Paul wrote:
> Is there some reason in wxDesigner that I cannot choose for a > wxTextCtrl: > > Alignment->Expand Horizontally > > AND > > Alignment->Center Vertically > Read the wxSizer documentation and you'll realize that this isn't possible. These aren't springs and struts (or constraints if you prefer to call them that) but sizers. They work differently.
> This is a really annoying problem because I want to take advantage of > the space left to right, but not in height because it makes the > control look awkward. > > It seems that there may be some bug that has to do with this > allignment stuff because sometimes I see Center Horizontally and > Expand Horizontally checked at the same time. --> seems illogical. > No idea why both of these are allowed, indeed they are mutually exclusive AFAIK.
> I have tested on Windows and Linux both are the same. > Of course, the sizer code is common between all platforms.
What you need to do is insert another sizer into your hierarchy such that you can tell the main sizer to grow the child sizer to take all available space both horizontally and vertically then tell the child sizer (which should be a vertical sizer) to add a space with portion of x (typically 1), the real text control with portion of 0 (so it doesn't grow) and another space with portion of x (must be same as first, typically 1).
In this manner the sizer will not change the vertical size of the text control (as it has a portion of 0) but will change the sizes of both spacers above and below the text control such that the text control is effectively centered within this vertical sizer.
-Dave
--------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-help@lists.wxwidgets.org
|
|
|
| | |
|
 |