From d403c9eccee5950b80023ca09735d6832866c2a3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Feb 2019 14:50:31 +0100 Subject: [PATCH] Slightly simplify radio buttons creation in the unit test No real changes, just add a temporary variable for the parent and use more useful (and shorter) labels for the buttons. --- tests/controls/radiobuttontest.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/controls/radiobuttontest.cpp b/tests/controls/radiobuttontest.cpp index 649775b294..690bffcf1a 100644 --- a/tests/controls/radiobuttontest.cpp +++ b/tests/controls/radiobuttontest.cpp @@ -105,22 +105,20 @@ void RadioButtonTestCase::Value() void RadioButtonTestCase::Group() { - //Add another button to the first group and create another of two buttons - wxRadioButton* g1radio0 = new wxRadioButton(wxTheApp->GetTopWindow(), - wxID_ANY, "wxRadioButton", - wxDefaultPosition, - wxDefaultSize, wxRB_GROUP); + wxWindow* const parent = wxTheApp->GetTopWindow(); - wxRadioButton* g1radio1 = new wxRadioButton(wxTheApp->GetTopWindow(), - wxID_ANY, "wxRadioButton"); + // Create two different radio groups. + wxRadioButton* g1radio0 = new wxRadioButton(parent, wxID_ANY, "radio 1.0", + wxDefaultPosition, wxDefaultSize, + wxRB_GROUP); - wxRadioButton* g2radio0 = new wxRadioButton(wxTheApp->GetTopWindow(), - wxID_ANY, "wxRadioButton", - wxDefaultPosition, - wxDefaultSize, wxRB_GROUP); + wxRadioButton* g1radio1 = new wxRadioButton(parent, wxID_ANY, "radio 1.1"); - wxRadioButton* g2radio1 = new wxRadioButton(wxTheApp->GetTopWindow(), - wxID_ANY, "wxRadioButton"); + wxRadioButton* g2radio0 = new wxRadioButton(parent, wxID_ANY, "radio 2.0", + wxDefaultPosition, wxDefaultSize, + wxRB_GROUP); + + wxRadioButton* g2radio1 = new wxRadioButton(parent, wxID_ANY, "radio 2.1"); g1radio0->SetValue(true); g2radio0->SetValue(true);