Allow empty message in wxRearrangeDialog.

If the message is empty, don't reserve space for it at the top; instead,
just make the dialog a bit smaller.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2010-07-27 21:45:29 +00:00
parent a3a8d81d48
commit b390729ff9

View File

@@ -285,8 +285,19 @@ bool wxRearrangeDialog::Create(wxWindow *parent,
// notice that the items in this sizer should be inserted accordingly to
// wxRearrangeDialogSizerPositions order
wxSizer * const sizerTop = new wxBoxSizer(wxVERTICAL);
sizerTop->Add(new wxStaticText(this, wxID_ANY, message),
wxSizerFlags().Border());
if ( !message.empty() )
{
sizerTop->Add(new wxStaticText(this, wxID_ANY, message),
wxSizerFlags().Border());
}
else
{
// for convenience of other wxRearrangeDialog code that depends on
// positions of sizer items, insert a dummy zero-sized item
sizerTop->AddSpacer(0);
}
sizerTop->Add(m_ctrl,
wxSizerFlags(1).Expand().Border());
sizerTop->Add(CreateSeparatedButtonSizer(wxOK | wxCANCEL),