Basics of in-place i18n with support for wxStaticText and wxCheckBox.
authorCarl Hetherington <cth@carlh.net>
Sat, 8 Dec 2018 00:09:57 +0000 (00:09 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 8 Dec 2018 00:09:57 +0000 (00:09 +0000)
58 files changed:
src/tools/dcpomatic_kdm.cc
src/tools/dcpomatic_server.cc
src/wx/about_dialog.cc
src/wx/audio_dialog.cc
src/wx/audio_panel.cc
src/wx/check_box.cc [new file with mode: 0644]
src/wx/check_box.h [new file with mode: 0644]
src/wx/colour_conversion_editor.cc
src/wx/config_dialog.cc
src/wx/config_move_dialog.cc
src/wx/confirm_kdm_email_dialog.cc
src/wx/content_colour_conversion_dialog.cc
src/wx/content_properties_dialog.cc
src/wx/controls.cc
src/wx/dcp_panel.cc
src/wx/dir_picker_ctrl.cc
src/wx/download_certificate_dialog.cc
src/wx/export_dialog.cc
src/wx/film_name_location_dialog.cc
src/wx/filter_editor.cc
src/wx/font_files_dialog.cc
src/wx/full_config_dialog.cc
src/wx/hints_dialog.cc
src/wx/i18n_hook.cc [new file with mode: 0644]
src/wx/i18n_hook.h [new file with mode: 0644]
src/wx/initial_setup_dialog.cc
src/wx/instant_i18n_dialog.cc [new file with mode: 0644]
src/wx/instant_i18n_dialog.h [new file with mode: 0644]
src/wx/isdcf_metadata_dialog.cc
src/wx/job_view.cc
src/wx/kdm_advanced_dialog.cc
src/wx/kdm_cpl_panel.cc
src/wx/kdm_dialog.cc
src/wx/kdm_output_panel.cc
src/wx/kdm_timing_panel.cc
src/wx/make_chain_dialog.cc
src/wx/message_dialog.cc
src/wx/nag_dialog.cc
src/wx/name_format_editor.cc
src/wx/paste_dialog.cc
src/wx/player_config_dialog.cc
src/wx/recreate_chain_dialog.cc
src/wx/report_problem_dialog.cc
src/wx/rgba_colour_picker.cc
src/wx/screen_dialog.cc
src/wx/self_dkdm_dialog.cc
src/wx/static_text.cc [new file with mode: 0644]
src/wx/static_text.h [new file with mode: 0644]
src/wx/subtitle_appearance_dialog.cc
src/wx/table_dialog.cc
src/wx/text_panel.cc
src/wx/time_picker.cc
src/wx/timing_panel.cc
src/wx/update_dialog.cc
src/wx/video_panel.cc
src/wx/video_waveform_dialog.cc
src/wx/wscript
src/wx/wx_util.cc

index 2af57e3690dbc6fc5ea8e92ff06b76f6ec04a943..999bba17ee68292bdf1ce7fd71a37f9c45f97f46 100644 (file)
@@ -31,6 +31,7 @@
 #include "wx/file_dialog_wrapper.h"
 #include "wx/new_dkdm_folder_dialog.h"
 #include "wx/editable_list.h"
+#include "wx/static_text.h"
 #include "lib/config.h"
 #include "lib/util.h"
 #include "lib/screen.h"
@@ -129,20 +130,20 @@ public:
                wxFont subheading_font (*wxNORMAL_FONT);
                subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
 
-               wxStaticText* h = new wxStaticText (overall_panel, wxID_ANY, _("Screens"));
+               wxStaticText* h = new StaticText (overall_panel, _("Screens"));
                h->SetFont (subheading_font);
                left->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM, DCPOMATIC_SIZER_Y_GAP);
                _screens = new ScreensPanel (overall_panel);
                left->Add (_screens, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_SIZER_Y_GAP);
 
                /// TRANSLATORS: translate the word "Timing" here; do not include the "KDM|" prefix
-               h = new wxStaticText (overall_panel, wxID_ANY, S_("KDM|Timing"));
+               h = new StaticText (overall_panel, S_("KDM|Timing"));
                h->SetFont (subheading_font);
                right->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2);
                _timing = new KDMTimingPanel (overall_panel);
                right->Add (_timing, 0, wxALL, DCPOMATIC_SIZER_Y_GAP);
 
-               h = new wxStaticText (overall_panel, wxID_ANY, _("DKDM"));
+               h = new StaticText (overall_panel, _("DKDM"));
                h->SetFont (subheading_font);
                right->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
                wxBoxSizer* dkdm_sizer = new wxBoxSizer (wxHORIZONTAL);
@@ -162,7 +163,7 @@ public:
 
                add_dkdm_view (Config::instance()->dkdms());
 
-               h = new wxStaticText (overall_panel, wxID_ANY, _("Output"));
+               h = new StaticText (overall_panel, _("Output"));
                h->SetFont (subheading_font);
                right->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
                /* XXX: hard-coded non-interop here */
index 64bbb3049504139195485572cd6f46b78ec11bf6..1a3a8de1a1b06c95703ee65461c001349e4ce720 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "wx/wx_util.h"
 #include "wx/wx_signal_manager.h"
+#include "wx/static_text.h"
 #include "lib/util.h"
 #include "lib/encoded_log_entry.h"
 #include "lib/encode_server.h"
@@ -147,7 +148,7 @@ public:
                wxFlexGridSizer* state_sizer = new wxFlexGridSizer (2, DCPOMATIC_SIZER_GAP, DCPOMATIC_SIZER_GAP);
 
                add_label_to_sizer (state_sizer, this, _("Frames per second"), true);
-               _fps = new wxStaticText (this, wxID_ANY, wxT(""));
+               _fps = new StaticText (this, wxT(""));
                state_sizer->Add (_fps);
 
                wxFlexGridSizer* log_sizer = new wxFlexGridSizer (1, DCPOMATIC_SIZER_GAP, DCPOMATIC_SIZER_GAP);
index b9233ef1f361d2011ec3ad2e807b140846dd6b7e..db33ad64714028dd64283bd21f5d3682d0c41726 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -24,6 +24,7 @@
 
 #include "about_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
 #include "lib/version.h"
 #include "lib/compose.hpp"
 #include <wx/notebook.h>
@@ -47,22 +48,22 @@ AboutDialog::AboutDialog (wxWindow* parent)
        wxFont version_font (*wxNORMAL_FONT);
        version_font.SetWeight (wxFONTWEIGHT_BOLD);
 
-       wxStaticText* t = new wxStaticText (this, wxID_ANY, _("DCP-o-matic"));
+       wxStaticText* t = new StaticText (this, _("DCP-o-matic"));
        t->SetFont (title_font);
        sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16));
 
        wxString s;
        if (strcmp (dcpomatic_git_commit, "release") == 0) {
-               t = new wxStaticText (this, wxID_ANY, std_to_wx (String::compose ("Version %1", dcpomatic_version)));
+               t = new StaticText (this, std_to_wx(String::compose("Version %1", dcpomatic_version)));
        } else {
-               t = new wxStaticText (this, wxID_ANY, std_to_wx (String::compose ("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
+               t = new StaticText (this, std_to_wx(String::compose("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
        }
        t->SetFont (version_font);
        sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 2));
        sizer->AddSpacer (12);
 
-       t = new wxStaticText (
-               this, wxID_ANY,
+       t = new StaticText (
+               this,
                _("Free, open-source DCP creation from almost anything."),
                wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
                );
@@ -78,8 +79,8 @@ AboutDialog::AboutDialog (wxWindow* parent)
 
        sizer->Add (h, wxSizerFlags().Centre().Border(wxALL, 8));
 
-       t = new wxStaticText (
-               this, wxID_ANY,
+       t = new StaticText (
+               this,
                _("(C) 2012-2018 Carl Hetherington, Terrence Meiczinger\n Ole Laursen, Brecht Sanders"),
                wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER
                );
index 48540077e5584d4514abdb3b956f0eceb6d4bbaf..81687ca809942ecb00a67a209b71180ba94fda38 100644 (file)
@@ -21,6 +21,8 @@
 #include "audio_dialog.h"
 #include "audio_plot.h"
 #include "wx_util.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/audio_analysis.h"
 #include "lib/film.h"
 #include "lib/analyse_audio_job.h"
@@ -74,17 +76,17 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
 
        wxBoxSizer* left = new wxBoxSizer (wxVERTICAL);
 
-       _cursor = new wxStaticText (this, wxID_ANY, wxT("Cursor: none"));
+       _cursor = new StaticText (this, wxT("Cursor: none"));
        left->Add (_cursor, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
        _plot = new AudioPlot (this);
        left->Add (_plot, 1, wxTOP | wxEXPAND, 12);
-       _sample_peak = new wxStaticText (this, wxID_ANY, wxT (""));
+       _sample_peak = new StaticText (this, wxT (""));
        left->Add (_sample_peak, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
-       _true_peak = new wxStaticText (this, wxID_ANY, wxT (""));
+       _true_peak = new StaticText (this, wxT (""));
        left->Add (_true_peak, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
-       _integrated_loudness = new wxStaticText (this, wxID_ANY, wxT (""));
+       _integrated_loudness = new StaticText (this, wxT (""));
        left->Add (_integrated_loudness, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
-       _loudness_range = new wxStaticText (this, wxID_ANY, wxT (""));
+       _loudness_range = new StaticText (this, wxT (""));
        left->Add (_loudness_range, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
 
        lr_sizer->Add (left, 1, wxALL | wxEXPAND, 12);
@@ -92,13 +94,13 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
        wxBoxSizer* right = new wxBoxSizer (wxVERTICAL);
 
        {
-               wxStaticText* m = new wxStaticText (this, wxID_ANY, _("Channels"));
+               wxStaticText* m = new StaticText (this, _("Channels"));
                m->SetFont (subheading_font);
                right->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, 16);
        }
 
        for (int i = 0; i < _channels; ++i) {
-               _channel_checkbox[i] = new wxCheckBox (this, wxID_ANY, std_to_wx (audio_channel_name (i)));
+               _channel_checkbox[i] = new CheckBox (this, std_to_wx(audio_channel_name(i)));
                _channel_checkbox[i]->SetForegroundColour(wxColour(_plot->colour(i)));
                right->Add (_channel_checkbox[i], 0, wxEXPAND | wxALL, 3);
                _channel_checkbox[i]->Bind (wxEVT_CHECKBOX, boost::bind (&AudioDialog::channel_clicked, this, _1));
@@ -109,7 +111,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
        }
 
        {
-               wxStaticText* m = new wxStaticText (this, wxID_ANY, _("Type"));
+               wxStaticText* m = new StaticText (this, _("Type"));
                m->SetFont (subheading_font);
                right->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 16);
        }
@@ -120,13 +122,13 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
        };
 
        for (int i = 0; i < AudioPoint::COUNT; ++i) {
-               _type_checkbox[i] = new wxCheckBox (this, wxID_ANY, types[i]);
+               _type_checkbox[i] = new CheckBox (this, types[i]);
                right->Add (_type_checkbox[i], 0, wxEXPAND | wxALL, 3);
                _type_checkbox[i]->Bind (wxEVT_CHECKBOX, boost::bind (&AudioDialog::type_clicked, this, _1));
        }
 
        {
-               wxStaticText* m = new wxStaticText (this, wxID_ANY, _("Smoothing"));
+               wxStaticText* m = new StaticText (this, _("Smoothing"));
                m->SetFont (subheading_font);
                right->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 16);
        }
index 38504eacf15e1b6472dcd5be499c17fbcd552567..34292620b48a9d7561fca29cf0d47ec3bb3313fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -24,6 +24,8 @@
 #include "gain_calculator_dialog.h"
 #include "content_panel.h"
 #include "audio_dialog.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/config.h"
 #include "lib/ffmpeg_audio_stream.h"
 #include "lib/ffmpeg_content.h"
@@ -48,8 +50,8 @@ AudioPanel::AudioPanel (ContentPanel* p)
        : ContentSubPanel (p, _("Audio"))
        , _audio_dialog (0)
 {
-       _reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's audio as OV and make VF"));
-       _reference_note = new wxStaticText (this, wxID_ANY, wxT(""));
+       _reference = new CheckBox (this, _("Use this DCP's audio as OV and make VF"));
+       _reference_note = new StaticText (this, wxT(""));
        _reference_note->Wrap (200);
        wxFont font = _reference_note->GetFont();
        font.SetStyle(wxFONTSTYLE_ITALIC);
@@ -57,7 +59,7 @@ AudioPanel::AudioPanel (ContentPanel* p)
        _reference_note->SetFont(font);
 
        _show = new wxButton (this, wxID_ANY, _("Show graph of audio levels..."));
-       _peak = new wxStaticText (this, wxID_ANY, wxT (""));
+       _peak = new StaticText (this, wxT (""));
 
        _gain_label = create_label (this, _("Gain"), true);
        _gain = new ContentSpinCtrlDouble<AudioContent> (
@@ -88,7 +90,7 @@ AudioPanel::AudioPanel (ContentPanel* p)
        _mapping = new AudioMappingView (this);
        _sizer->Add (_mapping, 1, wxEXPAND | wxALL, 6);
 
-       _description = new wxStaticText (this, wxID_ANY, wxT (" \n"), wxDefaultPosition, wxDefaultSize);
+       _description = new StaticText (this, wxT(" \n"), wxDefaultPosition, wxDefaultSize);
        _sizer->Add (_description, 0, wxALL, 12);
        _description->SetFont (font);
 
diff --git a/src/wx/check_box.cc b/src/wx/check_box.cc
new file mode 100644 (file)
index 0000000..8f24f43
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "check_box.h"
+
+using std::cout;
+
+CheckBox::CheckBox (wxWindow* parent, wxString label)
+       : wxCheckBox (parent, wxID_ANY, label)
+       , I18NHook (this)
+{
+
+}
+
+void
+CheckBox::set_text (wxString text)
+{
+       SetLabel (text);
+}
+
+wxString
+CheckBox::get_text () const
+{
+       return GetLabel ();
+}
diff --git a/src/wx/check_box.h b/src/wx/check_box.h
new file mode 100644 (file)
index 0000000..ff47bc5
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef DCPOMATIC_CHECK_BOX_H
+#define DCPOMATIC_CHECK_BOX_H
+
+#include "i18n_hook.h"
+#include <wx/wx.h>
+
+class CheckBox : public wxCheckBox, public I18NHook
+{
+public:
+       CheckBox (wxWindow* parent, wxString label);
+
+       void set_text (wxString text);
+       wxString get_text () const;
+};
+
+#endif
index 3a1ffe0bf13df73233e1f8cb3edad4c805bfb10b..3c59dbeedc336178695562604e9ecd7774ddb5ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -19,7 +19,9 @@
 */
 
 #include "wx_util.h"
+#include "static_text.h"
 #include "colour_conversion_editor.h"
+#include "check_box.h"
 #include "lib/colour_conversion.h"
 #include <dcp/locale_convert.h>
 #include <dcp/gamma_transfer_function.h>
@@ -161,7 +163,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
        wxFlexGridSizer* rgb_to_xyz_sizer = new wxFlexGridSizer (3, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
        for (int i = 0; i < 3; ++i) {
                for (int j = 0; j < 3; ++j) {
-                       _rgb_to_xyz[i][j] = new wxStaticText (this, wxID_ANY, wxT (""), wxDefaultPosition, size, 0);
+                       _rgb_to_xyz[i][j] = new StaticText (this, wxT (""), wxDefaultPosition, size, 0);
                        rgb_to_xyz_sizer->Add (_rgb_to_xyz[i][j]);
                }
        }
@@ -174,7 +176,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
 
        subhead (table, this, _("White point adjustment"), r);
 
-       _adjust_white = new wxCheckBox (this, wxID_ANY, _("Adjust white point to"));
+       _adjust_white = new CheckBox (this, _("Adjust white point to"));
        table->Add (_adjust_white, wxGBPosition (r, 0));
        _adjusted_white_x = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, size, 0, validator);
        table->Add (_adjusted_white_x, wxGBPosition (r, 1));
@@ -191,7 +193,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
        wxFlexGridSizer* bradford_sizer = new wxFlexGridSizer (3, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
        for (int i = 0; i < 3; ++i) {
                for (int j = 0; j < 3; ++j) {
-                       _bradford[i][j] = new wxStaticText (this, wxID_ANY, wxT (""), wxDefaultPosition, size, 0);
+                       _bradford[i][j] = new StaticText (this, wxT (""), wxDefaultPosition, size, 0);
                        bradford_sizer->Add (_bradford[i][j]);
                }
        }
@@ -202,7 +204,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
 
        subhead (table, this, _("Output gamma correction"), r);
 
-       _output = new wxCheckBox (this, wxID_ANY, _("Inverse 2.6 gamma correction on output"));
+       _output = new CheckBox (this, _("Inverse 2.6 gamma correction on output"));
        table->Add (_output, wxGBPosition (r, 0), wxGBSpan (1, 2));
 
        _input_gamma->SetRange (0.1, 4.0);
@@ -236,7 +238,7 @@ ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
 wxStaticText *
 ColourConversionEditor::subhead (wxGridBagSizer* sizer, wxWindow* parent, wxString text, int& row) const
 {
-       wxStaticText* m = new wxStaticText (parent, wxID_ANY, text);
+       wxStaticText* m = new StaticText (parent, text);
        wxFont font (*wxNORMAL_FONT);
        font.SetWeight (wxFONTWEIGHT_BOLD);
        m->SetFont (font);
index 34bdee8b33693d699de5915414cd5a3b2b193ac9..1066a88b031ab5511e667329402459c492dc14c8 100644 (file)
@@ -19,6 +19,8 @@
 */
 
 #include "config_dialog.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "nag_dialog.h"
 
 using std::string;
@@ -112,7 +114,7 @@ GeneralPage::GeneralPage (wxSize panel_size, int border)
 void
 GeneralPage::add_language_controls (wxGridBagSizer* table, int& r)
 {
-       _set_language = new wxCheckBox (_panel, wxID_ANY, _("Set language"));
+       _set_language = new CheckBox (_panel, _("Set language"));
        table->Add (_set_language, wxGBPosition (r, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
        _language = new wxChoice (_panel, wxID_ANY);
        vector<pair<string, string> > languages;
@@ -152,7 +154,7 @@ GeneralPage::add_language_controls (wxGridBagSizer* table, int& r)
 void
 GeneralPage::add_play_sound_controls (wxGridBagSizer* table, int& r)
 {
-       _sound = new wxCheckBox (_panel, wxID_ANY, _("Play sound via"));
+       _sound = new CheckBox (_panel, _("Play sound via"));
        table->Add (_sound, wxGBPosition (r, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
        _sound_output = new wxChoice (_panel, wxID_ANY);
        table->Add (_sound_output, wxGBPosition (r, 1));
@@ -173,11 +175,11 @@ GeneralPage::add_play_sound_controls (wxGridBagSizer* table, int& r)
 void
 GeneralPage::add_update_controls (wxGridBagSizer* table, int& r)
 {
-       _check_for_updates = new wxCheckBox (_panel, wxID_ANY, _("Check for updates on startup"));
+       _check_for_updates = new CheckBox (_panel, _("Check for updates on startup"));
        table->Add (_check_for_updates, wxGBPosition (r, 0), wxGBSpan (1, 2));
        ++r;
 
-       _check_for_test_updates = new wxCheckBox (_panel, wxID_ANY, _("Check for testing updates on startup"));
+       _check_for_test_updates = new CheckBox (_panel, _("Check for testing updates on startup"));
        table->Add (_check_for_test_updates, wxGBPosition (r, 0), wxGBSpan (1, 2));
        ++r;
 
@@ -342,7 +344,7 @@ CertificateChainEditor::CertificateChainEditor (
        _sizer = new wxBoxSizer (wxVERTICAL);
 
        {
-               wxStaticText* m = new wxStaticText (this, wxID_ANY, title);
+               wxStaticText* m = new StaticText (this, title);
                m->SetFont (subheading_font);
                _sizer->Add (m, 0, wxALL, border);
        }
@@ -391,7 +393,7 @@ CertificateChainEditor::CertificateChainEditor (
        int r = 0;
 
        add_label_to_sizer (table, this, _("Leaf private key"), true, wxGBPosition (r, 0));
-       _private_key = new wxStaticText (this, wxID_ANY, wxT (""));
+       _private_key = new StaticText (this, wxT(""));
        wxFont font = _private_key->GetFont ();
        font.SetFamily (wxFONTFAMILY_TELETYPE);
        _private_key->SetFont (font);
@@ -408,7 +410,7 @@ CertificateChainEditor::CertificateChainEditor (
        table->Add (_button_sizer, wxGBPosition (r, 0), wxGBSpan (1, 4));
        ++r;
 
-       _private_key_bad = new wxStaticText (this, wxID_ANY, _("Leaf private key does not match leaf certificate!"));
+       _private_key_bad = new StaticText (this, _("Leaf private key does not match leaf certificate!"));
        font = *wxSMALL_FONT;
        font.SetWeight (wxFONTWEIGHT_BOLD);
        _private_key_bad->SetFont (font);
@@ -727,7 +729,7 @@ KeysPage::setup ()
        wxSizer* sizer = _panel->GetSizer();
 
        {
-               wxStaticText* m = new wxStaticText (_panel, wxID_ANY, _("Decrypting KDMs"));
+               wxStaticText* m = new StaticText (_panel, _("Decrypting KDMs"));
                m->SetFont (subheading_font);
                sizer->Add (m, 0, wxALL, _border);
        }
@@ -750,7 +752,7 @@ KeysPage::setup ()
        decryption_advanced->Bind (wxEVT_BUTTON, bind (&KeysPage::decryption_advanced, this));
 
        {
-               wxStaticText* m = new wxStaticText (_panel, wxID_ANY, _("Signing DCPs and KDMs"));
+               wxStaticText* m = new StaticText (_panel, _("Signing DCPs and KDMs"));
                m->SetFont (subheading_font);
                sizer->Add (m, 0, wxALL, _border);
        }
index ec677f6af50ddc13941e24fe55a2fb39ffcc4aad..baf55f18a9a0057c2a1b57f83ce23ed109073c7d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2017-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "config_move_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
 #include <boost/filesystem.hpp>
 
 ConfigMoveDialog::ConfigMoveDialog (wxWindow* parent, boost::filesystem::path new_file)
@@ -35,7 +36,7 @@ ConfigMoveDialog::ConfigMoveDialog (wxWindow* parent, boost::filesystem::path ne
                std_to_wx(new_file.string()).data()
                );
 
-       _sizer->Add (new wxStaticText (this, wxID_ANY, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
+       _sizer->Add (new StaticText (this, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
        layout ();
 }
index 4815f26dbd8749619a4c1d72d15d9528fe6da24f..eca34b5cfb1ff5901bcac03590ae78b74821d3ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,8 @@
 
 #include "confirm_kdm_email_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/config.h"
 #include "lib/cinema_kdms.h"
 #include <boost/foreach.hpp>
@@ -35,9 +37,9 @@ ConfirmKDMEmailDialog::ConfirmKDMEmailDialog (wxWindow* parent, list<string> ema
                message += "\t" + std_to_wx (i) + "\n";
        }
 
-       _sizer->Add (new wxStaticText (this, wxID_ANY, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
+       _sizer->Add (new StaticText (this, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
-       wxCheckBox* shut_up = new wxCheckBox (this, wxID_ANY, _("Don't ask this again"));
+       wxCheckBox* shut_up = new CheckBox (this, _("Don't ask this again"));
        _sizer->Add (shut_up, 0, wxALL, DCPOMATIC_DIALOG_BORDER);
 
        shut_up->Bind (wxEVT_CHECKBOX, bind (&ConfirmKDMEmailDialog::shut_up, this, _1));
index 100d766f2d50a91579a77604898529645d365a20..351d5aa65db086689df835820798eaf78941ee11 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include "lib/colour_conversion.h"
-#include "lib/config.h"
-#include "lib/util.h"
 #include "wx_util.h"
+#include "check_box.h"
 #include "content_colour_conversion_dialog.h"
 #include "colour_conversion_editor.h"
+#include "lib/colour_conversion.h"
+#include "lib/config.h"
+#include "lib/util.h"
 #include <wx/statline.h>
 #include <boost/foreach.hpp>
 #include <iostream>
@@ -42,7 +43,7 @@ ContentColourConversionDialog::ContentColourConversionDialog (wxWindow* parent,
        SetSizer (overall_sizer);
 
        wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_Y_GAP - 2, DCPOMATIC_SIZER_X_GAP);
-       _preset_check = new wxCheckBox (this, wxID_ANY, _("Use preset"));
+       _preset_check = new CheckBox (this, _("Use preset"));
        table->Add (_preset_check, 0, wxALIGN_CENTER_VERTICAL);
        _preset_choice = new wxChoice (this, wxID_ANY);
        table->Add (_preset_choice);
index 2f4e1a48bcadf6f0bbf242e717b30a6313d9b6c2..efc0e6ef15ae9069182ba0a45a6ac26860a1df17 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "content_properties_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
 #include "lib/content.h"
 #include "lib/video_content.h"
 #include "lib/audio_content.h"
@@ -80,7 +81,7 @@ ContentPropertiesDialog::maybe_add_group (map<UserProperty::Category, list<UserP
                break;
        }
 
-       wxStaticText* m = new wxStaticText (this, wxID_ANY, category_name);
+       wxStaticText* m = new StaticText (this, category_name);
        wxFont font (*wxNORMAL_FONT);
        font.SetWeight (wxFONTWEIGHT_BOLD);
        m->SetFont (font);
@@ -92,6 +93,6 @@ ContentPropertiesDialog::maybe_add_group (map<UserProperty::Category, list<UserP
 
        BOOST_FOREACH (UserProperty j, i->second) {
                add (std_to_wx (j.key), true);
-               add (new wxStaticText (this, wxID_ANY, std_to_wx (j.value + " " + j.unit)));
+               add (new StaticText (this, std_to_wx (j.value + " " + j.unit)));
        }
 }
index dd47aa184695c3a31c6a64a4b4f4823950178ada..08d3a946009e1ccc7ed59acc3a36917fe42c7532 100644 (file)
@@ -24,6 +24,8 @@
 #include "playhead_to_timecode_dialog.h"
 #include "playhead_to_frame_dialog.h"
 #include "content_view.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/job_manager.h"
 #include "lib/player_video.h"
 #include "lib/dcp_content.h"
@@ -62,22 +64,22 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
        , _rewind_button (new wxButton (this, wxID_ANY, wxT("|<")))
        , _back_button (new wxButton (this, wxID_ANY, wxT("<")))
        , _forward_button (new wxButton (this, wxID_ANY, wxT(">")))
-       , _frame_number (new wxStaticText (this, wxID_ANY, wxT("")))
-       , _timecode (new wxStaticText (this, wxID_ANY, wxT("")))
+       , _frame_number (new StaticText (this, wxT("")))
+       , _timecode (new StaticText (this, wxT("")))
 {
        _v_sizer = new wxBoxSizer (wxVERTICAL);
        SetSizer (_v_sizer);
 
        wxBoxSizer* view_options = new wxBoxSizer (wxHORIZONTAL);
        if (editor_controls) {
-               _outline_content = new wxCheckBox (this, wxID_ANY, _("Outline content"));
+               _outline_content = new CheckBox (this, _("Outline content"));
                view_options->Add (_outline_content, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
                _eye = new wxChoice (this, wxID_ANY);
                _eye->Append (_("Left"));
                _eye->Append (_("Right"));
                _eye->SetSelection (0);
                view_options->Add (_eye, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
-               _jump_to_selected = new wxCheckBox (this, wxID_ANY, _("Jump to selected content"));
+               _jump_to_selected = new CheckBox (this, _("Jump to selected content"));
                view_options->Add (_jump_to_selected, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
        }
 
index 2ace7219026d525263d70cb277f8d8949870977e..ded073152e40e1a14fe9e4e66729f82a16d4e33c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -24,6 +24,9 @@
 #include "isdcf_metadata_dialog.h"
 #include "audio_dialog.h"
 #include "focus_manager.h"
+#include "check_box.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/ratio.h"
 #include "lib/config.h"
 #include "lib/dcp_content_type.h"
@@ -72,30 +75,30 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
        _name = new wxTextCtrl (_panel, wxID_ANY);
        FocusManager::instance()->add(_name);
 
-       _use_isdcf_name = new wxCheckBox (_panel, wxID_ANY, _("Use ISDCF name"));
+       _use_isdcf_name = new CheckBox (_panel, _("Use ISDCF name"));
        _edit_isdcf_button = new wxButton (_panel, wxID_ANY, _("Details..."));
        _copy_isdcf_name_button = new wxButton (_panel, wxID_ANY, _("Copy as name"));
 
        /* wxST_ELLIPSIZE_MIDDLE works around a bug in GTK2 and/or wxWidgets, see
           http://trac.wxwidgets.org/ticket/12539
        */
-       _dcp_name = new wxStaticText (
-               _panel, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize,
+       _dcp_name = new StaticText (
+               _panel, wxT (""), wxDefaultPosition, wxDefaultSize,
                wxALIGN_CENTRE_HORIZONTAL | wxST_NO_AUTORESIZE | wxST_ELLIPSIZE_MIDDLE
                );
 
        _dcp_content_type_label = create_label (_panel, _("Content Type"), true);
        _dcp_content_type = new wxChoice (_panel, wxID_ANY);
 
-       _signed = new wxCheckBox (_panel, wxID_ANY, _("Signed"));
-       _encrypted = new wxCheckBox (_panel, wxID_ANY, _("Encrypted"));
+       _signed = new CheckBox (_panel, _("Signed"));
+       _encrypted = new CheckBox (_panel, _("Encrypted"));
 
         wxClientDC dc (_panel);
         wxSize size = dc.GetTextExtent (wxT ("GGGGGGGG..."));
         size.SetHeight (-1);
 
        _key_label = create_label (_panel, _("Key"), true);
-       _key = new wxStaticText (_panel, wxID_ANY, "", wxDefaultPosition, size);
+       _key = new StaticText (_panel, "", wxDefaultPosition, size);
        _edit_key = new wxButton (_panel, wxID_ANY, _("Edit..."));
 
        _reels_label = create_label (_panel, _("Reels"), true);
@@ -108,7 +111,7 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
        _standard_label = create_label (_panel, _("Standard"), true);
        _standard = new wxChoice (_panel, wxID_ANY);
 
-       _upload_after_make_dcp = new wxCheckBox (_panel, wxID_ANY, _("Upload DCP to TMS after it is made"));
+       _upload_after_make_dcp = new CheckBox (_panel, _("Upload DCP to TMS after it is made"));
 
        _notebook = new wxNotebook (_panel, wxID_ANY);
        _sizer->Add (_notebook, 1, wxEXPAND | wxTOP, 6);
@@ -733,7 +736,7 @@ DCPPanel::make_video_panel ()
 
        _container_label = create_label (panel, _("Container"), true);
        _container = new wxChoice (panel, wxID_ANY);
-       _container_size = new wxStaticText (panel, wxID_ANY, wxT (""));
+       _container_size = new StaticText (panel, wxT (""));
 
        _resolution_label = create_label (panel, _("Resolution"), true);
        _resolution = new wxChoice (panel, wxID_ANY);
@@ -748,13 +751,13 @@ DCPPanel::make_video_panel ()
        _best_frame_rate = new wxButton (panel, wxID_ANY, _("Use best"));
        _frame_rate_sizer->Add (_best_frame_rate, 1, wxALIGN_CENTER_VERTICAL);
 
-       _three_d = new wxCheckBox (panel, wxID_ANY, _("3D"));
+       _three_d = new CheckBox (panel, _("3D"));
 
        _j2k_bandwidth_label = create_label (panel, _("JPEG2000 bandwidth\nfor newly-encoded data"), true);
        _j2k_bandwidth = new wxSpinCtrl (panel, wxID_ANY);
        _mbits_label = create_label (panel, _("Mbit/s"), false);
 
-       _reencode_j2k = new wxCheckBox (panel, wxID_ANY, _("Re-encode JPEG2000 data from input"));
+       _reencode_j2k = new CheckBox (panel, _("Re-encode JPEG2000 data from input"));
 
        _container->Bind         (wxEVT_CHOICE,   boost::bind(&DCPPanel::container_changed, this));
        _frame_rate_choice->Bind (wxEVT_CHOICE,   boost::bind(&DCPPanel::frame_rate_choice_changed, this));
index 2330e584a5ea90748ac682a8367cdb1041bdd055..ffd3b6fa115a116b63d6c352c1c7d29d2c5487b0 100644 (file)
 
 */
 
+#include "dir_picker_ctrl.h"
+#include "wx_util.h"
+#include "static_text.h"
 #include <wx/wx.h>
 #include <wx/stdpaths.h>
 #include <wx/filepicker.h>
 #include <boost/filesystem.hpp>
-#include "dir_picker_ctrl.h"
-#include "wx_util.h"
 
 using namespace std;
 using namespace boost;
@@ -33,7 +34,7 @@ DirPickerCtrl::DirPickerCtrl (wxWindow* parent)
 {
        _sizer = new wxBoxSizer (wxHORIZONTAL);
 
-       _folder = new wxStaticText (this, wxID_ANY, wxT (""));
+       _folder = new StaticText (this, wxT(""));
        _sizer->Add (_folder, 1, wxEXPAND | wxALL, 6);
        _browse = new wxButton (this, wxID_ANY, _("Browse..."));
        _sizer->Add (_browse, 0);
index a1209700166524051984049ced10917ff475f211..21a675ac70c0b74ae7d886d4e9c2a2d7ccd86470 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -23,6 +23,7 @@
 #include "christie_certificate_panel.h"
 #include "gdc_certificate_panel.h"
 #include "download_certificate_dialog.h"
+#include "static_text.h"
 #include "wx_util.h"
 
 using boost::optional;
@@ -38,7 +39,7 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
        _download = new wxButton (this, wxID_ANY, _("Download"));
        sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
 
-       _message = new wxStaticText (this, wxID_ANY, wxT (""));
+       _message = new StaticText (this, wxT (""));
        sizer->Add (_message, 0, wxALL, DCPOMATIC_SIZER_GAP);
        wxFont font = _message->GetFont();
        font.SetStyle (wxFONTSTYLE_ITALIC);
index 3c08da1b75d42979f80a6fe518290cf14218cc35..68d3706ff7f4b48725535da50951555964348551 100644 (file)
@@ -21,6 +21,7 @@
 #include "export_dialog.h"
 #include "file_picker_ctrl.h"
 #include "wx_util.h"
+#include "check_box.h"
 #include <wx/filepicker.h>
 #include <boost/bind.hpp>
 
@@ -55,10 +56,10 @@ ExportDialog::ExportDialog (wxWindow* parent)
        _format = new wxChoice (this, wxID_ANY);
        add (_format);
        add_spacer ();
-       _mixdown = new wxCheckBox (this, wxID_ANY, _("Mix audio down to stereo"));
+       _mixdown = new CheckBox (this, _("Mix audio down to stereo"));
        add (_mixdown, false);
        add_spacer ();
-       _split_reels = new wxCheckBox (this, wxID_ANY, _("Write reels into separate files"));
+       _split_reels = new CheckBox (this, _("Write reels into separate files"));
        add (_split_reels, false);
        _x264_crf_label[0] = add (_("Quality"), true);
        _x264_crf = new wxSlider (this, wxID_ANY, 23, 0, 51, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
index d91171acb52799e7699c7793fa8244a253ec452e..0cc406d022168b9d430ec7368ae9bd7fac1b41e2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "wx_util.h"
 #include "film_name_location_dialog.h"
+#include "check_box.h"
 #ifdef DCPOMATIC_USE_OWN_PICKER
 #include "dir_picker_ctrl.h"
 #endif
@@ -56,7 +57,7 @@ FilmNameLocationDialog::FilmNameLocationDialog (wxWindow* parent, wxString title
        add (_folder);
 
        if (offer_templates) {
-               _use_template = new wxCheckBox (this, wxID_ANY, _("From template"));
+               _use_template = new CheckBox (this, _("From template"));
                add (_use_template);
                _template_name = new wxChoice (this, wxID_ANY);
                add (_template_name);
index d70402b5f68c2aaf94ef597b9d9a234215c112f5..32faee35dcfdaa66d11c35fe3ddccf86f512b4b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
  *  @brief A panel to select FFmpeg filters.
  */
 
-#include <iostream>
-#include <algorithm>
-#include "lib/filter.h"
 #include "filter_editor.h"
 #include "wx_util.h"
+#include "static_text.h"
+#include "check_box.h"
+#include "lib/filter.h"
+#include <iostream>
+#include <algorithm>
 
 using namespace std;
 
@@ -54,14 +56,14 @@ FilterEditor::FilterEditor (wxWindow* parent, vector<Filter const *> const & act
 
        for (CategoryMap::iterator i = categories.begin(); i != categories.end(); ++i) {
 
-               wxStaticText* c = new wxStaticText (this, wxID_ANY, std_to_wx (i->first));
+               wxStaticText* c = new StaticText (this, std_to_wx(i->first));
                wxFont font = c->GetFont();
                font.SetWeight(wxFONTWEIGHT_BOLD);
                c->SetFont(font);
                sizer->Add (c);
 
                for (list<Filter const *>::iterator j = i->second.begin(); j != i->second.end(); ++j) {
-                       wxCheckBox* b = new wxCheckBox (this, wxID_ANY, std_to_wx ((*j)->name ()));
+                       wxCheckBox* b = new CheckBox (this, std_to_wx ((*j)->name ()));
                        bool const a = find (active.begin(), active.end(), *j) != active.end ();
                        b->SetValue (a);
                        _filters[*j] = b;
index 0c64492d538542d371002c7e9cd1a03402567714..7fd4f9d99aeda678bd4b75a010ab2040a90f7741 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "font_files_dialog.h"
 #include "system_font_dialog.h"
+#include "static_text.h"
 
 using boost::bind;
 
@@ -41,8 +42,8 @@ FontFilesDialog::FontFilesDialog (wxWindow* parent, FontFiles files)
 
        for (int i = 0; i < FontFiles::VARIANTS; ++i) {
                add (labels[i], true);
-               _name[i] = new wxStaticText (
-                       this, wxID_ANY,
+               _name[i] = new StaticText (
+                       this,
                        std_to_wx(_files.get(static_cast<FontFiles::Variant>(i)).get_value_or("").string()),
                        wxDefaultPosition,
                        wxSize (200, -1)
index 96a4c86e9b00d164578a799a8290704f808bc1db..8e176b4d6fa319c92aa311357b7947c8864777f5 100644 (file)
@@ -36,6 +36,8 @@
 #include "nag_dialog.h"
 #include "config_move_dialog.h"
 #include "config_dialog.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/config.h"
 #include "lib/ratio.h"
 #include "lib/filter.h"
@@ -115,12 +117,12 @@ private:
                add_play_sound_controls (table, r);
 
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
-               _analyse_ebur128 = new wxCheckBox (_panel, wxID_ANY, _("Find integrated loudness, true peak and loudness range when analysing audio"));
+               _analyse_ebur128 = new CheckBox (_panel, _("Find integrated loudness, true peak and loudness range when analysing audio"));
                table->Add (_analyse_ebur128, wxGBPosition (r, 0), wxGBSpan (1, 2));
                ++r;
 #endif
 
-               _automatic_audio_analysis = new wxCheckBox (_panel, wxID_ANY, _("Automatically analyse content audio"));
+               _automatic_audio_analysis = new CheckBox (_panel, _("Automatically analyse content audio"));
                table->Add (_automatic_audio_analysis, wxGBPosition (r, 0), wxGBSpan (1, 2));
                ++r;
 
@@ -381,7 +383,7 @@ private:
 
                table->Add (_kdm_directory, 1, wxEXPAND);
 
-               _upload_after_make_dcp = new wxCheckBox (_panel, wxID_ANY, _("Default to enabling upload of DCP to TMS"));
+               _upload_after_make_dcp = new CheckBox (_panel, _("Default to enabling upload of DCP to TMS"));
                table->Add (_upload_after_make_dcp, 1, wxEXPAND);
 
                _still_length->SetRange (1, 3600);
@@ -585,7 +587,7 @@ public:
 private:
        void setup ()
        {
-               _use_any_servers = new wxCheckBox (_panel, wxID_ANY, _("Search network for servers"));
+               _use_any_servers = new CheckBox (_panel, _("Search network for servers"));
                _panel->GetSizer()->Add (_use_any_servers, 0, wxALL, _border);
 
                vector<string> columns;
@@ -1073,11 +1075,11 @@ private:
                table->AddGrowableCol (1, 1);
                _panel->GetSizer()->Add (table, 1, wxEXPAND | wxALL, _border);
 
-               _enable_message_box = new wxCheckBox (_panel, wxID_ANY, _("Message box"));
+               _enable_message_box = new CheckBox (_panel, _("Message box"));
                table->Add (_enable_message_box, 1, wxEXPAND | wxALL);
                table->AddSpacer (0);
 
-               _enable_email = new wxCheckBox (_panel, wxID_ANY, _("Email"));
+               _enable_email = new CheckBox (_panel, _("Email"));
                table->Add (_enable_email, 1, wxEXPAND | wxALL);
                table->AddSpacer (0);
 
@@ -1306,7 +1308,7 @@ private:
                flags |= wxALIGN_RIGHT;
                text += wxT (":");
 #endif
-               wxStaticText* m = new wxStaticText (parent, wxID_ANY, text);
+               wxStaticText* m = new StaticText (parent, text);
                table->Add (m, 0, flags, DCPOMATIC_SIZER_Y_GAP);
        }
 
@@ -1325,11 +1327,11 @@ private:
                        table->Add (s, 1);
                }
 
-               _allow_any_dcp_frame_rate = new wxCheckBox (_panel, wxID_ANY, _("Allow any DCP frame rate"));
+               _allow_any_dcp_frame_rate = new CheckBox (_panel, _("Allow any DCP frame rate"));
                table->Add (_allow_any_dcp_frame_rate, 1, wxEXPAND | wxALL);
                table->AddSpacer (0);
 
-               _allow_any_container = new wxCheckBox (_panel, wxID_ANY, _("Allow non-standard container ratios"));
+               _allow_any_container = new CheckBox (_panel, _("Allow non-standard container ratios"));
                table->Add (_allow_any_container, 1, wxEXPAND | wxALL);
                table->AddSpacer (0);
 
@@ -1340,7 +1342,7 @@ private:
                restart->SetFont (font);
                table->AddSpacer (0);
 
-               _only_servers_encode = new wxCheckBox (_panel, wxID_ANY, _("Only servers encode"));
+               _only_servers_encode = new CheckBox (_panel, _("Only servers encode"));
                table->Add (_only_servers_encode, 1, wxEXPAND | wxALL);
                table->AddSpacer (0);
 
@@ -1385,26 +1387,26 @@ private:
                {
                        add_top_aligned_label_to_sizer (table, _panel, _("Log"));
                        wxBoxSizer* t = new wxBoxSizer (wxVERTICAL);
-                       _log_general = new wxCheckBox (_panel, wxID_ANY, _("General"));
+                       _log_general = new CheckBox (_panel, _("General"));
                        t->Add (_log_general, 1, wxEXPAND | wxALL);
-                       _log_warning = new wxCheckBox (_panel, wxID_ANY, _("Warnings"));
+                       _log_warning = new CheckBox (_panel, _("Warnings"));
                        t->Add (_log_warning, 1, wxEXPAND | wxALL);
-                       _log_error = new wxCheckBox (_panel, wxID_ANY, _("Errors"));
+                       _log_error = new CheckBox (_panel, _("Errors"));
                        t->Add (_log_error, 1, wxEXPAND | wxALL);
                        /// TRANSLATORS: translate the word "Timing" here; do not include the "Config|" prefix
-                       _log_timing = new wxCheckBox (_panel, wxID_ANY, S_("Config|Timing"));
+                       _log_timing = new CheckBox (_panel, S_("Config|Timing"));
                        t->Add (_log_timing, 1, wxEXPAND | wxALL);
-                       _log_debug_decode = new wxCheckBox (_panel, wxID_ANY, _("Debug: decode"));
+                       _log_debug_decode = new CheckBox (_panel, _("Debug: decode"));
                        t->Add (_log_debug_decode, 1, wxEXPAND | wxALL);
-                       _log_debug_encode = new wxCheckBox (_panel, wxID_ANY, _("Debug: encode"));
+                       _log_debug_encode = new CheckBox (_panel, _("Debug: encode"));
                        t->Add (_log_debug_encode, 1, wxEXPAND | wxALL);
-                       _log_debug_email = new wxCheckBox (_panel, wxID_ANY, _("Debug: email sending"));
+                       _log_debug_email = new CheckBox (_panel, _("Debug: email sending"));
                        t->Add (_log_debug_email, 1, wxEXPAND | wxALL);
                        table->Add (t, 0, wxALL, 6);
                }
 
 #ifdef DCPOMATIC_WINDOWS
-               _win32_console = new wxCheckBox (_panel, wxID_ANY, _("Open console window"));
+               _win32_console = new CheckBox (_panel, _("Open console window"));
                table->Add (_win32_console, 1, wxEXPAND | wxALL);
                table->AddSpacer (0);
 #endif
index cbd48ec36c3b60fdfd51c2d4d45ba7ffd887c8af..099b31327f8a6d7ab46c068aad5e1c0c2c3b3ee3 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "hints_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/film.h"
 #include "lib/hints.h"
 #include "lib/config.h"
@@ -44,14 +46,14 @@ HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film, bool ok)
 
        _gauge = new wxGauge (this, wxID_ANY, 100);
        sizer->Add (_gauge, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
-       _gauge_message = new wxStaticText (this, wxID_ANY, wxT(""));
+       _gauge_message = new StaticText (this, wxT(""));
        sizer->Add (_gauge_message, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
 
        _text = new wxRichTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (400, 300), wxRE_READONLY);
        sizer->Add (_text, 1, wxEXPAND | wxALL, 6);
 
        if (!ok) {
-               wxCheckBox* b = new wxCheckBox (this, wxID_ANY, _("Don't show hints again"));
+               wxCheckBox* b = new CheckBox (this, _("Don't show hints again"));
                sizer->Add (b, 0, wxALL, 6);
                b->Bind (wxEVT_CHECKBOX, bind (&HintsDialog::shut_up, this, _1));
        }
diff --git a/src/wx/i18n_hook.cc b/src/wx/i18n_hook.cc
new file mode 100644 (file)
index 0000000..bb18552
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "i18n_hook.h"
+#include "instant_i18n_dialog.h"
+#include "wx_util.h"
+#include "lib/cross.h"
+#include <wx/wx.h>
+#include <boost/bind.hpp>
+#include <boost/filesystem.hpp>
+
+I18NHook::I18NHook (wxWindow* window)
+       : _window (window)
+{
+       _window->Bind (wxEVT_MIDDLE_DOWN, bind(&I18NHook::handle, this, _1));
+}
+
+void
+I18NHook::handle (wxMouseEvent& ev)
+{
+       wxString const original = get_text ();
+
+       InstantI18NDialog* d = new InstantI18NDialog (_window, get_text());
+       d->ShowModal();
+       set_text (d->get());
+       _window->GetContainingSizer()->Layout();
+       ev.Skip ();
+
+       boost::filesystem::path file = "instant_i18n";
+
+       FILE* f = fopen_boost (file, "a");
+       if (!f) {
+               error_dialog (_window, wxString::Format(_("Could not open translation file %s"), std_to_wx(file.string()).data()));
+               return;
+       }
+       fprintf (f, "%s\n", wx_to_std(original).c_str());
+       fprintf (f, "%s\n", wx_to_std(get_text()).c_str());
+       fclose (f);
+}
diff --git a/src/wx/i18n_hook.h b/src/wx/i18n_hook.h
new file mode 100644 (file)
index 0000000..9462e3f
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef DCPOMATIC_I18N_HOOK_H
+#define DCPOMATIC_I18N_HOOK_H
+
+#include <wx/wx.h>
+
+class I18NHook
+{
+public:
+       I18NHook (wxWindow* window);
+
+       virtual void set_text (wxString text) = 0;
+       virtual wxString get_text () const = 0;
+
+private:
+       void handle (wxMouseEvent &);
+
+       wxWindow* _window;
+};
+
+#endif
index ac6f918a0591b4c9b4f0a020ba144a4b3450cd8c..0d04c5002f8259a22f9b871c8d3016a787a72280 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "initial_setup_dialog.h"
+#include "static_text.h"
 #include "lib/config.h"
 #include <boost/bind.hpp>
 
@@ -26,7 +27,7 @@ InitialSetupDialog::InitialSetupDialog ()
        : wxDialog (0, wxID_ANY, _("DCP-o-matic setup"))
 {
        wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
-       wxStaticText* text1 = new wxStaticText (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(600, -1));
+       wxStaticText* text1 = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(600, -1));
        sizer->Add (text1, 1, wxEXPAND | wxALL, 12);
 
        text1->SetLabelMarkup (
@@ -55,7 +56,7 @@ InitialSetupDialog::InitialSetupDialog ()
                _full->SetValue (true);
        }
 
-       wxStaticText* text2 = new wxStaticText (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(400, -1));
+       wxStaticText* text2 = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(400, -1));
        sizer->Add (text2, 0, wxEXPAND | wxALL, 12);
 
        text2->SetLabelMarkup (_("\nYou can change the mode at any time from the General page of Preferences."));
diff --git a/src/wx/instant_i18n_dialog.cc b/src/wx/instant_i18n_dialog.cc
new file mode 100644 (file)
index 0000000..e86e48c
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "instant_i18n_dialog.h"
+#include "wx_util.h"
+#include <boost/bind.hpp>
+
+using boost::bind;
+
+InstantI18NDialog::InstantI18NDialog (wxWindow* parent, wxString text)
+       : wxDialog (parent, wxID_ANY, _("Translate"))
+{
+       wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+
+       _text = new wxTextCtrl (this, wxID_ANY, text, wxDefaultPosition, wxSize(200, -1), wxTE_PROCESS_ENTER);
+
+       _text->Bind (wxEVT_TEXT_ENTER, bind(&InstantI18NDialog::close, this));
+
+       overall_sizer->Add (_text, 0, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
+       SetSizerAndFit (overall_sizer);
+}
+
+wxString
+InstantI18NDialog::get () const
+{
+       return _text->GetValue ();
+}
+
+void
+InstantI18NDialog::close ()
+{
+       Close ();
+}
diff --git a/src/wx/instant_i18n_dialog.h b/src/wx/instant_i18n_dialog.h
new file mode 100644 (file)
index 0000000..f9fe96d
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <wx/wx.h>
+
+class InstantI18NDialog : public wxDialog
+{
+public:
+       InstantI18NDialog (wxWindow* parent, wxString text);
+
+       wxString get () const;
+
+private:
+       void close ();
+
+       wxTextCtrl* _text;
+};
index ee7d4ae70c82309b587723d6cae1c331fa3ffabe..297f54fa1316aad8560e9027b3b938daae2e4310 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "isdcf_metadata_dialog.h"
 #include "wx_util.h"
+#include "check_box.h"
 #include "lib/film.h"
 #include <wx/wx.h>
 #include <wx/sizer.h>
@@ -55,19 +56,19 @@ ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bo
        add (_("Facility (e.g. DLA)"), true);
        _facility = add (new wxTextCtrl (this, wxID_ANY));
 
-       _temp_version = add (new wxCheckBox (this, wxID_ANY, _("Temp version")));
+       _temp_version = add (new CheckBox(this, _("Temp version")));
        add_spacer ();
 
-       _pre_release = add (new wxCheckBox (this, wxID_ANY, _("Pre-release")));
+       _pre_release = add (new CheckBox(this, _("Pre-release")));
        add_spacer ();
 
-       _red_band = add (new wxCheckBox (this, wxID_ANY, _("Red band")));
+       _red_band = add (new CheckBox(this, _("Red band")));
        add_spacer ();
 
        add (_("Chain"), true);
        _chain = add (new wxTextCtrl (this, wxID_ANY));
 
-       _two_d_version_of_three_d = add (new wxCheckBox (this, wxID_ANY, _("2D version of content available in 3D")));
+       _two_d_version_of_three_d = add (new CheckBox(this, _("2D version of content available in 3D")));
        add_spacer ();
 
        if (threed) {
index 5d3cc0f9cf74ad2c0eabb5ea2824d268168f9fa1..28b171b825371ed686d3a8c0a9c760d5da5d2d2d 100644 (file)
@@ -21,6 +21,8 @@
 #include "job_view.h"
 #include "wx_util.h"
 #include "message_dialog.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/job.h"
 #include "lib/job_manager.h"
 #include "lib/compose.hpp"
@@ -56,7 +58,7 @@ JobView::setup ()
        /* This seems to be required to allow the gauge to shrink under OS X */
        _gauge->SetMinSize (wxSize (0, -1));
        _gauge_message->Add (_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT);
-       _message = new wxStaticText (_container, wxID_ANY, wxT (" \n "), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_MIDDLE);
+       _message = new StaticText (_container, wxT(" \n "), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_MIDDLE);
        _gauge_message->Add (_message, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
        _table->Insert (n, _gauge_message, 1, wxEXPAND | wxLEFT | wxRIGHT);
        ++n;
@@ -76,7 +78,7 @@ JobView::setup ()
 
        _controls = new wxBoxSizer (wxVERTICAL);
        _controls->Add (_buttons);
-       _notify = new wxCheckBox (_container, wxID_ANY, _("Notify when complete"));
+       _notify = new CheckBox (_container, _("Notify when complete"));
        _notify->Bind (wxEVT_CHECKBOX, bind (&JobView::notify_clicked, this));
        _notify->SetValue (Config::instance()->default_notify());
        _controls->Add (_notify);
index 9c35f506a0874b88a9d6b3b63db212f959c2c3df..2027c06392efa247bd0c665b490a8f3e798870bb 100644 (file)
 */
 
 #include "kdm_advanced_dialog.h"
+#include "check_box.h"
 
 KDMAdvancedDialog::KDMAdvancedDialog (wxWindow* parent, bool forensic_mark_video, bool forensic_mark_audio)
        : TableDialog (parent, _("Advanced KDM options"), 2, 1, false)
 {
-       _forensic_mark_video = new wxCheckBox (this, wxID_ANY, _("Forensically mark video"));
+       _forensic_mark_video = new CheckBox (this, _("Forensically mark video"));
        _forensic_mark_video->SetValue (forensic_mark_video);
        add (_forensic_mark_video);
        add_spacer ();
-       _forensic_mark_audio = new wxCheckBox (this, wxID_ANY, _("Forensically mark audio"));
+       _forensic_mark_audio = new CheckBox (this, _("Forensically mark audio"));
        _forensic_mark_audio->SetValue (forensic_mark_audio);
        add (_forensic_mark_audio);
        add_spacer ();
index e14511ad8a45c94f7a7118c8be6b6c37175f0587..d710d88aaef571aa3d4d24501faafb6ce1747283 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "kdm_cpl_panel.h"
 #include "wx_util.h"
+#include "static_text.h"
 #include <libcxml/cxml.h>
 
 using std::vector;
@@ -42,13 +43,13 @@ KDMCPLPanel::KDMCPLPanel (wxWindow* parent, vector<CPLSummary> cpls)
        /* CPL details */
        wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
        add_label_to_sizer (table, this, _("DCP directory"), true);
-       _dcp_directory = new wxStaticText (this, wxID_ANY, "");
+       _dcp_directory = new StaticText (this, "");
        table->Add (_dcp_directory);
        add_label_to_sizer (table, this, _("CPL ID"), true);
-       _cpl_id = new wxStaticText (this, wxID_ANY, "");
+       _cpl_id = new StaticText (this, "");
        table->Add (_cpl_id);
        add_label_to_sizer (table, this, _("CPL annotation text"), true);
-       _cpl_annotation_text = new wxStaticText (this, wxID_ANY, "");
+       _cpl_annotation_text = new StaticText (this, "");
        table->Add (_cpl_annotation_text);
        vertical->Add (table, 0, wxEXPAND | wxTOP, DCPOMATIC_SIZER_GAP + 2);
 
index abb28c22876e441ea549eb3ea1c2c3c671fda7b9..f59250750bc590734c13efc4e93b11cfb3d30ee4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -25,6 +25,7 @@
 #include "kdm_output_panel.h"
 #include "kdm_cpl_panel.h"
 #include "confirm_kdm_email_dialog.h"
+#include "static_text.h"
 #include "lib/film.h"
 #include "lib/screen.h"
 #include "lib/screen_kdm.h"
@@ -68,7 +69,7 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
 
        /* Sub-heading: Screens */
-       wxStaticText* h = new wxStaticText (this, wxID_ANY, _("Screens"));
+       wxStaticText* h = new StaticText (this, _("Screens"));
        h->SetFont (subheading_font);
        left->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM, DCPOMATIC_SIZER_Y_GAP);
        _screens = new ScreensPanel (this);
@@ -76,21 +77,21 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr<const Film> film)
 
        /* Sub-heading: Timing */
        /// TRANSLATORS: translate the word "Timing" here; do not include the "KDM|" prefix
-       h = new wxStaticText (this, wxID_ANY, S_("KDM|Timing"));
+       h = new StaticText (this, S_("KDM|Timing"));
        h->SetFont (subheading_font);
        right->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2);
        _timing = new KDMTimingPanel (this);
        right->Add (_timing);
 
        /* Sub-heading: CPL */
-       h = new wxStaticText (this, wxID_ANY, _("CPL"));
+       h = new StaticText (this, _("CPL"));
        h->SetFont (subheading_font);
        right->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2);
        _cpl = new KDMCPLPanel (this, film->cpls ());
        right->Add (_cpl, 0, wxEXPAND);
 
        /* Sub-heading: Output */
-       h = new wxStaticText (this, wxID_ANY, _("Output"));
+       h = new StaticText (this, _("Output"));
        h->SetFont (subheading_font);
        right->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
        _output = new KDMOutputPanel (this, film->interop ());
index 694957ee8444e5a4aedfc2eeaf32b6e3573c80d6..1e222591d7c9f234d06786ec77a0a1674a52961f 100644 (file)
@@ -28,6 +28,7 @@
 #include "wx_util.h"
 #include "kdm_advanced_dialog.h"
 #include "name_format_editor.h"
+#include "check_box.h"
 #include <dcp/exceptions.h>
 #include <dcp/types.h>
 #ifdef DCPOMATIC_USE_OWN_PICKER
@@ -89,7 +90,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop)
        _filename_format = new NameFormatEditor (this, Config::instance()->kdm_filename_format(), titles, ex, ".xml");
        table->Add (_filename_format->panel(), 1, wxEXPAND);
 
-       _write_to = new wxCheckBox (this, wxID_ANY, _("Write to"));
+       _write_to = new CheckBox (this, _("Write to"));
        table->Add (_write_to, 1, wxEXPAND);
 
 #ifdef DCPOMATIC_USE_OWN_PICKER
@@ -117,7 +118,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop)
        table->AddSpacer (0);
        table->Add (write_options);
 
-       _email = new wxCheckBox (this, wxID_ANY, _("Send by email"));
+       _email = new CheckBox (this, _("Send by email"));
        table->Add (_email, 1, wxEXPAND);
        table->AddSpacer (0);
 
index 53f674e2ecbe01f6edc83ec80461cd68c2259467..bad900d2768c5e5c3c29c4b4a88316596b19d341 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -21,6 +21,7 @@
 #include "kdm_timing_panel.h"
 #include "wx_util.h"
 #include "time_picker.h"
+#include "static_text.h"
 #include <wx/datectrl.h>
 #include <wx/dateevt.h>
 
@@ -61,7 +62,7 @@ KDMTimingPanel::KDMTimingPanel (wxWindow* parent)
 
        overall_sizer->Add (table);
 
-       _warning = new wxStaticText (this, wxID_ANY, wxT (""));
+       _warning = new StaticText (this, wxT(""));
        overall_sizer->Add (_warning, 0, wxTOP, DCPOMATIC_SIZER_GAP);
        wxFont font = _warning->GetFont();
        font.SetStyle(wxFONTSTYLE_ITALIC);
index 74d2e24b5ea146a6721c660383004b917e4db3ec..e1ba112cec4e5f28deecbde7302fa83ec96918e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -19,6 +19,7 @@
 */
 
 #include "make_chain_dialog.h"
+#include "static_text.h"
 #include <boost/algorithm/string.hpp>
 
 using std::string;
@@ -57,7 +58,7 @@ MakeChainDialog::MakeChainDialog (
 
        {
                wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
-               s->Add (new wxStaticText (this, wxID_ANY, wxT (".")), 0, wxALIGN_CENTER_VERTICAL);
+               s->Add (new StaticText (this, wxT (".")), 0, wxALIGN_CENTER_VERTICAL);
                s->Add (_root_common_name = new wxTextCtrl (
                                this, wxID_ANY, std_to_wx (root_common_name), wxDefaultPosition, wxDefaultSize, 0, validator), 1, wxALIGN_CENTER_VERTICAL
                        );
@@ -68,7 +69,7 @@ MakeChainDialog::MakeChainDialog (
 
        {
                wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
-               s->Add (new wxStaticText (this, wxID_ANY, wxT (".")), 0, wxALIGN_CENTER_VERTICAL);
+               s->Add (new StaticText (this, wxT (".")), 0, wxALIGN_CENTER_VERTICAL);
                s->Add (_intermediate_common_name = new wxTextCtrl (
                                this, wxID_ANY, std_to_wx (intermediate_common_name), wxDefaultPosition, wxDefaultSize, 0, validator), 1, wxALIGN_CENTER_VERTICAL
                        );
@@ -79,7 +80,7 @@ MakeChainDialog::MakeChainDialog (
 
        {
                wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
-               s->Add (new wxStaticText (this, wxID_ANY, wxT ("CS.")), 0, wxALIGN_CENTER_VERTICAL);
+               s->Add (new StaticText (this, wxT ("CS.")), 0, wxALIGN_CENTER_VERTICAL);
                s->Add (_leaf_common_name = new wxTextCtrl (
                                this, wxID_ANY, std_to_wx (leaf_common_name), wxDefaultPosition, wxDefaultSize, 0, validator), 1, wxALIGN_CENTER_VERTICAL
                        );
index b3cbb53fce7a57eda426383c703e1a5041dd9fd1..56258b1a0ebe0f5a40f7e97cb27b1231dc3c9609 100644 (file)
 
 #include "message_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
 
 MessageDialog::MessageDialog (wxWindow* parent, wxString title, wxString message)
        : wxDialog (parent, wxID_ANY, title)
 {
        wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
-       wxStaticText* text = new wxStaticText (this, wxID_ANY, message);
+       wxStaticText* text = new StaticText (this, message);
        sizer->Add (text, 1, wxALL, DCPOMATIC_DIALOG_BORDER);
        wxSizer* buttons = CreateSeparatedButtonSizer (wxCLOSE);
        if (buttons) {
index b7efb43db45953fa35a85d1af24f827dc9e74458..2226938f349ead205077392df6c78cb1be069fa7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2017-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,8 @@
 
 #include "nag_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
+#include "check_box.h"
 #include <wx/richtext/richtextctrl.h>
 #include <boost/foreach.hpp>
 
@@ -30,10 +32,10 @@ NagDialog::NagDialog (wxWindow* parent, Config::Nag nag, wxString message, bool
        , _nag (nag)
 {
        wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
-       _text = new wxStaticText (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (400, 300));
+       _text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize (400, 300));
        sizer->Add (_text, 1, wxEXPAND | wxALL, 6);
 
-       wxCheckBox* b = new wxCheckBox (this, wxID_ANY, _("Don't show this message again"));
+       wxCheckBox* b = new CheckBox (this, _("Don't show this message again"));
        sizer->Add (b, 0, wxALL, 6);
        b->Bind (wxEVT_CHECKBOX, bind (&NagDialog::shut_up, this, _1));
 
index 82adc3f55d36cadc11caf2ba1153bcf1bea8d7cc..5755d75f4b0ed6253befb575429feb92e9a699ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 #include "name_format_editor.h"
 #include "wx_util.h"
+#include "static_text.h"
 #include "lib/util.h"
 
 using std::string;
 
 NameFormatEditor::NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples, string suffix)
        : _panel (new wxPanel (parent))
-       , _example (new wxStaticText (_panel, wxID_ANY, ""))
+       , _example (new StaticText (_panel, ""))
        , _sizer (new wxBoxSizer (wxVERTICAL))
        , _specification (new wxTextCtrl (_panel, wxID_ANY, ""))
        , _name (name)
@@ -40,7 +41,7 @@ NameFormatEditor::NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp:
        _panel->SetSizer (_sizer);
 
        for (dcp::NameFormat::Map::const_iterator i = titles.begin(); i != titles.end(); ++i) {
-               wxStaticText* t = new wxStaticText (_panel, wxID_ANY, std_to_wx (String::compose ("%%%1 %2", i->first, i->second)));
+               wxStaticText* t = new StaticText (_panel, std_to_wx (String::compose ("%%%1 %2", i->first, i->second)));
                _sizer->Add (t);
                wxFont font = t->GetFont();
                font.SetStyle (wxFONTSTYLE_ITALIC);
index c613cad3b6f39a791bfacd6007f0125e2c7822ef..cd4518881131378a2232865b0a93f2fe6534324a 100644 (file)
 */
 
 #include "paste_dialog.h"
+#include "check_box.h"
 
 PasteDialog::PasteDialog (wxWindow* parent, bool video, bool audio, bool text)
        : TableDialog (parent, _("Paste"), 1, 0, true)
 {
-       _video = new wxCheckBox (this, wxID_ANY, _("Paste video settings"));
+       _video = new CheckBox (this, _("Paste video settings"));
        _video->Enable (video);
        add (_video);
-       _audio = new wxCheckBox (this, wxID_ANY, _("Paste audio settings"));
+       _audio = new CheckBox (this, _("Paste audio settings"));
        _audio->Enable (audio);
        add (_audio);
-       _text = new wxCheckBox (this, wxID_ANY, _("Paste subtitle and caption settings"));
+       _text = new CheckBox (this, _("Paste subtitle and caption settings"));
        _text->Enable (text);
        add (_text);
 
index de97f2b71f749d5cc8b562bc36e397ac4e4f43bf..ca65711a7d05c8adf4711214ad4e43e8f642756d 100644 (file)
@@ -35,6 +35,7 @@
 #include "name_format_editor.h"
 #include "nag_dialog.h"
 #include "monitor_dialog.h"
+#include "check_box.h"
 #include "lib/config.h"
 #include "lib/ratio.h"
 #include "lib/filter.h"
@@ -101,7 +102,7 @@ private:
                table->Add (_image_display, wxGBPosition(r, 1));
                ++r;
 
-               _respect_kdm = new wxCheckBox (_panel, wxID_ANY, _("Respect KDM validity periods"));
+               _respect_kdm = new CheckBox (_panel, _("Respect KDM validity periods"));
                table->Add (_respect_kdm, wxGBPosition(r, 0), wxGBSpan(1, 2));
                ++r;
 
index 9b767c927dacf9000afa1b0f7d350adaf3dbab4f..1dd14e0c8da4a87494418ff130783500abde8c0b 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "recreate_chain_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/config.h"
 #include "lib/cinema_kdms.h"
 #include <boost/foreach.hpp>
@@ -34,9 +36,9 @@ RecreateChainDialog::RecreateChainDialog (wxWindow* parent)
                                   "which will prevent DCPs from being validated correctly on some systems.  Do you want to re-create\n"
                                   "the certificate chain for signing DCPs and KDMs?");
 
-       _sizer->Add (new wxStaticText (this, wxID_ANY, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
+       _sizer->Add (new StaticText (this, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
-       wxCheckBox* shut_up = new wxCheckBox (this, wxID_ANY, _("Don't ask this again"));
+       wxCheckBox* shut_up = new CheckBox (this, _("Don't ask this again"));
        _sizer->Add (shut_up, 0, wxALL, DCPOMATIC_DIALOG_BORDER);
 
        shut_up->Bind (wxEVT_CHECKBOX, bind (&RecreateChainDialog::shut_up, this, _1));
index 77540fcbc8eedee93da2f0d5bdff41cede73fd74..c79c542ed5861d880010d9bbb54e8d1da0c14538 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,8 @@
 
 #include "report_problem_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/config.h"
 #include "lib/job_manager.h"
 #include "lib/send_problem_report_job.h"
@@ -54,13 +56,13 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr<Film> fil
        flags |= wxALIGN_RIGHT;
        t += wxT (":");
 #endif
-       wxStaticText* m = new wxStaticText (this, wxID_ANY, t);
+       wxStaticText* m = new StaticText (this, t);
        _table->Add (m, 1, flags, 6);
 
        _summary = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxSize (320, 240), wxTE_MULTILINE);
        _table->Add (_summary, 1, wxEXPAND | wxALIGN_TOP);
 
-       _send_logs = new wxCheckBox (this, wxID_ANY, _("Send logs"));
+       _send_logs = new CheckBox (this, _("Send logs"));
        _send_logs->SetValue (true);
        _table->Add (_send_logs, 1, wxEXPAND);
        _table->AddSpacer (0);
@@ -88,7 +90,7 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr<Film> fil
                }
        }
 
-       wxStaticText* n = new wxStaticText (this, wxID_ANY, wxT (""));
+       wxStaticText* n = new StaticText (this, wxT (""));
        n->SetLabelMarkup (out);
        _table->AddSpacer (0);
        _table->Add (n, 1, wxEXPAND);
index 038bf97e4e09d6d898f608b39bb2f734d7d7d738..6ea3571a102799c085ab6b7d460959b3a3e66e4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "rgba_colour_picker.h"
 #include "wx_util.h"
+#include "static_text.h"
 #include <wx/clrpicker.h>
 
 RGBAColourPicker::RGBAColourPicker (wxWindow* parent, RGBA colour)
@@ -30,10 +31,10 @@ RGBAColourPicker::RGBAColourPicker (wxWindow* parent, RGBA colour)
        _picker = new wxColourPickerCtrl (this, wxID_ANY);
        _picker->SetColour (wxColour (colour.r, colour.g, colour.b));
        sizer->Add (_picker, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP);
-       sizer->Add (new wxStaticText (this, wxID_ANY, _("Alpha   0")), 0, wxALIGN_CENTRE_VERTICAL);
+       sizer->Add (new StaticText (this, _("Alpha   0")), 0, wxALIGN_CENTRE_VERTICAL);
        _alpha = new wxSlider (this, wxID_ANY, colour.a, 0, 255);
        sizer->Add (_alpha, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP);
-       sizer->Add (new wxStaticText (this, wxID_ANY, _("255")), 0, wxALIGN_CENTRE_VERTICAL);
+       sizer->Add (new StaticText (this, _("255")), 0, wxALIGN_CENTRE_VERTICAL);
 
        SetSizer (sizer);
 }
index f5d4b044a68b68f4fd8ac867448616bef95bde1e..e8361dcd83581d751f2200771cfa202dac7f2eac 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -21,6 +21,7 @@
 #include "screen_dialog.h"
 #include "wx_util.h"
 #include "file_dialog_wrapper.h"
+#include "static_text.h"
 #include "download_certificate_dialog.h"
 #include "table_dialog.h"
 #include "lib/compose.hpp"
@@ -126,7 +127,7 @@ ScreenDialog::ScreenDialog (
 
        add_label_to_sizer (_sizer, this, _("Recipient certificate"), true, wxGBPosition (r, 0));
        wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
-       _recipient_thumbprint = new wxStaticText (this, wxID_ANY, wxT (""), wxDefaultPosition, size);
+       _recipient_thumbprint = new StaticText (this, wxT (""), wxDefaultPosition, size);
        _recipient_thumbprint->SetFont (font);
        set_recipient (recipient);
        _get_recipient_from_file = new wxButton (this, wxID_ANY, _("Get from file..."));
index f53338517447192b9c53a9456c782f4855f44daf..5eae05de40f7cfdbadd59e2179f1f31c83df0b09 100644 (file)
@@ -22,6 +22,7 @@
 #include "wx_util.h"
 #include "kdm_output_panel.h"
 #include "kdm_cpl_panel.h"
+#include "static_text.h"
 #include "lib/film.h"
 #include "lib/screen.h"
 #include "lib/config.h"
@@ -57,14 +58,14 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, boost::shared_ptr<const Film>
        subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
 
        /* Sub-heading: CPL */
-       wxStaticText* h = new wxStaticText (this, wxID_ANY, _("CPL"));
+       wxStaticText* h = new StaticText (this, _("CPL"));
        h->SetFont (subheading_font);
        vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP * 2);
        _cpl = new KDMCPLPanel (this, film->cpls ());
        vertical->Add (_cpl);
 
        /* Sub-heading: output */
-       h = new wxStaticText (this, wxID_ANY, _("Output"));
+       h = new StaticText (this, _("Output"));
        h->SetFont (subheading_font);
        vertical->Add (h, 0, wxALIGN_CENTER_VERTICAL | wxTOP, DCPOMATIC_SIZER_Y_GAP * 2);
 
diff --git a/src/wx/static_text.cc b/src/wx/static_text.cc
new file mode 100644 (file)
index 0000000..6a11f64
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "static_text.h"
+
+StaticText::StaticText (wxWindow* parent, wxString label, wxPoint pos, wxSize size, long style)
+       : wxStaticText (parent, wxID_ANY, label, pos, size, style)
+       , I18NHook (this)
+{
+
+}
+
+void
+StaticText::set_text (wxString text)
+{
+       SetLabel (text);
+}
+
+wxString
+StaticText::get_text () const
+{
+       return GetLabel ();
+}
diff --git a/src/wx/static_text.h b/src/wx/static_text.h
new file mode 100644 (file)
index 0000000..0e49379
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "i18n_hook.h"
+#include <wx/wx.h>
+
+class StaticText : public wxStaticText, public I18NHook
+{
+public:
+       StaticText (wxWindow* parent, wxString label, wxPoint pos = wxDefaultPosition, wxSize = wxDefaultSize, long style = 0);
+
+       void set_text (wxString text);
+       wxString get_text () const;
+};
index a37f5a2ce6f4c151e17dfe8c3e1e4ae1500e8868..dd8353cf4866dc298992d5ba4a90c50fde561fd7 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "subtitle_appearance_dialog.h"
 #include "rgba_colour_picker.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/string_text_file_content.h"
 #include "lib/text_content.h"
 #include "lib/ffmpeg_subtitle_stream.h"
@@ -90,10 +92,10 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
 
                map<RGBA, RGBA> colours = _stream->colours ();
 
-               wxStaticText* t = new wxStaticText (colours_panel, wxID_ANY, "");
+               wxStaticText* t = new StaticText (colours_panel, "");
                t->SetLabelMarkup (_("<b>Original colour</b>"));
                table->Add (t, 1, wxEXPAND);
-               t = new wxStaticText (colours_panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_HORIZONTAL);
+               t = new StaticText (colours_panel, "", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_HORIZONTAL);
                t->SetLabelMarkup (_("<b>New colour</b>"));
                table->Add (t, 1, wxALIGN_CENTER);
 
@@ -203,7 +205,7 @@ wxCheckBox*
 SubtitleAppearanceDialog::set_to (wxWindow* w, int& r)
 {
        wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
-       wxCheckBox* set_to = new wxCheckBox (this, wxID_ANY, _("Set to"));
+       wxCheckBox* set_to = new CheckBox (this, _("Set to"));
        s->Add (set_to, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 8);
        s->Add (w, 0, wxALIGN_CENTER_VERTICAL);
        _table->Add (s, wxGBPosition (r, 1));
index 240a997d2fb7cbae392502d2df92b4973c52e1de..862f7db1a30f310091586398a8796f8fcb8819fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "table_dialog.h"
 #include "wx_util.h"
+#include "static_text.h"
 
 TableDialog::TableDialog (wxWindow* parent, wxString title, int columns, int growable, bool cancel)
        : wxDialog (parent, wxID_ANY, title)
@@ -64,7 +65,7 @@ TableDialog::add (wxString text, bool)
                text += wxT (":");
        }
 #endif
-       wxStaticText* m = new wxStaticText (this, wxID_ANY, wxT (""));
+       wxStaticText* m = new StaticText (this, wxT (""));
        m->SetLabelMarkup (text);
        _table->Add (m, 0, flags, 6);
        return m;
index 4b53a941e768924c592ad6e83ce9dde06a9e5615..31881806f306ef07d7abef4f6b3dd193250cb50f 100644 (file)
@@ -26,6 +26,8 @@
 #include "fonts_dialog.h"
 #include "dcp_text_track_dialog.h"
 #include "subtitle_appearance_dialog.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/string_text_file_content.h"
 #include "lib/ffmpeg_subtitle_stream.h"
@@ -58,40 +60,40 @@ TextPanel::TextPanel (ContentPanel* p, TextType t)
                refer = _("Use this DCP's closed caption as OV and make VF");
        }
 
-       _reference = new wxCheckBox (this, wxID_ANY, refer);
-       _reference_note = new wxStaticText (this, wxID_ANY, wxT(""));
+       _reference = new CheckBox (this, refer);
+       _reference_note = new StaticText (this, wxT(""));
        _reference_note->Wrap (200);
        wxFont font = _reference_note->GetFont();
        font.SetStyle(wxFONTSTYLE_ITALIC);
        font.SetPointSize(font.GetPointSize() - 1);
        _reference_note->SetFont(font);
 
-       _use = new wxCheckBox (this, wxID_ANY, _("Use as"));
+       _use = new CheckBox (this, _("Use as"));
        _type = new wxChoice (this, wxID_ANY);
        _type->Append (_("open subtitles"));
        _type->Append (_("closed captions"));
 
-       _burn = new wxCheckBox (this, wxID_ANY, _("Burn subtitles into image"));
+       _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 wxStaticText (this, wxID_ANY, _("%"));
+       _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 wxStaticText (this, wxID_ANY, _("%"));
+       _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 wxStaticText (this, wxID_ANY, _("%"));
+       _x_scale_pc_label = new StaticText (this, _("%"));
        _y_scale_label = create_label (this, _("Y"), true);
        _y_scale = new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1));
-       _y_scale_pc_label = new wxStaticText (this, wxID_ANY, _("%"));
+       _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 wxStaticText (this, wxID_ANY, _("%"));
+       _line_spacing_pc_label = new StaticText (this, _("%"));
 
        _dcp_track_label = create_label (this, _("DCP track"), true);
        _dcp_track = new wxChoice (this, wxID_ANY);
index 91b201aac73ca67e343819bf52375eb178a050f5..295bbd52d327c6a0c3db226c9756bf3c96733bc8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "time_picker.h"
 #include "wx_util.h"
+#include "static_text.h"
 #include <dcp/locale_convert.h>
 #include <wx/spinctrl.h>
 #include <boost/bind.hpp>
@@ -44,7 +45,7 @@ TimePicker::TimePicker (wxWindow* parent, wxDateTime time)
        wxBoxSizer* sizer = new wxBoxSizer (wxHORIZONTAL);
        _hours = new wxSpinCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, size);
        sizer->Add (_hours, 1, wxEXPAND | wxLEFT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
-       sizer->Add (new wxStaticText (this, wxID_ANY, wxT (":")), 0, wxALIGN_CENTER_VERTICAL);
+       sizer->Add (new StaticText (this, wxT (":")), 0, wxALIGN_CENTER_VERTICAL);
        _minutes = new wxSpinCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, size);
        sizer->Add (_minutes, 1, wxEXPAND | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
 
index cbaed68709edf620adb37640949e82019a141705..ebdd99487bff709b9f58e2999e1c40ecfa143068 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -24,6 +24,7 @@
 #include "timecode.h"
 #include "content_panel.h"
 #include "move_to_dialog.h"
+#include "static_text.h"
 #include "lib/content.h"
 #include "lib/image_content.h"
 #include "lib/text_content.h"
@@ -58,23 +59,23 @@ TimingPanel::TimingPanel (ContentPanel* p, weak_ptr<FilmViewer> viewer)
        }
 
        //// TRANSLATORS: this is an abbreviation for "hours"
-       _h_label = new wxStaticText (this, wxID_ANY, _("h"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+       _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 wxStaticText (this, wxID_ANY, _("m"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+       _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 wxStaticText (this, wxID_ANY, _("s"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+       _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 wxStaticText (this, wxID_ANY, _("f"), wxDefaultPosition, size, wxALIGN_CENTRE_HORIZONTAL);
+       _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
@@ -116,7 +117,7 @@ TimingPanel::TimingPanel (ContentPanel* p, weak_ptr<FilmViewer> viewer)
                }
        }
 
-       _tip = new wxStaticText (this, wxID_ANY, wxT (""));
+       _tip = new StaticText (this, wxT (""));
        _tip->SetLabelMarkup (out);
 #ifdef DCPOMATIC_OSX
        /* Hack to stop hidden text on some versions of OS X */
index c88ddbff2f46cc026045585d688167ea52c3bc1f..a4da39e185b94e423a266e6ca77b9af7739e9dc1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include <wx/hyperlink.h>
 #include "update_dialog.h"
+#include "static_text.h"
 #include "wx_util.h"
+#include <wx/hyperlink.h>
 
 using std::string;
 using boost::optional;
@@ -33,9 +34,9 @@ UpdateDialog::UpdateDialog (wxWindow* parent, optional<string> stable, optional<
        wxStaticText* message;
 
        if ((stable || test) && !(stable && test)) {
-               message = new wxStaticText (this, wxID_ANY, _("A new version of DCP-o-matic is available."));
+               message = new StaticText (this, _("A new version of DCP-o-matic is available."));
        } else {
-               message = new wxStaticText (this, wxID_ANY, _("New versions of DCP-o-matic are available."));
+               message = new StaticText (this, _("New versions of DCP-o-matic are available."));
        }
 
        overall_sizer->Add (message, 1, wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER);
index 55c0984a35b65e947ca839d4e9ae5ea9814bb6e5..aaafe34c1706589b6dced5fe30b16e2e022fd3f6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -24,6 +24,8 @@
 #include "content_colour_conversion_dialog.h"
 #include "content_widget.h"
 #include "content_panel.h"
+#include "static_text.h"
+#include "check_box.h"
 #include "lib/filter.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/colour_conversion.h"
@@ -74,8 +76,8 @@ scale_to_index (VideoContentScale scale)
 VideoPanel::VideoPanel (ContentPanel* p)
        : ContentSubPanel (p, _("Video"))
 {
-       _reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's video as OV and make VF"));
-       _reference_note = new wxStaticText (this, wxID_ANY, wxT(""));
+       _reference = new CheckBox (this, _("Use this DCP's video as OV and make VF"));
+       _reference_note = new StaticText (this, wxT(""));
        _reference_note->Wrap (200);
        wxFont font = _reference_note->GetFont();
        font.SetStyle(wxFONTSTYLE_ITALIC);
@@ -157,7 +159,7 @@ VideoPanel::VideoPanel (ContentPanel* p)
        size.SetHeight (-1);
 
        _filters_label = create_label (this, _("Filters"), true);
-       _filters = new wxStaticText (this, wxID_ANY, _("None"), wxDefaultPosition, size);
+       _filters = new StaticText (this, _("None"), wxDefaultPosition, size);
        _filters_button = new wxButton (this, wxID_ANY, _("Edit..."));
 
        _colour_conversion_label = create_label (this, _("Colour conversion"), true);
@@ -171,7 +173,7 @@ VideoPanel::VideoPanel (ContentPanel* p)
        _colour_conversion->Append (S_("Colour|Custom"));
        _edit_colour_conversion_button = new wxButton (this, wxID_ANY, _("Edit..."));
 
-       _description = new wxStaticText (this, wxID_ANY, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
+       _description = new StaticText (this, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
        _description->SetFont(font);
 
        _left_crop->wrapped()->SetRange (0, 4096);
index 6b0ed44104b655366ecc260f3395c5423f2583c1..f3d4a7aa527330d9d09718cfc6e8200295c0a5e8 100644 (file)
@@ -22,6 +22,7 @@
 #include "video_waveform_plot.h"
 #include "film_viewer.h"
 #include "wx_util.h"
+#include "static_text.h"
 #include <boost/bind.hpp>
 #include <iostream>
 
@@ -67,11 +68,11 @@ VideoWaveformDialog::VideoWaveformDialog (wxWindow* parent, weak_ptr<const Film>
 
        wxBoxSizer* position = new wxBoxSizer (wxHORIZONTAL);
        add_label_to_sizer (position, this, _("Image X position"), true);
-       _x_position = new wxStaticText (this, wxID_ANY, "");
+       _x_position = new StaticText (this, "");
        _x_position->SetMinSize (wxSize (64, -1));
        position->Add (_x_position, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
        add_label_to_sizer (position, this, _("component value"), true);
-       _value = new wxStaticText (this, wxID_ANY, "");
+       _value = new StaticText (this, "");
        _value->SetMinSize (wxSize (64, -1));
        position->Add (_value, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
        overall_sizer->Add (position, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_Y_GAP);
index bec58a3532cb28a014dd7071a40c7d9822bf1899..a8c14677dc63f808685cdef943bf1421fc6a7729 100644 (file)
@@ -36,6 +36,7 @@ sources = """
           subtitle_appearance_dialog.cc
           text_panel.cc
           text_view.cc
+          check_box.cc
           christie_certificate_panel.cc
           cinema_dialog.cc
           colour_conversion_editor.cc
@@ -74,6 +75,8 @@ sources = """
           gdc_certificate_panel.cc
           hints_dialog.cc
           initial_setup_dialog.cc
+          instant_i18n_dialog.cc
+          i18n_hook.cc
           job_view.cc
           job_view_dialog.cc
           job_manager_view.cc
@@ -109,6 +112,7 @@ sources = """
           server_dialog.cc
           servers_list_dialog.cc
           standard_controls.cc
+          static_text.cc
           swaroop_controls.cc
           system_font_dialog.cc
           table_dialog.cc
index 98d69e0db1a1082f1b169042b2b94a83d2c3a31c..354297d49549f17d522b9771482775db75beb879 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "wx_util.h"
 #include "file_picker_ctrl.h"
+#include "static_text.h"
 #include "lib/config.h"
 #include "lib/job_manager.h"
 #include "lib/util.h"
@@ -55,7 +56,7 @@ create_label (wxWindow* p, wxString t, bool)
                t += wxT (":");
        }
 #endif
-       return new wxStaticText (p, wxID_ANY, t);
+       return new StaticText (p, t);
 }
 
 /** Add a wxStaticText to a wxSizer, aligning it at vertical centre.