2 Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
22 #include "dcpomatic_button.h"
23 #include "language_tag_dialog.h"
24 #include "language_tag_widget.h"
29 LanguageTagWidget::LanguageTagWidget (wxWindow* parent, wxString tooltip, dcp::LanguageTag tag)
31 , _sizer (new wxBoxSizer(wxHORIZONTAL))
33 _language = new wxStaticText (parent, wxID_ANY, wxT(""));
34 _language->SetToolTip (tooltip);
36 _sizer->Add (_language, 1, wxLEFT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP);
37 _edit = new Button (parent, _("Edit..."));
38 _sizer->Add (_edit, 0, wxLEFT, DCPOMATIC_SIZER_GAP);
40 _edit->Bind (wxEVT_BUTTON, boost::bind(&LanguageTagWidget::edit, this));
45 LanguageTagWidget::edit ()
47 auto d = new LanguageTagDialog(_parent, _tag);
56 LanguageTagWidget::set (dcp::LanguageTag tag)
59 checked_set (_language, std_to_wx(tag.to_string()));
64 LanguageTagWidget::enable (bool e)
66 _language->Enable (e);