On Mon, 26 Jan 2015 19:40:54 +0100 Manolo wrote:
M> I'm speaking about mixing goals: you propose to assert on some
M> alignment/expand combination.
Asserting is just a "QoI" issue, it's there to help people to notice that
the combination of flags they specify doesn't do anything useful. This is,
of course, not new neither, e.g. the current sizer API already allows you
to use wxALIGN_BOTTOM|wxALIGN_CENTER_VERTICAL and other nonsensical
combinations.
M> > M> I like the idea of using wxEXPAND_HORIZONTALLY and wxEXPAND_VERTICALLY
M> > M> not only for wxGridSizer (and derivatives) but for the base class
M> > M> wxSizer. I think it may clarify a bit the grow direction.
M> >
M> > Using them for box sizers would be totally confusing as the one
M> > corresponding to the minor direction of the sizer would affect the item
M> > proportion. So now, instead of mixing "just" alignment and size, you'd mix
M> > everything together.
M>
M> No. Proportion is what matters in the mayor direction, despite of
M> whatever flag is set. Nobody is going to change this.
But what would wxEXPAND_{HORIZONTALLY,VERTICALLY} do then in
horizontal/vertical sizer? Be silently ignored?
M> How my proposal breaks this? I'm only saying that wxEXPAND_VERTICALLY
M> could be used in an horizontal box sizer just as wxEXPAND is, with the
M> same meaning. And using wxEXPAND_HORIZONTALLY with this same horizontal
M> box has no effect, same as not using this flag.
OK, I misunderstood your proposal, although I do have to say that this:
M> Using wxEXPAND_HORIZONTALLY in a wxBoxSizer(wxHORIZONTAL) for an item
M> added with proportion=0 would had no effect, while with proportion>0 it
M> would behave as currently code ever did.
seemed to be quite different from the above.
Anyhow, I agree that making these flags do nothing in this case is a
lesser evil, but we'd still need to detect their use and assert to ensure
that nobody expects them to work. And nevertheless some people still would
and you can't really blame them, it seems pretty natural to use
wxEXPAND_HORIZONTALLY to make an item expand in the horizontal direction.
Allowing "constraining" the use of wxEXPAND in 2D sizers doesn't suffer
from this problem, at least I don't see what kind of wrong usage in 1D case
it could expire. And it doesn't require the introduction of 2 new flags. So
for me it is better from all points of view.
Regards,
VZ