diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-03-01 00:40:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-03-03 01:27:53 +0100 |
| commit | 1695ad102d21c601592e8895d8b402ceebf4f1b0 (patch) | |
| tree | e816ce1e3d58d3300eb43f4cf4c1a5ed22ae29a2 | |
| parent | 3b9be2ddfbfbb8ad0ae591ae90d93835ea42bf9f (diff) | |
Tidy up a little with a lambda.
| -rw-r--r-- | src/wx/full_config_dialog.cc | 19 |
1 files 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)); |
