Support buttons.
authorCarl Hetherington <cth@carlh.net>
Sat, 8 Dec 2018 01:11:35 +0000 (01:11 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 8 Dec 2018 01:11:35 +0000 (01:11 +0000)
36 files changed:
src/tools/dcpomatic_batch.cc
src/tools/dcpomatic_kdm.cc
src/tools/dcpomatic_playlist.cc
src/wx/audio_panel.cc
src/wx/batch_job_view.cc
src/wx/config_dialog.cc
src/wx/content_panel.cc
src/wx/controls.cc
src/wx/dcp_panel.cc
src/wx/dcpomatic_button.cc [new file with mode: 0644]
src/wx/dcpomatic_button.h [new file with mode: 0644]
src/wx/dir_picker_ctrl.cc
src/wx/download_certificate_dialog.cc
src/wx/editable_list.h
src/wx/file_picker_ctrl.cc
src/wx/font_files_dialog.cc
src/wx/fonts_dialog.cc
src/wx/full_config_dialog.cc
src/wx/job_view.cc
src/wx/kdm_cpl_panel.cc
src/wx/kdm_dialog.cc
src/wx/kdm_output_panel.cc
src/wx/key_dialog.cc
src/wx/normal_job_view.cc
src/wx/player_config_dialog.cc
src/wx/screen_dialog.cc
src/wx/screens_panel.cc
src/wx/screens_panel.h
src/wx/subtitle_appearance_dialog.cc
src/wx/swaroop_controls.cc
src/wx/templates_dialog.cc
src/wx/text_panel.cc
src/wx/timecode.cc
src/wx/timing_panel.cc
src/wx/video_panel.cc
src/wx/wscript

index ac57baf4bd83bd9d505fd7510f41cdd512272ceb..ca5b4cfe13c9764eacb7614039a8a10138b061b5 100644 (file)
@@ -24,6 +24,7 @@
 #include "wx/job_manager_view.h"
 #include "wx/full_config_dialog.h"
 #include "wx/servers_list_dialog.h"
+#include "wx/dcpomatic_button.h"
 #include "lib/version.h"
 #include "lib/compose.hpp"
 #include "lib/config.h"
@@ -119,13 +120,13 @@ public:
                _sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6);
 
                wxSizer* buttons = new wxBoxSizer (wxHORIZONTAL);
-               wxButton* add = new wxButton (panel, wxID_ANY, _("Add Film..."));
+               wxButton* add = new Button (panel, _("Add Film..."));
                add->Bind (wxEVT_BUTTON, boost::bind (&DOMFrame::add_film, this));
                buttons->Add (add, 1, wxALL, 6);
-               _pause = new wxButton (panel, wxID_ANY, _("Pause"));
+               _pause = new Button (panel, _("Pause"));
                _pause->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::pause, this));
                buttons->Add (_pause, 1, wxALL, 6);
-               _resume = new wxButton (panel, wxID_ANY, _("Resume"));
+               _resume = new Button (panel, _("Resume"));
                _resume->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::resume, this));
                buttons->Add (_resume, 1, wxALL, 6);
 
index 999bba17ee68292bdf1ce7fd71a37f9c45f97f46..c8ab3cbfb16ebace9c87a15c4ac11cdf0a1797ec 100644 (file)
@@ -32,6 +32,7 @@
 #include "wx/new_dkdm_folder_dialog.h"
 #include "wx/editable_list.h"
 #include "wx/static_text.h"
+#include "wx/dcpomatic_button.h"
 #include "lib/config.h"
 #include "lib/util.h"
 #include "lib/screen.h"
@@ -152,11 +153,11 @@ public:
                );
                dkdm_sizer->Add (_dkdm, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_Y_GAP);
                wxBoxSizer* dkdm_buttons = new wxBoxSizer(wxVERTICAL);
-               _add_dkdm = new wxButton (overall_panel, wxID_ANY, _("Add..."));
+               _add_dkdm = new Button (overall_panel, _("Add..."));
                dkdm_buttons->Add (_add_dkdm, 0, wxALL | wxEXPAND, DCPOMATIC_BUTTON_STACK_GAP);
-               _add_dkdm_folder = new wxButton (overall_panel, wxID_ANY, _("Add folder..."));
+               _add_dkdm_folder = new Button (overall_panel, _("Add folder..."));
                dkdm_buttons->Add (_add_dkdm_folder, 0, wxALL | wxEXPAND, DCPOMATIC_BUTTON_STACK_GAP);
-               _remove_dkdm = new wxButton (overall_panel, wxID_ANY, _("Remove"));
+               _remove_dkdm = new Button (overall_panel, _("Remove"));
                dkdm_buttons->Add (_remove_dkdm, 0, wxALL | wxEXPAND, DCPOMATIC_BUTTON_STACK_GAP);
                dkdm_sizer->Add (dkdm_buttons, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
                right->Add (dkdm_sizer, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_Y_GAP);
@@ -170,7 +171,7 @@ public:
                _output = new KDMOutputPanel (overall_panel, false);
                right->Add (_output, 0, wxALL, DCPOMATIC_SIZER_Y_GAP);
 
-               _create = new wxButton (overall_panel, wxID_ANY, _("Create KDMs"));
+               _create = new Button (overall_panel, _("Create KDMs"));
                right->Add (_create, 0, wxALL, DCPOMATIC_SIZER_GAP);
 
                main_sizer->Add (horizontal, 1, wxALL | wxEXPAND, DCPOMATIC_DIALOG_BORDER);
index c9ceadb2658eb99df5132356f4343b19ba721a8a..bee920501ca32c918953de8aa736bd5ab4db0fcd 100644 (file)
@@ -125,12 +125,12 @@ public:
                main_sizer->Add (_list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
 
                wxBoxSizer* button_sizer = new wxBoxSizer (wxVERTICAL);
-               _up = new wxButton (overall_panel, wxID_ANY, _("Up"));
-               _down = new wxButton (overall_panel, wxID_ANY, _("Down"));
-               _add = new wxButton (overall_panel, wxID_ANY, _("Add"));
-               _remove = new wxButton (overall_panel, wxID_ANY, _("Remove"));
-               _save = new wxButton (overall_panel, wxID_ANY, _("Save playlist"));
-               _load = new wxButton (overall_panel, wxID_ANY, _("Load playlist"));
+               _up = new Button (overall_panel, _("Up"));
+               _down = new Button (overall_panel, _("Down"));
+               _add = new Button (overall_panel, _("Add"));
+               _remove = new Button (overall_panel, _("Remove"));
+               _save = new Button (overall_panel, _("Save playlist"));
+               _load = new Button (overall_panel, _("Load playlist"));
                button_sizer->Add (_up, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
                button_sizer->Add (_down, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
                button_sizer->Add (_add, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
index 34292620b48a9d7561fca29cf0d47ec3bb3313fa..1c6ed1583d5ea1aef0b611628d229933459f1c60 100644 (file)
@@ -26,6 +26,7 @@
 #include "audio_dialog.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/config.h"
 #include "lib/ffmpeg_audio_stream.h"
 #include "lib/ffmpeg_content.h"
@@ -58,7 +59,7 @@ AudioPanel::AudioPanel (ContentPanel* p)
        font.SetPointSize(font.GetPointSize() - 1);
        _reference_note->SetFont(font);
 
-       _show = new wxButton (this, wxID_ANY, _("Show graph of audio levels..."));
+       _show = new Button (this, _("Show graph of audio levels..."));
        _peak = new StaticText (this, wxT (""));
 
        _gain_label = create_label (this, _("Gain"), true);
@@ -72,7 +73,7 @@ AudioPanel::AudioPanel (ContentPanel* p)
                );
 
        _gain_db_label = create_label (this, _("dB"), false);
-       _gain_calculate_button = new wxButton (this, wxID_ANY, _("Calculate..."));
+       _gain_calculate_button = new Button (this, _("Calculate..."));
 
        _delay_label = create_label (this, _("Delay"), true);
        _delay = new ContentSpinCtrl<AudioContent> (
index 853dac8f4adf1912a6d5f819aee0645cf4937737..038e8b22881a1c7ceeb11bdc732b82978f70a553 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "batch_job_view.h"
+#include "dcpomatic_button.h"
 #include "lib/job_manager.h"
 #include <wx/sizer.h>
 #include <wx/button.h>
@@ -41,10 +42,10 @@ BatchJobView::insert_position () const
 void
 BatchJobView::finish_setup (wxWindow* parent, wxSizer* sizer)
 {
-       _higher_priority = new wxButton (parent, wxID_ANY, _("Higher priority"));
+       _higher_priority = new Button (parent, _("Higher priority"));
        _higher_priority->Bind (wxEVT_BUTTON, boost::bind (&BatchJobView::higher_priority_clicked, this));
        sizer->Add (_higher_priority, 1, wxALIGN_CENTER_VERTICAL);
-       _lower_priority = new wxButton (parent, wxID_ANY, _("Lower priority"));
+       _lower_priority = new Button (parent, _("Lower priority"));
        _lower_priority->Bind (wxEVT_BUTTON, boost::bind (&BatchJobView::lower_priority_clicked, this));
        sizer->Add (_lower_priority, 1, wxALIGN_CENTER_VERTICAL);
 }
index 1066a88b031ab5511e667329402459c492dc14c8..ccf1202ecd25b3bb30f05f6d9e78682590ed8780 100644 (file)
@@ -22,6 +22,7 @@
 #include "static_text.h"
 #include "check_box.h"
 #include "nag_dialog.h"
+#include "dcpomatic_button.h"
 
 using std::string;
 using std::vector;
@@ -379,11 +380,11 @@ CertificateChainEditor::CertificateChainEditor (
 
        {
                wxSizer* s = new wxBoxSizer (wxVERTICAL);
-               _add_certificate = new wxButton (this, wxID_ANY, _("Add..."));
+               _add_certificate = new Button (this, _("Add..."));
                s->Add (_add_certificate, 0, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
-               _remove_certificate = new wxButton (this, wxID_ANY, _("Remove"));
+               _remove_certificate = new Button (this, _("Remove"));
                s->Add (_remove_certificate, 0, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
-               _export_certificate = new wxButton (this, wxID_ANY, _("Export"));
+               _export_certificate = new Button (this, _("Export"));
                s->Add (_export_certificate, 0, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
                certificates_sizer->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
        }
@@ -398,14 +399,14 @@ CertificateChainEditor::CertificateChainEditor (
        font.SetFamily (wxFONTFAMILY_TELETYPE);
        _private_key->SetFont (font);
        table->Add (_private_key, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
-       _import_private_key = new wxButton (this, wxID_ANY, _("Import..."));
+       _import_private_key = new Button (this, _("Import..."));
        table->Add (_import_private_key, wxGBPosition (r, 2));
-       _export_private_key = new wxButton (this, wxID_ANY, _("Export..."));
+       _export_private_key = new Button (this, _("Export..."));
        table->Add (_export_private_key, wxGBPosition (r, 3));
        ++r;
 
        _button_sizer = new wxBoxSizer (wxHORIZONTAL);
-       _remake_certificates = new wxButton (this, wxID_ANY, _("Re-make certificates and key..."));
+       _remake_certificates = new Button (this, _("Re-make certificates and key..."));
        _button_sizer->Add (_remake_certificates, 1, wxRIGHT, border);
        table->Add (_button_sizer, wxGBPosition (r, 0), wxGBSpan (1, 4));
        ++r;
@@ -734,15 +735,15 @@ KeysPage::setup ()
                sizer->Add (m, 0, wxALL, _border);
        }
 
-       wxButton* export_decryption_certificate = new wxButton (_panel, wxID_ANY, _("Export KDM decryption certificate..."));
+       wxButton* export_decryption_certificate = new Button (_panel, _("Export KDM decryption certificate..."));
        sizer->Add (export_decryption_certificate, 0, wxLEFT, _border);
-       wxButton* export_decryption_chain = new wxButton (_panel, wxID_ANY, _("Export KDM decryption chain..."));
+       wxButton* export_decryption_chain = new Button (_panel, _("Export KDM decryption chain..."));
        sizer->Add (export_decryption_chain, 0, wxLEFT, _border);
-       wxButton* export_settings = new wxButton (_panel, wxID_ANY, _("Export all KDM decryption settings..."));
+       wxButton* export_settings = new Button (_panel, _("Export all KDM decryption settings..."));
        sizer->Add (export_settings, 0, wxLEFT, _border);
-       wxButton* import_settings = new wxButton (_panel, wxID_ANY, _("Import all KDM decryption settings..."));
+       wxButton* import_settings = new Button (_panel, _("Import all KDM decryption settings..."));
        sizer->Add (import_settings, 0, wxLEFT, _border);
-       wxButton* decryption_advanced = new wxButton (_panel, wxID_ANY, _("Advanced..."));
+       wxButton* decryption_advanced = new Button (_panel, _("Advanced..."));
        sizer->Add (decryption_advanced, 0, wxALL, _border);
 
        export_decryption_certificate->Bind (wxEVT_BUTTON, bind (&KeysPage::export_decryption_certificate, this));
@@ -757,7 +758,7 @@ KeysPage::setup ()
                sizer->Add (m, 0, wxALL, _border);
        }
 
-       wxButton* signing_advanced = new wxButton (_panel, wxID_ANY, _("Advanced..."));
+       wxButton* signing_advanced = new Button (_panel, _("Advanced..."));
        sizer->Add (signing_advanced, 0, wxLEFT, _border);
        signing_advanced->Bind (wxEVT_BUTTON, bind (&KeysPage::signing_advanced, this));
 }
index 254f1befbc12a2166c057dac846e89c6630cb9b6..e72ca28a18a11b0f667b7dfe545fc0a6d1ea3457 100644 (file)
@@ -27,6 +27,7 @@
 #include "timeline_dialog.h"
 #include "image_sequence_dialog.h"
 #include "film_viewer.h"
+#include "dcpomatic_button.h"
 #include "lib/audio_content.h"
 #include "lib/text_content.h"
 #include "lib/video_content.h"
@@ -93,31 +94,31 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmV
 
                wxBoxSizer* b = new wxBoxSizer (wxVERTICAL);
 
-               _add_file = new wxButton (_panel, wxID_ANY, _("Add file(s)..."));
+               _add_file = new Button (_panel, _("Add file(s)..."));
                _add_file->SetToolTip (_("Add video, image, sound or subtitle files to the film."));
                b->Add (_add_file, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
 
-               _add_folder = new wxButton (_panel, wxID_ANY, _("Add folder..."));
+               _add_folder = new Button (_panel, _("Add folder..."));
                _add_folder->SetToolTip (_("Add a folder of image files (which will be used as a moving image sequence) or a folder of sound files."));
                b->Add (_add_folder, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
 
-               _add_dcp = new wxButton (_panel, wxID_ANY, _("Add DCP..."));
+               _add_dcp = new Button (_panel, _("Add DCP..."));
                _add_dcp->SetToolTip (_("Add a DCP."));
                b->Add (_add_dcp, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
 
-               _remove = new wxButton (_panel, wxID_ANY, _("Remove"));
+               _remove = new Button (_panel, _("Remove"));
                _remove->SetToolTip (_("Remove the selected piece of content from the film."));
                b->Add (_remove, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
 
-               _earlier = new wxButton (_panel, wxID_ANY, _("Earlier"));
+               _earlier = new Button (_panel, _("Earlier"));
                _earlier->SetToolTip (_("Move the selected piece of content earlier in the film."));
                b->Add (_earlier, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
 
-               _later = new wxButton (_panel, wxID_ANY, _("Later"));
+               _later = new Button (_panel, _("Later"));
                _later->SetToolTip (_("Move the selected piece of content later in the film."));
                b->Add (_later, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
 
-               _timeline = new wxButton (_panel, wxID_ANY, _("Timeline..."));
+               _timeline = new Button (_panel, _("Timeline..."));
                _timeline->SetToolTip (_("Open the timeline for the film."));
                b->Add (_timeline, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
 
index 08d3a946009e1ccc7ed59acc3a36917fe42c7532..3df62fd31dd193bb8ee89f1cd0d587d6a0368bca 100644 (file)
@@ -26,6 +26,7 @@
 #include "content_view.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/job_manager.h"
 #include "lib/player_video.h"
 #include "lib/dcp_content.h"
@@ -61,9 +62,9 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
        , _outline_content (0)
        , _eye (0)
        , _jump_to_selected (0)
-       , _rewind_button (new wxButton (this, wxID_ANY, wxT("|<")))
-       , _back_button (new wxButton (this, wxID_ANY, wxT("<")))
-       , _forward_button (new wxButton (this, wxID_ANY, wxT(">")))
+       , _rewind_button (new Button (this, wxT("|<")))
+       , _back_button (new Button (this, wxT("<")))
+       , _forward_button (new Button (this, wxT(">")))
        , _frame_number (new StaticText (this, wxT("")))
        , _timecode (new StaticText (this, wxT("")))
 {
index ded073152e40e1a14fe9e4e66729f82a16d4e33c..a01db9be3f4add19090834bb9d90780ddf8e8a98 100644 (file)
@@ -27,6 +27,7 @@
 #include "check_box.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/ratio.h"
 #include "lib/config.h"
 #include "lib/dcp_content_type.h"
@@ -76,8 +77,8 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
        FocusManager::instance()->add(_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"));
+       _edit_isdcf_button = new Button (_panel, _("Details..."));
+       _copy_isdcf_name_button = new Button (_panel, _("Copy as name"));
 
        /* wxST_ELLIPSIZE_MIDDLE works around a bug in GTK2 and/or wxWidgets, see
           http://trac.wxwidgets.org/ticket/12539
@@ -99,7 +100,7 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
 
        _key_label = create_label (_panel, _("Key"), true);
        _key = new StaticText (_panel, "", wxDefaultPosition, size);
-       _edit_key = new wxButton (_panel, wxID_ANY, _("Edit..."));
+       _edit_key = new Button (_panel, _("Edit..."));
 
        _reels_label = create_label (_panel, _("Reels"), true);
        _reel_type = new wxChoice (_panel, wxID_ANY);
@@ -748,7 +749,7 @@ DCPPanel::make_video_panel ()
        _frame_rate_spin = new wxSpinCtrl (panel, wxID_ANY);
        _frame_rate_sizer->Add (_frame_rate_spin, 1, wxALIGN_CENTER_VERTICAL);
        setup_frame_rate_widget ();
-       _best_frame_rate = new wxButton (panel, wxID_ANY, _("Use best"));
+       _best_frame_rate = new Button (panel, _("Use best"));
        _frame_rate_sizer->Add (_best_frame_rate, 1, wxALIGN_CENTER_VERTICAL);
 
        _three_d = new CheckBox (panel, _("3D"));
@@ -872,7 +873,7 @@ DCPPanel::make_audio_panel ()
                _audio_processor->Append (std_to_wx (ap->name ()), new wxStringClientData (std_to_wx (ap->id ())));
        }
 
-       _show_audio = new wxButton (panel, wxID_ANY, _("Show audio..."));
+       _show_audio = new Button (panel, _("Show audio..."));
 
        _audio_channels->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_channels_changed, this));
        _audio_processor->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_processor_changed, this));
diff --git a/src/wx/dcpomatic_button.cc b/src/wx/dcpomatic_button.cc
new file mode 100644 (file)
index 0000000..de26629
--- /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 "dcpomatic_button.h"
+
+Button::Button (wxWindow* parent, wxString label, wxPoint pos, wxSize size, long style)
+       : wxButton (parent, wxID_ANY, label, pos, size, style)
+       , I18NHook (this)
+{
+
+}
+
+void
+Button::set_text (wxString text)
+{
+       SetLabel (text);
+}
+
+wxString
+Button::get_text () const
+{
+       return GetLabel ();
+}
diff --git a/src/wx/dcpomatic_button.h b/src/wx/dcpomatic_button.h
new file mode 100644 (file)
index 0000000..682fa5f
--- /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_BUTTON_H
+#define DCPOMATIC_BUTTON_H
+
+#include "i18n_hook.h"
+#include <wx/button.h>
+
+class Button : public wxButton, public I18NHook
+{
+public:
+       Button (wxWindow* parent, wxString label, wxPoint pos = wxDefaultPosition, wxSize = wxDefaultSize, long style = 0);
+
+       void set_text (wxString text);
+       wxString get_text () const;
+};
+
+#endif
index ffd3b6fa115a116b63d6c352c1c7d29d2c5487b0..b05e73273d99d0703379ff109b5c1e70f200b9cf 100644 (file)
@@ -21,6 +21,7 @@
 #include "dir_picker_ctrl.h"
 #include "wx_util.h"
 #include "static_text.h"
+#include "dcpomatic_button.h"
 #include <wx/wx.h>
 #include <wx/stdpaths.h>
 #include <wx/filepicker.h>
@@ -36,7 +37,7 @@ DirPickerCtrl::DirPickerCtrl (wxWindow* parent)
 
        _folder = new StaticText (this, wxT(""));
        _sizer->Add (_folder, 1, wxEXPAND | wxALL, 6);
-       _browse = new wxButton (this, wxID_ANY, _("Browse..."));
+       _browse = new Button (this, _("Browse..."));
        _sizer->Add (_browse, 0);
 
        SetSizer (_sizer);
index 21a675ac70c0b74ae7d886d4e9c2a2d7ccd86470..45b34c7030540162919a82e6cd94ebd51022727a 100644 (file)
@@ -25,6 +25,7 @@
 #include "download_certificate_dialog.h"
 #include "static_text.h"
 #include "wx_util.h"
+#include "dcpomatic_button.h"
 
 using boost::optional;
 
@@ -36,7 +37,7 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
        _notebook = new wxNotebook (this, wxID_ANY);
        sizer->Add (_notebook, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
-       _download = new wxButton (this, wxID_ANY, _("Download"));
+       _download = new Button (this, _("Download"));
        sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
 
        _message = new StaticText (this, wxT (""));
index eb06f4cf8869a835273f2c44ac8b2a04941db5ba..a7c1a610295da46c6fdad210b7afb58881d4600d 100644 (file)
@@ -22,6 +22,7 @@
 #define DCPOMATIC_EDITABLE_LIST_H
 
 #include "wx_util.h"
+#include "dcpomatic_button.h"
 #include <wx/wx.h>
 #include <wx/listctrl.h>
 #include <boost/function.hpp>
@@ -72,13 +73,13 @@ public:
 
                {
                        wxSizer* s = new wxBoxSizer (wxVERTICAL);
-                       _add = new wxButton (this, wxID_ANY, _("Add..."));
+                       _add = new Button (this, _("Add..."));
                        s->Add (_add, 0, wxTOP | wxBOTTOM, 2);
                        if (can_edit) {
-                               _edit = new wxButton (this, wxID_ANY, _("Edit..."));
+                               _edit = new Button (this, _("Edit..."));
                                s->Add (_edit, 0, wxTOP | wxBOTTOM, 2);
                        }
-                       _remove = new wxButton (this, wxID_ANY, _("Remove"));
+                       _remove = new Button (this, _("Remove"));
                        s->Add (_remove, 0, wxTOP | wxBOTTOM, 2);
                        _sizer->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
                }
index 4cd843feb3755c710c08111416e9f9075206e2ab..47b5dbca06a7e8ade9bb710d7de8076a2312c508 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "file_picker_ctrl.h"
 #include "wx_util.h"
+#include "dcpomatic_button.h"
 #include <wx/wx.h>
 #include <wx/stdpaths.h>
 #include <wx/filepicker.h>
@@ -40,7 +41,7 @@ FilePickerCtrl::FilePickerCtrl (wxWindow* parent, wxString prompt, wxString wild
         wxSize size = dc.GetTextExtent (wxT ("This is the length of the file label it should be quite long"));
         size.SetHeight (-1);
 
-       _file = new wxButton (this, wxID_ANY, _("(None)"), wxDefaultPosition, size, wxBU_LEFT);
+       _file = new Button (this, _("(None)"), wxDefaultPosition, size, wxBU_LEFT);
        _sizer->Add (_file, 1, wxEXPAND, 0);
 
        SetSizerAndFit (_sizer);
index 7fd4f9d99aeda678bd4b75a010ab2040a90f7741..e85c37fa73b49e418f4b629cf25705a465098c63 100644 (file)
@@ -21,6 +21,7 @@
 #include "font_files_dialog.h"
 #include "system_font_dialog.h"
 #include "static_text.h"
+#include "dcpomatic_button.h"
 
 using boost::bind;
 
@@ -49,10 +50,10 @@ FontFilesDialog::FontFilesDialog (wxWindow* parent, FontFiles files)
                        wxSize (200, -1)
                        );
                _table->Add (_name[i], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
-               add (_set_file[i] = new wxButton (this, wxID_ANY, _("Set from file...")));
+               add (_set_file[i] = new Button (this, _("Set from file...")));
                _set_file[i]->Bind (wxEVT_BUTTON, bind (&FontFilesDialog::set_from_file_clicked, this, static_cast<FontFiles::Variant>(i)));
 #ifdef DCPOMATIC_WINDOWS
-               add (_set_system[i] = new wxButton (this, wxID_ANY, _("Set from system font...")));
+               add (_set_system[i] = new Button (this, _("Set from system font...")));
                _set_system[i]->Bind (wxEVT_BUTTON, bind (&FontFilesDialog::set_from_system_clicked, this, static_cast<FontFiles::Variant>(i)));
 #endif
        }
index 3619b7e0aa11cf21a0486f368d7130977826dd84..0660eea39ec2fbdec05f327f6270b46a4e02b3b0 100644 (file)
@@ -22,6 +22,7 @@
 #include "wx_util.h"
 #include "system_font_dialog.h"
 #include "font_files_dialog.h"
+#include "dcpomatic_button.h"
 #include "lib/font.h"
 #include "lib/content.h"
 #include "lib/text_content.h"
@@ -76,7 +77,7 @@ FontsDialog::FontsDialog (wxWindow* parent, shared_ptr<Content> content, shared_
        wxBoxSizer* sizer = new wxBoxSizer (wxHORIZONTAL);
        sizer->Add (_fonts, 1, wxEXPAND | wxLEFT | wxRIGHT, DCPOMATIC_SIZER_X_GAP);
 
-       _edit = new wxButton (this, wxID_ANY, _("Edit..."));
+       _edit = new Button (this, _("Edit..."));
        sizer->Add (_edit, 0, wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
 
        wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
index 8e176b4d6fa319c92aa311357b7947c8864777f5..2f1db11c2600d3c16f8207c58ae01e31d64a1f5e 100644 (file)
@@ -38,6 +38,7 @@
 #include "config_dialog.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/config.h"
 #include "lib/ratio.h"
 #include "lib/filter.h"
@@ -110,7 +111,7 @@ private:
                add_label_to_sizer (table, _panel, _("Cinema and screen database file"), true, wxGBPosition (r, 0));
                _cinemas_file = new FilePickerCtrl (_panel, _("Select cinema and screen database file"), "*.xml", true);
                table->Add (_cinemas_file, wxGBPosition (r, 1));
-               wxButton* export_cinemas = new wxButton (_panel, wxID_ANY, _("Export..."));
+               Button* export_cinemas = new Button (_panel, _("Export..."));
                table->Add (export_cinemas, wxGBPosition (r, 2));
                ++r;
 
@@ -333,7 +334,7 @@ private:
                table->Add (_directory, 1, wxEXPAND);
 
                add_label_to_sizer (table, _panel, _("Default ISDCF name details"), true);
-               _isdcf_metadata_button = new wxButton (_panel, wxID_ANY, _("Edit..."));
+               _isdcf_metadata_button = new Button (_panel, _("Edit..."));
                table->Add (_isdcf_metadata_button);
 
                add_label_to_sizer (table, _panel, _("Default container"), true);
@@ -877,7 +878,7 @@ private:
                _email = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (-1, 200), wxTE_MULTILINE);
                _panel->GetSizer()->Add (_email, 0, wxEXPAND | wxALL, _border);
 
-               _reset_email = new wxButton (_panel, wxID_ANY, _("Reset to default subject and text"));
+               _reset_email = new Button (_panel, _("Reset to default subject and text"));
                _panel->GetSizer()->Add (_reset_email, 0, wxEXPAND | wxALL, _border);
 
                _cc->layout ();
@@ -1114,7 +1115,7 @@ private:
                _email = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (-1, 200), wxTE_MULTILINE);
                _panel->GetSizer()->Add (_email, 0, wxEXPAND | wxALL, _border);
 
-               _reset_email = new wxButton (_panel, wxID_ANY, _("Reset to default subject and text"));
+               _reset_email = new Button (_panel, _("Reset to default subject and text"));
                _panel->GetSizer()->Add (_reset_email, 0, wxEXPAND | wxALL, _border);
 
                _cc->layout ();
@@ -1245,7 +1246,7 @@ private:
                _cover_sheet = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (-1, 200), wxTE_MULTILINE);
                _panel->GetSizer()->Add (_cover_sheet, 0, wxEXPAND | wxALL, _border);
 
-               _reset_cover_sheet = new wxButton (_panel, wxID_ANY, _("Reset to default text"));
+               _reset_cover_sheet = new Button (_panel, _("Reset to default text"));
                _panel->GetSizer()->Add (_reset_cover_sheet, 0, wxEXPAND | wxALL, _border);
 
                _cover_sheet->Bind (wxEVT_TEXT, boost::bind (&CoverSheetPage::cover_sheet_changed, this));
index 28b171b825371ed686d3a8c0a9c760d5da5d2d2d..174c9967dab4b95cfdd482da76562b68109df824 100644 (file)
@@ -23,6 +23,7 @@
 #include "message_dialog.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/job.h"
 #include "lib/job_manager.h"
 #include "lib/compose.hpp"
@@ -65,11 +66,11 @@ JobView::setup ()
 
        _buttons = new wxBoxSizer (wxHORIZONTAL);
 
-       _cancel = new wxButton (_container, wxID_ANY, _("Cancel"));
+       _cancel = new Button (_container, _("Cancel"));
        _cancel->Bind (wxEVT_BUTTON, &JobView::cancel_clicked, this);
        _buttons->Add (_cancel, 1, wxALIGN_CENTER_VERTICAL);
 
-       _details = new wxButton (_container, wxID_ANY, _("Details..."));
+       _details = new Button (_container, _("Details..."));
        _details->Bind (wxEVT_BUTTON, &JobView::details_clicked, this);
        _details->Enable (false);
        _buttons->Add (_details, 1, wxALIGN_CENTER_VERTICAL);
index d710d88aaef571aa3d4d24501faafb6ce1747283..db05db27c9697962059fe4186714ca2a3025a48c 100644 (file)
@@ -21,6 +21,7 @@
 #include "kdm_cpl_panel.h"
 #include "wx_util.h"
 #include "static_text.h"
+#include "dcpomatic_button.h"
 #include <libcxml/cxml.h>
 
 using std::vector;
@@ -36,7 +37,7 @@ KDMCPLPanel::KDMCPLPanel (wxWindow* parent, vector<CPLSummary> cpls)
        add_label_to_sizer (s, this, _("CPL"), true);
        _cpl = new wxChoice (this, wxID_ANY);
        s->Add (_cpl, 1, wxEXPAND);
-       _cpl_browse = new wxButton (this, wxID_ANY, _("Browse..."));
+       _cpl_browse = new Button (this, _("Browse..."));
        s->Add (_cpl_browse, 0, wxALIGN_CENTER_VERTICAL);
        vertical->Add (s, 0, wxEXPAND | wxTOP, DCPOMATIC_SIZER_GAP + 2);
 
index f59250750bc590734c13efc4e93b11cfb3d30ee4..55364f5974e04bbf8231d3426edb8b6ee843e688 100644 (file)
@@ -26,6 +26,7 @@
 #include "kdm_cpl_panel.h"
 #include "confirm_kdm_email_dialog.h"
 #include "static_text.h"
+#include "dcpomatic_button.h"
 #include "lib/film.h"
 #include "lib/screen.h"
 #include "lib/screen_kdm.h"
@@ -97,7 +98,7 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        _output = new KDMOutputPanel (this, film->interop ());
        right->Add (_output, 0, wxEXPAND | wxTOP, DCPOMATIC_SIZER_GAP);
 
-       _make = new wxButton (this, wxID_ANY, _("Make KDMs"));
+       _make = new Button (this, _("Make KDMs"));
        right->Add (_make, 0, wxTOP | wxBOTTOM, DCPOMATIC_SIZER_GAP);
 
        /* Make an overall sizer to get a nice border */
index 1e222591d7c9f234d06786ec77a0a1674a52961f..bcaad33e4c3f4376c6f807d8d6c09bbe3a779f58 100644 (file)
@@ -29,6 +29,7 @@
 #include "kdm_advanced_dialog.h"
 #include "name_format_editor.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include <dcp/exceptions.h>
 #include <dcp/types.h>
 #ifdef DCPOMATIC_USE_OWN_PICKER
@@ -66,7 +67,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop)
        }
        type->Add (_type, 1, wxEXPAND);
        _type->SetSelection (0);
-       wxButton* advanced = new wxButton (this, wxID_ANY, _("Advanced..."));
+       wxButton* advanced = new Button (this, _("Advanced..."));
        type->Add (advanced, 0, wxALIGN_CENTER_VERTICAL);
        table->Add (type, 1, wxEXPAND);
 
index 414e61d37ec93cb3194aeb7bb953eabdb1e482ce..2d8cd4c37afee4dc0f5417b0868b02b6370dd116 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "key_dialog.h"
 #include "wx_util.h"
+#include "dcpomatic_button.h"
 #include <iostream>
 
 using std::cout;
@@ -47,7 +48,7 @@ KeyDialog::KeyDialog (wxWindow* parent, dcp::Key key)
        _key->SetValue (std_to_wx (key.hex ()));
        _key->SetMaxLength (32);
 
-       _random = add (new wxButton (this, wxID_ANY, _("Random")));
+       _random = add (new Button(this, _("Random")));
 
        _key->Bind (wxEVT_TEXT, boost::bind (&KeyDialog::key_changed, this));
        _random->Bind (wxEVT_BUTTON, boost::bind (&KeyDialog::random, this));
index 22b3e1cc7e9ec07bc448eded42d82d15ad3f6d23..ada0596c82b978a5b5a15af19c5c621727e0e697 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "normal_job_view.h"
+#include "dcpomatic_button.h"
 #include "lib/job.h"
 #include <wx/wx.h>
 
@@ -34,7 +35,7 @@ NormalJobView::NormalJobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* c
 void
 NormalJobView::finish_setup (wxWindow* parent, wxSizer* sizer)
 {
-       _pause = new wxButton (parent, wxID_ANY, _("Pause"));
+       _pause = new Button (parent, _("Pause"));
        _pause->Bind (wxEVT_BUTTON, boost::bind (&NormalJobView::pause_clicked, this));
        sizer->Add (_pause, 1, wxALIGN_CENTER_VERTICAL);
 }
index ca65711a7d05c8adf4711214ad4e43e8f642756d..254a84c8a6180be875d733f3788f182952f7a056 100644 (file)
@@ -431,7 +431,7 @@ private:
                        );
                _panel->GetSizer()->Add(_monitor_list, 1, wxEXPAND | wxALL, _border);
 
-               wxButton* get = new wxButton(_panel, wxID_ANY, _("Read current devices"));
+               Button* get = new wxButton(_panel, _("Read current devices"));
                _panel->GetSizer()->Add(get, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
                get->Bind(wxEVT_BUTTON, bind(&DevicesPage::get_clicked, this));
        }
index e8361dcd83581d751f2200771cfa202dac7f2eac..6bfc0da4cbd15816fcaca9203aa4279b08a768fc 100644 (file)
@@ -24,6 +24,7 @@
 #include "static_text.h"
 #include "download_certificate_dialog.h"
 #include "table_dialog.h"
+#include "dcpomatic_button.h"
 #include "lib/compose.hpp"
 #include "lib/util.h"
 #include <dcp/exceptions.h>
@@ -52,7 +53,7 @@ public:
        {
                add (_("Thumbprint"), true);
                _thumbprint = add (new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(300, -1)));
-               _file = add (new wxButton(this, wxID_ANY, _("Load certificate...")));
+               _file = add (new Button(this, _("Load certificate...")));
 
                layout ();
 
@@ -130,8 +131,8 @@ ScreenDialog::ScreenDialog (
        _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..."));
-       _download_recipient = new wxButton (this, wxID_ANY, _("Download..."));
+       _get_recipient_from_file = new Button (this, _("Get from file..."));
+       _download_recipient = new Button (this, _("Download..."));
        s->Add (_recipient_thumbprint, 1, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP);
        s->Add (_get_recipient_from_file, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP);
        s->Add (_download_recipient, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP);
index 908e94f4dab8b0bbb5d2f46796705f0a76d63846..e89173eb27dd82f43f209e43ecffb2643187b85b 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.
 
 
 */
 
-#include "lib/config.h"
-#include "lib/cinema.h"
-#include "lib/screen.h"
 #include "screens_panel.h"
 #include "wx_util.h"
 #include "cinema_dialog.h"
 #include "screen_dialog.h"
+#include "dcpomatic_button.h"
+#include "lib/config.h"
+#include "lib/cinema.h"
+#include "lib/screen.h"
 #include <boost/foreach.hpp>
 
 using std::list;
@@ -54,17 +55,17 @@ ScreensPanel::ScreensPanel (wxWindow* parent)
 
        wxBoxSizer* target_buttons = new wxBoxSizer (wxVERTICAL);
 
-       _add_cinema = new wxButton (this, wxID_ANY, _("Add Cinema..."));
+       _add_cinema = new Button (this, _("Add Cinema..."));
        target_buttons->Add (_add_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
-       _edit_cinema = new wxButton (this, wxID_ANY, _("Edit Cinema..."));
+       _edit_cinema = new Button (this, _("Edit Cinema..."));
        target_buttons->Add (_edit_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
-       _remove_cinema = new wxButton (this, wxID_ANY, _("Remove Cinema"));
+       _remove_cinema = new Button (this, _("Remove Cinema"));
        target_buttons->Add (_remove_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
-       _add_screen = new wxButton (this, wxID_ANY, _("Add Screen..."));
+       _add_screen = new Button (this, _("Add Screen..."));
        target_buttons->Add (_add_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
-       _edit_screen = new wxButton (this, wxID_ANY, _("Edit Screen..."));
+       _edit_screen = new Button (this, _("Edit Screen..."));
        target_buttons->Add (_edit_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
-       _remove_screen = new wxButton (this, wxID_ANY, _("Remove Screen"));
+       _remove_screen = new Button (this, _("Remove Screen"));
        target_buttons->Add (_remove_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
 
        targets->Add (target_buttons, 0, 0);
index 71817905232aa5011c8f596f8c9be699f2d5c3e9..3e9accde556b91f1b69c72ef04cb09acb21577e7 100644 (file)
@@ -22,6 +22,7 @@
 #include <wx/srchctrl.h>
 #include <wx/treectrl.h>
 #include <boost/shared_ptr.hpp>
+#include <boost/signals2.hpp>
 #include <list>
 #include <map>
 
index dd8353cf4866dc298992d5ba4a90c50fde561fd7..69a7d743d3b6b2e38c2b51d3354d88e2d3770290 100644 (file)
@@ -22,6 +22,7 @@
 #include "rgba_colour_picker.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/string_text_file_content.h"
 #include "lib/text_content.h"
 #include "lib/ffmpeg_subtitle_stream.h"
@@ -112,7 +113,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
 
                overall_sizer->Add (colours_panel, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
-               wxButton* restore = new wxButton (this, wxID_ANY, _("Restore to original colours"));
+               wxButton* restore = new Button (this, _("Restore to original colours"));
                restore->Bind (wxEVT_BUTTON, bind (&SubtitleAppearanceDialog::restore, this));
                overall_sizer->Add (restore, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
        }
index fafac55d61010922e7257856b4ad7cb4b2edc57b..2546412efe2fe36a7151cb8bc5da3cd162ad33bc 100644 (file)
@@ -22,6 +22,7 @@
 #include "film_viewer.h"
 #include "wx_util.h"
 #include "content_view.h"
+#include "dcpomatic_button.h"
 #include "lib/player_video.h"
 #include "lib/dcp_content.h"
 #include <wx/listctrl.h>
@@ -35,9 +36,9 @@ using boost::optional;
 
 SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr<FilmViewer> viewer)
        : Controls (parent, viewer, false)
-       , _play_button (new wxButton(this, wxID_ANY, _("Play")))
-       , _pause_button (new wxButton(this, wxID_ANY, _("Pause")))
-       , _stop_button (new wxButton(this, wxID_ANY, _("Stop")))
+       , _play_button (new Button(this, _("Play")))
+       , _pause_button (new Button(this, _("Pause")))
+       , _stop_button (new Button(this, _("Stop")))
        , _current_disable_timeline (false)
 {
        _button_sizer->Add (_play_button, 0, wxEXPAND);
@@ -156,7 +157,6 @@ SwaroopControls::image_changed (boost::weak_ptr<PlayerVideo> weak_pv)
 
        _current_content = c;
 
-       long int selected = _spl_view->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        if (_selected_playlist) {
                BOOST_FOREACH (SPLEntry i, _playlists[*_selected_playlist].get()) {
                        if (i.content == c) {
index 9b264f264f1842af3d260a06c270ed460fec4feb..4ddd3ad929ac7cc7ada410a0bb03b023d0882ccf 100644 (file)
@@ -21,6 +21,7 @@
 #include "templates_dialog.h"
 #include "wx_util.h"
 #include "rename_template_dialog.h"
+#include "dcpomatic_button.h"
 #include "lib/config.h"
 #include <wx/wx.h>
 #include <boost/foreach.hpp>
@@ -47,9 +48,9 @@ TemplatesDialog::TemplatesDialog (wxWindow* parent)
 
        {
                wxSizer* s = new wxBoxSizer (wxVERTICAL);
-               _rename = new wxButton (this, wxID_ANY, _("Rename..."));
+               _rename = new Button (this, _("Rename..."));
                s->Add (_rename, 0, wxTOP | wxBOTTOM, 2);
-               _remove = new wxButton (this, wxID_ANY, _("Remove"));
+               _remove = new Button (this, _("Remove"));
                s->Add (_remove, 0, wxTOP | wxBOTTOM, 2);
                hs->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
        }
index 31881806f306ef07d7abef4f6b3dd193250cb50f..ed49d8484d4575cfb534201f82701ed7472948b6 100644 (file)
@@ -28,6 +28,7 @@
 #include "subtitle_appearance_dialog.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/string_text_file_content.h"
 #include "lib/ffmpeg_subtitle_stream.h"
@@ -104,9 +105,9 @@ TextPanel::TextPanel (ContentPanel* p, TextType t)
        _stream_label = create_label (this, _("Stream"), true);
        _stream = new wxChoice (this, wxID_ANY);
 
-       _text_view_button = new wxButton (this, wxID_ANY, _("View..."));
-       _fonts_dialog_button = new wxButton (this, wxID_ANY, _("Fonts..."));
-       _appearance_dialog_button = new wxButton (this, wxID_ANY, _("Appearance..."));
+       _text_view_button = new Button (this, _("View..."));
+       _fonts_dialog_button = new Button (this, _("Fonts..."));
+       _appearance_dialog_button = new Button (this, _("Appearance..."));
 
        _x_offset->SetRange (-100, 100);
        _y_offset->SetRange (-100, 100);
index 699687a956f05e77497edaf12629248730968974..754483c0c2ce08407bc11c9d4af682937ac1f095 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include "lib/util.h"
 #include "timecode.h"
 #include "wx_util.h"
+#include "dcpomatic_button.h"
+#include "lib/util.h"
 #include <iostream>
 
 using std::string;
@@ -62,7 +63,7 @@ TimecodeBase::TimecodeBase (wxWindow* parent, bool set_button)
        _frames->SetMaxLength (2);
        editable_sizer->Add (_frames);
        if (set_button) {
-               _set_button = new wxButton (_editable, wxID_ANY, _("Set"));
+               _set_button = new Button (_editable, _("Set"));
                editable_sizer->Add (_set_button, 0, wxLEFT | wxRIGHT, 8);
        }
        _editable->SetSizerAndFit (editable_sizer);
index ebdd99487bff709b9f58e2999e1c40ecfa143068..d47c81a15b1358781dc1c590c94c61947f76f833 100644 (file)
@@ -25,6 +25,7 @@
 #include "content_panel.h"
 #include "move_to_dialog.h"
 #include "static_text.h"
+#include "dcpomatic_button.h"
 #include "lib/content.h"
 #include "lib/image_content.h"
 #include "lib/text_content.h"
@@ -82,21 +83,21 @@ TimingPanel::TimingPanel (ContentPanel* p, weak_ptr<FilmViewer> viewer)
 
        _position_label = create_label (this, _("Position"), true);
        _position = new Timecode<DCPTime> (this);
-       _move_to_start_of_reel = new wxButton (this, wxID_ANY, _("Move to start of reel"));
+       _move_to_start_of_reel = new Button (this, _("Move to start of reel"));
        _full_length_label = create_label (this, _("Full length"), true);
        _full_length = new Timecode<DCPTime> (this);
        _trim_start_label = create_label (this, _("Trim from start"), true);
        _trim_start = new Timecode<ContentTime> (this);
-       _trim_start_to_playhead = new wxButton (this, wxID_ANY, _("Trim up to current position"));
+       _trim_start_to_playhead = new Button (this, _("Trim up to current position"));
        _trim_end_label = create_label (this, _("Trim from end"), true);
        _trim_end = new Timecode<ContentTime> (this);
-       _trim_end_to_playhead = new wxButton (this, wxID_ANY, _("Trim after current position"));
+       _trim_end_to_playhead = new Button (this, _("Trim after current position"));
        _play_length_label = create_label (this, _("Play length"), true);
        _play_length = new Timecode<DCPTime> (this);
 
        _video_frame_rate_label = create_label (this, _("Video frame rate"), true);
        _video_frame_rate = new wxTextCtrl (this, wxID_ANY);
-       _set_video_frame_rate = new wxButton (this, wxID_ANY, _("Set"));
+       _set_video_frame_rate = new Button (this, _("Set"));
        _set_video_frame_rate->Enable (false);
 
        /* We can't use Wrap() here as it doesn't work with markup:
index aaafe34c1706589b6dced5fe30b16e2e022fd3f6..605d4ff68e48852542a57647b4f39b5276f00b25 100644 (file)
@@ -26,6 +26,7 @@
 #include "content_panel.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/filter.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/colour_conversion.h"
@@ -160,7 +161,7 @@ VideoPanel::VideoPanel (ContentPanel* p)
 
        _filters_label = create_label (this, _("Filters"), true);
        _filters = new StaticText (this, _("None"), wxDefaultPosition, size);
-       _filters_button = new wxButton (this, wxID_ANY, _("Edit..."));
+       _filters_button = new Button (this, _("Edit..."));
 
        _colour_conversion_label = create_label (this, _("Colour conversion"), true);
        _colour_conversion = new wxChoice (this, wxID_ANY, wxDefaultPosition, size);
@@ -171,7 +172,7 @@ VideoPanel::VideoPanel (ContentPanel* p)
 
        /// TRANSLATORS: translate the word "Custom" here; do not include the "Colour|" prefix
        _colour_conversion->Append (S_("Colour|Custom"));
-       _edit_colour_conversion_button = new wxButton (this, wxID_ANY, _("Edit..."));
+       _edit_colour_conversion_button = new Button (this, _("Edit..."));
 
        _description = new StaticText (this, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
        _description->SetFont(font);
index a8c14677dc63f808685cdef943bf1421fc6a7729..358d98d70301ce40361af620a38921d922bb9766 100644 (file)
@@ -33,9 +33,6 @@ sources = """
           audio_plot.cc
           barco_alchemy_certificate_panel.cc
           batch_job_view.cc
-          subtitle_appearance_dialog.cc
-          text_panel.cc
-          text_view.cc
           check_box.cc
           christie_certificate_panel.cc
           cinema_dialog.cc
@@ -52,6 +49,7 @@ sources = """
           controls.cc
           closed_captions_dialog.cc
           dcp_panel.cc
+          dcpomatic_button.cc
           email_dialog.cc
           image_sequence_dialog.cc
           isdcf_metadata_dialog.cc
@@ -113,10 +111,13 @@ sources = """
           servers_list_dialog.cc
           standard_controls.cc
           static_text.cc
+          subtitle_appearance_dialog.cc
           swaroop_controls.cc
           system_font_dialog.cc
           table_dialog.cc
           templates_dialog.cc
+          text_panel.cc
+          text_view.cc
           time_picker.cc
           timecode.cc
           timeline.cc