+using boost::optional;
+using dcp::locale_convert;
+
+TimingPanel::TimingPanel (ContentPanel* p, weak_ptr<FilmViewer> viewer)
+ /* horrid hack for apparent lack of context support with wxWidgets i18n code */
+ /// TRANSLATORS: translate the word "Timing" here; do not include the "Timing|" prefix
+ : ContentSubPanel (p, S_("Timing|Timing"))
+ , _viewer (viewer)
+ , _film_content_changed_suspender (boost::bind(&TimingPanel::film_content_changed, this, _1))
+{
+ wxSize size = TimecodeBase::size (this);
+
+ for (int i = 0; i < 3; ++i) {
+ _colon[i] = create_label (this, wxT(":"), false);
+ }
+
+ //// TRANSLATORS: this is an abbreviation for "hours"
+ _h_label = new StaticText (this, _("h"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+#ifdef DCPOMATIC_LINUX
+ /* Hack to work around failure to centre text on GTK */
+ gtk_label_set_line_wrap (GTK_LABEL(_h_label->GetHandle()), FALSE);
+#endif
+ //// TRANSLATORS: this is an abbreviation for "minutes"
+ _m_label = new StaticText (this, _("m"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+#ifdef DCPOMATIC_LINUX
+ gtk_label_set_line_wrap (GTK_LABEL (_m_label->GetHandle()), FALSE);
+#endif
+ //// TRANSLATORS: this is an abbreviation for "seconds"
+ _s_label = new StaticText (this, _("s"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+#ifdef DCPOMATIC_LINUX
+ gtk_label_set_line_wrap (GTK_LABEL(_s_label->GetHandle()), FALSE);
+#endif
+ //// TRANSLATORS: this is an abbreviation for "frames"
+ _f_label = new StaticText (this, _("f"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+#ifdef DCPOMATIC_LINUX
+ gtk_label_set_line_wrap (GTK_LABEL(_f_label->GetHandle()), FALSE);
+#endif
+
+ _position_label = create_label (this, _("Position"), true);
+ _position = new Timecode<DCPTime> (this);
+ _move_to_start_of_reel = new Button (this, _("Move to start of reel"));
+ _full_length_label = create_label (this, _("Full length"), true);
+ _full_length = new Timecode<DCPTime> (this);
+ _trim_start_label = create_label (this, _("Trim from start"), true);
+ _trim_start = new Timecode<ContentTime> (this);
+ _trim_start_to_playhead = new Button (this, _("Trim up to current position"));
+ _trim_end_label = create_label (this, _("Trim from end"), true);
+ _trim_end = new Timecode<ContentTime> (this);
+ _trim_end_to_playhead = new Button (this, _("Trim after current position"));
+ _play_length_label = create_label (this, _("Play length"), true);
+ _play_length = new Timecode<DCPTime> (this);
+
+ _video_frame_rate_label = create_label (this, _("Video frame rate"), true);
+ _video_frame_rate = new wxTextCtrl (this, wxID_ANY);
+ _set_video_frame_rate = new Button (this, _("Set"));
+ _set_video_frame_rate->Enable (false);
+
+ /* We can't use Wrap() here as it doesn't work with markup:
+ * http://trac.wxwidgets.org/ticket/13389
+ */