X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftext_panel.cc;h=8cb4166c11bd7f51446ba961c87f3468499f4151;hb=3c29aa6531a4046a8db72dcac81189eb8893233c;hp=8e6d5cd68cc198854588d670c3762b6f58a8b9a7;hpb=c27d14badb229c24533db65dbaee1939dce89455;p=dcpomatic.git diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc index 8e6d5cd68..8cb4166c1 100644 --- a/src/wx/text_panel.cc +++ b/src/wx/text_panel.cc @@ -18,6 +18,7 @@ */ + #include "check_box.h" #include "content_panel.h" #include "dcp_text_track_dialog.h" @@ -44,26 +45,36 @@ #include "lib/string_text_file_decoder.h" #include "lib/subtitle_analysis.h" #include "lib/text_content.h" +#include +LIBDCP_DISABLE_WARNINGS #include +LIBDCP_ENABLE_WARNINGS -using std::vector; -using std::string; -using std::list; using std::cout; -using std::shared_ptr; -using boost::optional; using std::dynamic_pointer_cast; +using std::list; +using std::shared_ptr; +using std::string; +using std::vector; using boost::bind; +using boost::optional; /** @param t Original text type of the content, if known */ TextPanel::TextPanel (ContentPanel* p, TextType t) : ContentSubPanel (p, std_to_wx(text_type_to_name(t))) , _original_type (t) +{ + +} + + +void +TextPanel::create () { wxString refer = _("Use this DCP's subtitle as OV and make VF"); - if (t == TextType::CLOSED_CAPTION) { + if (_original_type == TextType::CLOSED_CAPTION) { refer = _("Use this DCP's closed caption as OV and make VF"); } @@ -82,30 +93,24 @@ TextPanel::TextPanel (ContentPanel* p, TextType t) _burn = new CheckBox (this, _("Burn subtitles into image")); -#ifdef __WXGTK3__ - int const spin_width = 118; -#else - int const spin_width = 56; -#endif - _offset_label = create_label (this, _("Offset"), true); _x_offset_label = create_label (this, _("X"), true); - _x_offset = new SpinCtrl (this, spin_width); + _x_offset = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH); _x_offset_pc_label = new StaticText (this, _("%")); _y_offset_label = create_label (this, _("Y"), true); - _y_offset = new SpinCtrl (this, spin_width); + _y_offset = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH); _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 SpinCtrl (this, spin_width); + _x_scale = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH); _x_scale_pc_label = new StaticText (this, _("%")); _y_scale_label = create_label (this, S_("Coord|Y"), true); - _y_scale = new SpinCtrl (this, spin_width); + _y_scale = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH); _y_scale_pc_label = new StaticText (this, _("%")); _line_spacing_label = create_label (this, _("Line spacing"), true); - _line_spacing = new SpinCtrl (this, spin_width); + _line_spacing = new SpinCtrl (this, DCPOMATIC_SPIN_CTRL_WIDTH); _line_spacing_pc_label = new StaticText (this, _("%")); _stream_label = create_label (this, _("Stream"), true); @@ -137,6 +142,8 @@ TextPanel::TextPanel (ContentPanel* p, TextType t) add_to_grid(); content_selection_changed (); + + _sizer->Layout (); } @@ -171,7 +178,7 @@ TextPanel::setup_visibility () _language_type->Append (_("Main")); _language_type->Append (_("Additional")); _language_type->Bind (wxEVT_CHOICE, boost::bind(&TextPanel::language_is_additional_changed, this)); - _language_sizer->Add (_language_type, 0); + _language_sizer->Add (_language_type, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_CHOICE_TOP_PAD); _grid->Add (_language_sizer, wxGBPosition(_ccap_track_or_language_row, 1), wxGBSpan(1, 2)); film_content_changed (TextContentProperty::LANGUAGE); film_content_changed (TextContentProperty::LANGUAGE_IS_ADDITIONAL);