From b390729ff9f8cdffa27bf69cedc721663ef4685c Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 27 Jul 2010 21:45:29 +0000 Subject: [PATCH] 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 --- src/common/rearrangectrl.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/common/rearrangectrl.cpp b/src/common/rearrangectrl.cpp index 6027fd2fb3..c9a27121cb 100644 --- a/src/common/rearrangectrl.cpp +++ b/src/common/rearrangectrl.cpp @@ -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), -- 2.45.2