summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-12-08 01:11:35 +0000
committerCarl Hetherington <cth@carlh.net>2018-12-08 01:11:35 +0000
commit8b2a3f31b6b4238d8534549f495e7276174ddfba (patch)
treeb8c55a3ff05f488044d98871da46a0e4f52f306d /src
parent9c1bb2e5ca7c80c4e26b1b2e41159aa171360a94 (diff)
Support buttons.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic_batch.cc7
-rw-r--r--src/tools/dcpomatic_kdm.cc9
-rw-r--r--src/tools/dcpomatic_playlist.cc12
-rw-r--r--src/wx/audio_panel.cc5
-rw-r--r--src/wx/batch_job_view.cc5
-rw-r--r--src/wx/config_dialog.cc25
-rw-r--r--src/wx/content_panel.cc15
-rw-r--r--src/wx/controls.cc7
-rw-r--r--src/wx/dcp_panel.cc11
-rw-r--r--src/wx/dcpomatic_button.cc40
-rw-r--r--src/wx/dcpomatic_button.h36
-rw-r--r--src/wx/dir_picker_ctrl.cc3
-rw-r--r--src/wx/download_certificate_dialog.cc3
-rw-r--r--src/wx/editable_list.h7
-rw-r--r--src/wx/file_picker_ctrl.cc3
-rw-r--r--src/wx/font_files_dialog.cc5
-rw-r--r--src/wx/fonts_dialog.cc3
-rw-r--r--src/wx/full_config_dialog.cc11
-rw-r--r--src/wx/job_view.cc5
-rw-r--r--src/wx/kdm_cpl_panel.cc3
-rw-r--r--src/wx/kdm_dialog.cc3
-rw-r--r--src/wx/kdm_output_panel.cc3
-rw-r--r--src/wx/key_dialog.cc3
-rw-r--r--src/wx/normal_job_view.cc3
-rw-r--r--src/wx/player_config_dialog.cc2
-rw-r--r--src/wx/screen_dialog.cc7
-rw-r--r--src/wx/screens_panel.cc21
-rw-r--r--src/wx/screens_panel.h1
-rw-r--r--src/wx/subtitle_appearance_dialog.cc3
-rw-r--r--src/wx/swaroop_controls.cc8
-rw-r--r--src/wx/templates_dialog.cc5
-rw-r--r--src/wx/text_panel.cc7
-rw-r--r--src/wx/timecode.cc7
-rw-r--r--src/wx/timing_panel.cc9
-rw-r--r--src/wx/video_panel.cc5
-rw-r--r--src/wx/wscript7
36 files changed, 208 insertions, 101 deletions
diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc
index ac57baf4b..ca5b4cfe1 100644
--- a/src/tools/dcpomatic_batch.cc
+++ b/src/tools/dcpomatic_batch.cc
@@ -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);
diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc
index 999bba17e..c8ab3cbfb 100644
--- a/src/tools/dcpomatic_kdm.cc
+++ b/src/tools/dcpomatic_kdm.cc
@@ -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);
diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc
index c9ceadb26..bee920501 100644
--- a/src/tools/dcpomatic_playlist.cc
+++ b/src/tools/dcpomatic_playlist.cc
@@ -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);
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc
index 34292620b..1c6ed1583 100644
--- a/src/wx/audio_panel.cc
+++ b/src/wx/audio_panel.cc
@@ -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> (
diff --git a/src/wx/batch_job_view.cc b/src/wx/batch_job_view.cc
index 853dac8f4..038e8b228 100644
--- a/src/wx/batch_job_view.cc
+++ b/src/wx/batch_job_view.cc
@@ -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);
}
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index 1066a88b0..ccf1202ec 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -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));
}
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 254f1befb..e72ca28a1 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -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);
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index 08d3a9460..3df62fd31 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -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("")))
{
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index ded073152..a01db9be3 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -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
index 000000000..de26629a9
--- /dev/null
+++ b/src/wx/dcpomatic_button.cc
@@ -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
index 000000000..682fa5fe6
--- /dev/null
+++ b/src/wx/dcpomatic_button.h
@@ -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
diff --git a/src/wx/dir_picker_ctrl.cc b/src/wx/dir_picker_ctrl.cc
index ffd3b6fa1..b05e73273 100644
--- a/src/wx/dir_picker_ctrl.cc
+++ b/src/wx/dir_picker_ctrl.cc
@@ -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);
diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc
index 21a675ac7..45b34c703 100644
--- a/src/wx/download_certificate_dialog.cc
+++ b/src/wx/download_certificate_dialog.cc
@@ -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 (""));
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h
index eb06f4cf8..a7c1a6102 100644
--- a/src/wx/editable_list.h
+++ b/src/wx/editable_list.h
@@ -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);
}
diff --git a/src/wx/file_picker_ctrl.cc b/src/wx/file_picker_ctrl.cc
index 4cd843feb..47b5dbca0 100644
--- a/src/wx/file_picker_ctrl.cc
+++ b/src/wx/file_picker_ctrl.cc
@@ -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);
diff --git a/src/wx/font_files_dialog.cc b/src/wx/font_files_dialog.cc
index 7fd4f9d99..e85c37fa7 100644
--- a/src/wx/font_files_dialog.cc
+++ b/src/wx/font_files_dialog.cc
@@ -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
}
diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc
index 3619b7e0a..0660eea39 100644
--- a/src/wx/fonts_dialog.cc
+++ b/src/wx/fonts_dialog.cc
@@ -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);
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index 8e176b4d6..2f1db11c2 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -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));
diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc
index 28b171b82..174c9967d 100644
--- a/src/wx/job_view.cc
+++ b/src/wx/job_view.cc
@@ -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);
diff --git a/src/wx/kdm_cpl_panel.cc b/src/wx/kdm_cpl_panel.cc
index d710d88aa..db05db27c 100644
--- a/src/wx/kdm_cpl_panel.cc
+++ b/src/wx/kdm_cpl_panel.cc
@@ -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);
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index f59250750..55364f597 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -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 */
diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc
index 1e222591d..bcaad33e4 100644
--- a/src/wx/kdm_output_panel.cc
+++ b/src/wx/kdm_output_panel.cc
@@ -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);
diff --git a/src/wx/key_dialog.cc b/src/wx/key_dialog.cc
index 414e61d37..2d8cd4c37 100644
--- a/src/wx/key_dialog.cc
+++ b/src/wx/key_dialog.cc
@@ -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));
diff --git a/src/wx/normal_job_view.cc b/src/wx/normal_job_view.cc
index 22b3e1cc7..ada0596c8 100644
--- a/src/wx/normal_job_view.cc
+++ b/src/wx/normal_job_view.cc
@@ -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);
}
diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc
index ca65711a7..254a84c8a 100644
--- a/src/wx/player_config_dialog.cc
+++ b/src/wx/player_config_dialog.cc
@@ -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));
}
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc
index e8361dcd8..6bfc0da4c 100644
--- a/src/wx/screen_dialog.cc
+++ b/src/wx/screen_dialog.cc
@@ -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);
diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc
index 908e94f4d..e89173eb2 100644
--- a/src/wx/screens_panel.cc
+++ b/src/wx/screens_panel.cc
@@ -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.
@@ -18,13 +18,14 @@
*/
-#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);
diff --git a/src/wx/screens_panel.h b/src/wx/screens_panel.h
index 718179052..3e9accde5 100644
--- a/src/wx/screens_panel.h
+++ b/src/wx/screens_panel.h
@@ -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>
diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc
index dd8353cf4..69a7d743d 100644
--- a/src/wx/subtitle_appearance_dialog.cc
+++ b/src/wx/subtitle_appearance_dialog.cc
@@ -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);
}
diff --git a/src/wx/swaroop_controls.cc b/src/wx/swaroop_controls.cc
index fafac55d6..2546412ef 100644
--- a/src/wx/swaroop_controls.cc
+++ b/src/wx/swaroop_controls.cc
@@ -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) {
diff --git a/src/wx/templates_dialog.cc b/src/wx/templates_dialog.cc
index 9b264f264..4ddd3ad92 100644
--- a/src/wx/templates_dialog.cc
+++ b/src/wx/templates_dialog.cc
@@ -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);
}
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index 31881806f..ed49d8484 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -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);
diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc
index 699687a95..754483c0c 100644
--- a/src/wx/timecode.cc
+++ b/src/wx/timecode.cc
@@ -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.
@@ -18,9 +18,10 @@
*/
-#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);
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index ebdd99487..d47c81a15 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -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:
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index aaafe34c1..605d4ff68 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -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);
diff --git a/src/wx/wscript b/src/wx/wscript
index a8c14677d..358d98d70 100644
--- a/src/wx/wscript
+++ b/src/wx/wscript
@@ -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