Ensure wxRadioBox is big enough to fit its contents in wxMSW

Since the changes of ce1ee46b0c (Use wxRadioButton in MSW wxRadioBox
implementation, 2022-12-24) the control could be too small because we
only accounted for the extra static box margins in two directions (top
and left) but not the two other ones.

Fix this by adding the border around the buttons in all directions and
also increasing its size to preserve more or less the same appearance as
before.

Closes #23267.
This commit is contained in:
Vadim Zeitlin 2023-02-18 20:30:06 +00:00
parent 238050bd51
commit d4e9b9b95d

View file

@ -172,8 +172,11 @@ bool wxRadioBox::Create(wxWindow *parent,
int borderTop, borderOther;
GetBordersForSizer(&borderTop, &borderOther);
sizerBox->AddSpacer(borderTop);
sizerBox->Add(sizerButtons, wxSizerFlags().Border(wxLEFT, borderOther));
if ( borderTop > borderOther )
sizerBox->AddSpacer(borderTop - borderOther);
borderOther += wxSizerFlags::GetDefaultBorder();
sizerBox->Add(sizerButtons, wxSizerFlags().Border(wxALL, borderOther));
SetSizer(sizerBox);