2 Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "content_sub_panel.h"
21 #include "content_panel.h"
23 #include <wx/notebook.h>
24 #include <boost/foreach.hpp>
28 using boost::shared_ptr;
30 ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name)
31 : wxPanel (p->notebook(), wxID_ANY)
33 , _sizer (new wxBoxSizer (wxVERTICAL))
35 p->notebook()->AddPage (this, name, false);
40 ContentSubPanel::setup_refer_button (wxCheckBox* button, shared_ptr<DCPContent> dcp, bool can_reference, list<string> why_not) const
42 button->Enable (can_reference);
46 s = _("No DCP selected.");
47 } else if (!can_reference) {
48 s = _("Cannot reference this DCP. ");
49 BOOST_FOREACH (string i, why_not) {
50 s += std_to_wx(i) + wxT(" ");
53 button->SetToolTip (s);