+ _use = new CheckBox (this, _("Use as"));
+ _type = new wxChoice (this, wxID_ANY);
+ _type->Append (_("open subtitles"));
+ _type->Append (_("closed captions"));
+
+ _burn = new CheckBox (this, _("Burn subtitles into image"));
+
+ _offset_label = create_label (this, _("Offset"), true);
+ _x_offset_label = create_label (this, _("X"), true);
+ _x_offset = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
+ _x_offset_pc_label = new StaticText (this, _("%"));
+ _y_offset_label = create_label (this, _("Y"), true);
+ _y_offset = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
+ _y_offset_pc_label = new StaticText (this, _("%"));
+
+ _scale_label = create_label (this, _("Scale"), true);
+ _x_scale_label = create_label (this, _("X"), true);
+ _x_scale = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
+ _x_scale_pc_label = new StaticText (this, _("%"));
+ _y_scale_label = create_label (this, S_("Coord|Y"), true);
+ _y_scale = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
+ _y_scale_pc_label = new StaticText (this, _("%"));
+
+ _line_spacing_label = create_label (this, _("Line spacing"), true);
+ _line_spacing = new wxSpinCtrl (this);
+ _line_spacing_pc_label = new StaticText (this, _("%"));
+
+ _stream_label = create_label (this, _("Stream"), true);
+ _stream = new wxChoice (this, wxID_ANY);
+
+ _text_view_button = new Button (this, _("View..."));
+ _fonts_dialog_button = new Button (this, _("Fonts..."));
+ _appearance_dialog_button = new Button (this, _("Appearance..."));
+
+ _x_offset->SetRange (-100, 100);
+ _y_offset->SetRange (-100, 100);
+ _x_scale->SetRange (10, 1000);
+ _y_scale->SetRange (10, 1000);
+ _line_spacing->SetRange (10, 1000);
+
+ _reference->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::reference_clicked, this));
+ _use->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::use_toggled, this));
+ _type->Bind (wxEVT_CHOICE, boost::bind (&TextPanel::type_changed, this));
+ _burn->Bind (wxEVT_CHECKBOX, boost::bind (&TextPanel::burn_toggled, this));
+ _x_offset->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::x_offset_changed, this));
+ _y_offset->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::y_offset_changed, this));
+ _x_scale->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::x_scale_changed, this));
+ _y_scale->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::y_scale_changed, this));
+ _line_spacing->Bind (wxEVT_SPINCTRL, boost::bind (&TextPanel::line_spacing_changed, this));
+ _stream->Bind (wxEVT_CHOICE, boost::bind (&TextPanel::stream_changed, this));
+ _text_view_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::text_view_clicked, this));
+ _fonts_dialog_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::fonts_dialog_clicked, this));
+ _appearance_dialog_button->Bind (wxEVT_BUTTON, boost::bind (&TextPanel::appearance_dialog_clicked, this));
+
+ add_to_grid();
+ content_selection_changed ();
+}
+
+void
+TextPanel::setup_visibility ()
+{
+ switch (current_type()) {
+ case TEXT_OPEN_SUBTITLE:
+ if (_dcp_track_label) {
+ _dcp_track_label->Destroy ();
+ _dcp_track_label = 0;
+ }
+ if (_dcp_track) {
+ _dcp_track->Destroy ();
+ _dcp_track = 0;
+ }
+ if (!_language_label) {
+ _language_label = create_label (this, _("Language"), true);
+ add_label_to_sizer (_grid, _language_label, true, wxGBPosition(_language_row, 0));
+ }
+ if (!_language) {
+ _language = new wxTextCtrl (this, wxID_ANY);
+ _language->Bind (wxEVT_TEXT, boost::bind(&TextPanel::language_changed, this));
+ _grid->Add (_language, wxGBPosition(_language_row, 1), wxDefaultSpan, wxEXPAND);
+ film_content_changed (TextContentProperty::LANGUAGE);
+ }
+ break;
+ case TEXT_CLOSED_CAPTION:
+ if (_language_label) {
+ _language_label->Destroy ();
+ _language_label = 0;
+ }
+ if (_language) {
+ _language->Destroy ();
+ _language = 0;
+ }
+ if (!_dcp_track_label) {
+ _dcp_track_label = create_label (this, _("CCAP track"), true);
+ add_label_to_sizer (_grid, _dcp_track_label, true, wxGBPosition(_language_row, 0));
+ }
+ if (!_dcp_track) {
+ _dcp_track = new wxChoice (this, wxID_ANY);
+ _dcp_track->Bind (wxEVT_CHOICE, boost::bind(&TextPanel::dcp_track_changed, this));
+ _grid->Add (_dcp_track, wxGBPosition(_language_row, 1), wxDefaultSpan, wxEXPAND);
+ update_dcp_tracks ();
+ film_content_changed (TextContentProperty::DCP_TRACK);
+ }
+ break;
+ default:
+ break;
+ }
+
+ _grid->Layout ();
+}
+
+void
+TextPanel::add_to_grid ()
+{
+ Config::Interface const interface = Config::instance()->interface_complexity();