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
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 247
Joined: Mon Feb 24, 2014 3:14 pm

Growable horizontal cell size in wxFlexGridSizer

Post by purplex88 »

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 1057 times
And with wxALIGN_RIGHT:
Growable Column Right Align.png
Growable Column Right Align.png (3.32 KiB) Viewed 1057 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: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Growable horizontal cell size in wxFlexGridSizer

Post by ONEEYEMAN »

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

Thank you.
purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 247
Joined: Mon Feb 24, 2014 3:14 pm

Re: Growable horizontal cell size in wxFlexGridSizer

Post by purplex88 »

Hi,

I don't mean the sizer. I wrote the 'cell' inside wxFlexGridSizer sizer.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Growable horizontal cell size in wxFlexGridSizer

Post by ONEEYEMAN »

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
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 247
Joined: Mon Feb 24, 2014 3:14 pm

Re: Growable horizontal cell size in wxFlexGridSizer

Post by purplex88 »

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: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Growable horizontal cell size in wxFlexGridSizer

Post by doublemax »

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
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 247
Joined: Mon Feb 24, 2014 3:14 pm

Re: Growable horizontal cell size in wxFlexGridSizer

Post by purplex88 »

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 1013 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: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Growable horizontal cell size in wxFlexGridSizer

Post by doublemax »

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: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Growable horizontal cell size in wxFlexGridSizer

Post by ONEEYEMAN »

Hi,
Can you show the code?

Thank you.
Post Reply