From 1695ad102d21c601592e8895d8b402ceebf4f1b0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 1 Mar 2023 00:40:36 +0100 Subject: [PATCH] Tidy up a little with a lambda. --- src/wx/full_config_dialog.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index 4dff7b5bf..59c1d4c9f 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -1524,9 +1524,13 @@ private: table->Add(s, 1); } - _allow_any_dcp_frame_rate = new CheckBox(_panel, _("Allow any DCP frame rate")); - table->Add(_allow_any_dcp_frame_rate, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); - table->AddSpacer(0); + auto checkbox = [this, table](wxString name, CheckBox*& variable) { + variable = new CheckBox(_panel, name); + table->Add(variable, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); + table->AddSpacer(0); + }; + + checkbox(_("Allow any DCP frame rate"), _allow_any_dcp_frame_rate); _allow_any_container = new CheckBox(_panel, _("Allow full-frame and non-standard container ratios")); table->Add(_allow_any_container, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); @@ -1538,13 +1542,8 @@ private: table->Add(restart, 1, wxALIGN_CENTRE_VERTICAL | wxBOTTOM, DCPOMATIC_CHECKBOX_BOTTOM_PAD); restart->SetFont(font); - _allow_96khz_audio = new CheckBox(_panel, _("Allow creation of DCPs with 96kHz audio")); - table->Add(_allow_96khz_audio, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); - table->AddSpacer (0); - - _use_all_audio_channels = new CheckBox(_panel, _("Allow mapping to all audio channels")); - table->Add(_use_all_audio_channels, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); - table->AddSpacer(0); + checkbox(_("Allow creation of DCPs with 96kHz audio"), _allow_96khz_audio); + checkbox(_("Allow mapping to all audio channels"), _use_all_audio_channels); _maximum_j2k_bandwidth->SetRange(1, 1000); _maximum_j2k_bandwidth->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::maximum_j2k_bandwidth_changed, this)); -- 2.30.2