A> The sizing behavior I'm trying to get is...
A> - A wxWindow that expands as the frame resizes
A> - Below this, some text aligned on the left side of the frame and some
A> text aligned on the right side
A>
A> I would expect to be able to do this with...
A>
A> wxWindow *expanded_window = ...
A>
A> wxBoxSizer *hbox(new wxBoxSizer(wxHORIZONTAL, parent));
A> hbox->Add(new wxStaticText(parent, wxID_ANY, "Left"), 0,
A> wxALIGN_LEFT);
A> hbox->Add(new wxStaticText(parent, wxID_ANY, "Right"), 0,
A> wxALIGN_RIGHT);
...
A> Is the alignment behavior in a horizontal box not what I'm expecting?
Indeed, it isn't. wxALIGN_LEFT/RIGHT only work in vertical sizer because
the flags only specify what happens in the "minor" sizer direction (the one
orthogonal to the main, "major", one, which is horizontal for wxHORIZONTAL
sizers and vertical for wxVERTICAL ones). The behaviour in the major
direction is determined solely by the proportion. So to achieve what you
want you'd need to do:
hbox->Add(new wxStaticText(... "left"));
hbox->AddStretchSpacer();
hbox->Add(new wxStaticText(... "right"));
FWIW I regret that sizers API allows you to specify the flags which don't
make sense and also that this isn't detected even during run-time. It's too
late to change the former but it would be great to add at least the
latter...
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/