|
|
 | | From: | DeMarco, Paul | | Subject: | RE: wxDesigner: Strange Limitation | | Date: | Wed, 19 Jan 2005 22:02:11 +0000 (UTC) |
|
|
 | David, I RE-read the wxSizer documentation, but I don't conclude that Expand = Horizontally and center vertically are mutually exclusive. Especially = since wxDesigner allows Alignment->Expand Horizontally
AND=20
Alignment->Top Align
What is the significant difference between Top & Center that makes = Center M.E. with Expand Horizontally?
Sorry but it seems like a major kludge to put spacers above and below = the control to get a centered effect.
TIA
-- Paul
-----Original Message----- From: David Elliott [mailto:elliott@stcnet.com] Sent: Wednesday, January 19, 2005 3:39 PM To: wx-users@lists.wxwidgets.org Subject: Re: wxDesigner: Strange Limitation
On Jan 19, 2005, at 2:57 PM, DeMarco, Paul wrote:
> Is there some reason in wxDesigner that I cannot choose for a=20 > wxTextCtrl: > > Alignment->Expand Horizontally > > AND > > Alignment->Center Vertically > Read the wxSizer documentation and you'll realize that this isn't=20 possible. These aren't springs and struts (or constraints if you=20 prefer to call them that) but sizers. They work differently.
> This is a really annoying problem because I want to take advantage of=20 > the space left to right, but not in height because it makes the=20 > control look awkward. > > It seems that there may be some bug that has to do with this=20 > allignment stuff because sometimes I see Center Horizontally and=20 > Expand Horizontally checked at the same time. --> seems illogical. > No idea why both of these are allowed, indeed they are mutually=20 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=20 that you can tell the main sizer to grow the child sizer to take all=20 available space both horizontally and vertically then tell the child=20 sizer (which should be a vertical sizer) to add a space with portion of=20 x (typically 1), the real text control with portion of 0 (so it doesn't=20 grow) and another space with portion of x (must be same as first,=20 typically 1).
In this manner the sizer will not change the vertical size of the text=20 control (as it has a portion of 0) but will change the sizes of both=20 spacers above and below the text control such that the text control is=20 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
--------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-help@lists.wxwidgets.org
|
|
 | | From: | Kevin Hock | | Subject: | Re: wxDesigner: Strange Limitation | | Date: | Wed, 19 Jan 2005 22:13:05 +0000 (UTC) |
|
|
 | Hi Paul,
What about using borders, and use large top and bottom borders?
Kevin
----- Original Message ----- From: "DeMarco, Paul" To: Sent: Wednesday, January 19, 2005 5:01 PM Subject: RE: wxDesigner: Strange Limitation
David, I RE-read the wxSizer documentation, but I don't conclude that Expand Horizontally and center vertically are mutually exclusive. Especially since wxDesigner allows Alignment->Expand Horizontally
AND
Alignment->Top Align
What is the significant difference between Top & Center that makes Center M.E. with Expand Horizontally?
Sorry but it seems like a major kludge to put spacers above and below the control to get a centered effect.
TIA
-- Paul
--------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-help@lists.wxwidgets.org
|
|
 | | From: | Cheetah | | Subject: | Re: wxDesigner: Strange Limitation | | Date: | Wed, 19 Jan 2005 22:16:17 +0000 (UTC) |
|
|
 | On Wed, 19 Jan 2005 17:01:18 -0500, DeMarco, Paul wrote: > David, > I RE-read the wxSizer documentation, but I don't conclude that Expand Horizontally and center vertically are mutually exclusive. Especially since wxDesigner allows Alignment->Expand Horizontally > > AND > > Alignment->Top Align > > What is the significant difference between Top & Center that makes Center M.E. with Expand Horizontally? > > Sorry but it seems like a major kludge to put spacers above and below the control to get a centered effect.
I'm not familiar with wxDesigner, but it sounds like it is obscuring how the sizers are being setup from you. wxSizer does not have a "Expand Horizontally" flag, it only has an Expand flag. For a box sizer, this means expanding in the direction *perpendicular* to the box direction. In a box sizer, items always fill all the space in the direction of the sizer. For a grid sizer, it means to expand in all directions. If you want an item within a grid sizer to only expand in one direction, you need to put it inside a box sizer and then that box sizer into the grid sizer. If you want extra space between items in a box sizer, that's what adding spacers is for. It's no more a kludge than having N more options to the Add call to specify every possible alignment within an allocation box. Sizers philosophically trade having a small number of complex layout entities in favor of a larger number of simple entities.
-- -- Cheetah
--------------------------------------------------------------------- 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 22:34:05 +0000 (UTC) |
|
|
 | On Jan 19, 2005, at 5:01 PM, DeMarco, Paul wrote:
> David, > I RE-read the wxSizer documentation, but I don't conclude that Expand > Horizontally and center vertically are mutually exclusive. Especially > since wxDesigner allows Alignment->Expand Horizontally > > AND > > Alignment->Top Align > Alignment on an item in a box sizer only takes effect in the direction perpendicular to the box sizer's layout. So an item in a vertical sizer can either alight left, alight right, center horizontally, or grow to fill the width. An item in a horizontal box sizer can only align top, align bottom, center vertically, or grow to fill the height. The behavior in the direction of the sizer is not determined by flags but instead by the proportions of its items.
-Dave
--------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-help@lists.wxwidgets.org
|
|
 | | From: | Efraín_López | | Subject: | Re: wxDesigner: Strange Limitation | | Date: | Wed, 19 Jan 2005 22:42:16 +0000 (UTC) |
|
|
 | Hi, I use DialogBlocks
horizontal and vertical aligments are exclusive on wxBoxSizer
but not on wxGridSizer, where you can set Expand Horizontally, Center Vertically
----- Original Message ----- From: "DeMarco, Paul" To: Sent: Wednesday, January 19, 2005 4:01 PM Subject: RE: wxDesigner: Strange Limitation
David, I RE-read the wxSizer documentation, but I don't conclude that Expand Horizontally and center vertically are mutually exclusive. Especially since wxDesigner allows Alignment->Expand Horizontally
AND
Alignment->Top Align
What is the significant difference between Top & Center that makes Center M.E. with Expand Horizontally?
Sorry but it seems like a major kludge to put spacers above and below the control to get a centered effect.
TIA
-- Paul
-----Original Message----- From: David Elliott [mailto:elliott@stcnet.com] Sent: Wednesday, January 19, 2005 3:39 PM To: wx-users@lists.wxwidgets.org Subject: Re: wxDesigner: Strange Limitation
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
--------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-help@lists.wxwidgets.org
--------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wx-users-help@lists.wxwidgets.org
|
|
|