Growable horizontal cell size in wxFlexGridSizer

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
purplex88
I live to help wx-kind
I live to help wx-kind
Posts: 199
Joined: Mon Feb 24, 2014 3:14 pm

Growable horizontal cell size in wxFlexGridSizer

Post by purplex88 » Thu Feb 07, 2019 6:09 pm

When I make a column growable in the wxFlexGridSizer, I can use wxALIGN_LEFT and wxALIGN_RIGHT to move the control inside the cell.

I cannot do it if the column is not growable.

Here's an example:

When "MyLabel" static text control was wxALIGN_LEFT in wxFlexGridSizer:
Growable Column Left Align.png
Growable Column Left Align.png (2.96 KiB) Viewed 153 times
And with wxALIGN_RIGHT:
Growable Column Right Align.png
Growable Column Right Align.png (3.32 KiB) Viewed 153 times
So, What's the default size of cell I get for moving "MyLabel" around with a growable column?

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3160
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Growable horizontal cell size in wxFlexGridSizer

Post by ONEEYEMAN » Thu Feb 07, 2019 8:39 pm

Hi,
The sizer is not a window, and therefore, does not have size.
Why do you want to know this?

Thank you.

purplex88
I live to help wx-kind
I live to help wx-kind
Posts: 199
Joined: Mon Feb 24, 2014 3:14 pm

Re: Growable horizontal cell size in wxFlexGridSizer

Post by purplex88 » Thu Feb 07, 2019 10:01 pm

Hi,

I don't mean the sizer. I wrote the 'cell' inside wxFlexGridSizer sizer.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3160
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Growable horizontal cell size in wxFlexGridSizer

Post by ONEEYEMAN » Thu Feb 07, 2019 10:19 pm

Hi,
The cell is also not a window.
One more time - why do you need this info? What problem you are trying to solve?

Thank you.

purplex88
I live to help wx-kind
I live to help wx-kind
Posts: 199
Joined: Mon Feb 24, 2014 3:14 pm

Re: Growable horizontal cell size in wxFlexGridSizer

Post by purplex88 » Fri Feb 08, 2019 12:05 am

Then, how come the cell has a size? I know its not a window.
I am just trying to understand the behavior. Probably you don't know understand what I mean.

User avatar
doublemax
Moderator
Moderator
Posts: 13298
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Growable horizontal cell size in wxFlexGridSizer

Post by doublemax » Fri Feb 08, 2019 12:21 am

I'm not sure i understand what your question is, either.

Each control has a minimum size which is determined by its content. In a non-growable column, the width of the column will be the width of the widest control in that column.
Use the source, Luke!

purplex88
I live to help wx-kind
I live to help wx-kind
Posts: 199
Joined: Mon Feb 24, 2014 3:14 pm

Re: Growable horizontal cell size in wxFlexGridSizer

Post by purplex88 » Fri Feb 08, 2019 1:59 pm

Thanks, doublemax. I will try to shed some more light:
Growable Column Right Align Detailed.png
Growable Column Right Align Detailed.png (21.11 KiB) Viewed 109 times
I understand what you said about a non-growable column.

But here as you can see that it is a growable column. Why is "MyLabel" aligned to that much far to right?

User avatar
doublemax
Moderator
Moderator
Posts: 13298
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Growable horizontal cell size in wxFlexGridSizer

Post by doublemax » Fri Feb 08, 2019 2:19 pm

My guess is that you force the sizer to fill the whole width of the parent (sizer) with wxEXPAND and then the sizer will make both columns equal size. Try making the right column growable and see what happens.
Use the source, Luke!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3160
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Growable horizontal cell size in wxFlexGridSizer

Post by ONEEYEMAN » Fri Feb 08, 2019 3:32 pm

Hi,
Can you show the code?

Thank you.

Post Reply