+ _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;