summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-03-27 23:43:43 +0100
committerCarl Hetherington <cth@carlh.net>2018-03-27 23:43:43 +0100
commit3ae67788dcb1567c5d6df65e89cd84bf484e82be (patch)
tree85d98b37e621b32a01785b5be13f763ae0167f22
parent47c34c6c7c82396b62e101283cb25b8726dbaefd (diff)
Use a label rather than a tooltip to tell users why they can't refer to DCPs.
Tooltips don't seem to work on disabled widgets in Windows (at least).
-rw-r--r--ChangeLog5
-rw-r--r--src/wx/audio_panel.cc24
-rw-r--r--src/wx/audio_panel.h1
-rw-r--r--src/wx/content_sub_panel.cc17
-rw-r--r--src/wx/content_sub_panel.h2
-rw-r--r--src/wx/subtitle_panel.cc21
-rw-r--r--src/wx/subtitle_panel.h1
-rw-r--r--src/wx/video_panel.cc24
-rw-r--r--src/wx/video_panel.h1
9 files changed, 69 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index 709ca463a..129e9ce2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-27 Carl Hetherington <cth@carlh.net>
+
+ * Use a label rather than a tooltip to tell users why they can't
+ refer to DCPs.
+
2018-03-26 Carl Hetherington <cth@carlh.net>
* Add real-time mouse cursor readout in audio analysis (rest of #1082)
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc
index 14d8db07e..b60d5d121 100644
--- a/src/wx/audio_panel.cc
+++ b/src/wx/audio_panel.cc
@@ -48,15 +48,26 @@ AudioPanel::AudioPanel (ContentPanel* p)
: ContentSubPanel (p, _("Audio"))
, _audio_dialog (0)
{
+ wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
+
+ _reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's audio as OV and make VF"));
+ reference_sizer->Add (_reference, 0, wxLEFT | wxRIGHT | wxTOP, DCPOMATIC_SIZER_GAP);
+
+ _reference_note = new wxStaticText (this, wxID_ANY, _(""));
+ _reference_note->Wrap (200);
+ reference_sizer->Add (_reference_note, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
+ wxFont font = _reference_note->GetFont();
+ font.SetStyle(wxFONTSTYLE_ITALIC);
+ font.SetPointSize(font.GetPointSize() - 1);
+ _reference_note->SetFont(font);
+
+ _sizer->Add (reference_sizer);
+
wxGridBagSizer* grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
_sizer->Add (grid, 0, wxALL, 8);
int r = 0;
- _reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's audio as OV and make VF"));
- grid->Add (_reference, wxGBPosition (r, 0), wxGBSpan (1, 3));
- ++r;
-
_show = new wxButton (this, wxID_ANY, _("Show graph of audio levels..."));
grid->Add (_show, wxGBPosition (r, 0), wxGBSpan (1, 2));
_peak = new wxStaticText (this, wxID_ANY, wxT (""));
@@ -100,9 +111,6 @@ AudioPanel::AudioPanel (ContentPanel* p)
_description = new wxStaticText (this, wxID_ANY, wxT (" \n"), wxDefaultPosition, wxDefaultSize);
_sizer->Add (_description, 0, wxALL, 12);
- wxFont font = _description->GetFont();
- font.SetStyle (wxFONTSTYLE_ITALIC);
- font.SetPointSize (font.GetPointSize() - 1);
_description->SetFont (font);
++r;
@@ -269,7 +277,7 @@ AudioPanel::setup_sensitivity ()
string why_not;
bool const can_reference = dcp && dcp->can_reference_audio (why_not);
- setup_refer_button (_reference, dcp, can_reference, why_not);
+ setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
if (_reference->GetValue ()) {
_gain->wrapped()->Enable (false);
diff --git a/src/wx/audio_panel.h b/src/wx/audio_panel.h
index ede0ddb26..5551b396d 100644
--- a/src/wx/audio_panel.h
+++ b/src/wx/audio_panel.h
@@ -51,6 +51,7 @@ private:
void reference_clicked ();
wxCheckBox* _reference;
+ wxStaticText* _reference_note;
wxButton* _show;
ContentSpinCtrlDouble<AudioContent>* _gain;
wxButton* _gain_calculate_button;
diff --git a/src/wx/content_sub_panel.cc b/src/wx/content_sub_panel.cc
index 92eb5a32f..dc6c1d2b8 100644
--- a/src/wx/content_sub_panel.cc
+++ b/src/wx/content_sub_panel.cc
@@ -42,16 +42,23 @@ ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name)
}
void
-ContentSubPanel::setup_refer_button (wxCheckBox* button, shared_ptr<DCPContent> dcp, bool can_reference, string why_not) const
+ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, shared_ptr<DCPContent> dcp, bool can_reference, string why_not) const
{
button->Enable (can_reference);
wxString s;
- if (!dcp) {
- s = _("No DCP selected.");
- } else if (!can_reference) {
+ if (dcp && !can_reference) {
s = _("Cannot reference this DCP. ") + std_to_wx(why_not);
}
- button->SetToolTip (s);
+ note->SetLabel (s);
+ note->Wrap (400);
+
+ if (s.IsEmpty ()) {
+ note->Hide ();
+ } else {
+ note->Show ();
+ }
+
+ _sizer->Layout ();
}
diff --git a/src/wx/content_sub_panel.h b/src/wx/content_sub_panel.h
index fb22b3a22..9afd50d40 100644
--- a/src/wx/content_sub_panel.h
+++ b/src/wx/content_sub_panel.h
@@ -42,7 +42,7 @@ public:
protected:
- void setup_refer_button (wxCheckBox* button, boost::shared_ptr<DCPContent> dcp, bool can_reference, std::string why_not) const;
+ void setup_refer_button (wxCheckBox* button, wxStaticText* note, boost::shared_ptr<DCPContent> dcp, bool can_reference, std::string why_not) const;
ContentPanel* _parent;
wxSizer* _sizer;
diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc
index 5bba1ec2c..ff215c31d 100644
--- a/src/wx/subtitle_panel.cc
+++ b/src/wx/subtitle_panel.cc
@@ -48,14 +48,25 @@ SubtitlePanel::SubtitlePanel (ContentPanel* p)
, _subtitle_view (0)
, _fonts_dialog (0)
{
+ wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
+
+ _reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's subtitle as OV and make VF"));
+ reference_sizer->Add (_reference, 0, wxLEFT | wxRIGHT | wxTOP, DCPOMATIC_SIZER_GAP);
+
+ _reference_note = new wxStaticText (this, wxID_ANY, _(""));
+ _reference_note->Wrap (200);
+ reference_sizer->Add (_reference_note, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
+ wxFont font = _reference_note->GetFont();
+ font.SetStyle(wxFONTSTYLE_ITALIC);
+ font.SetPointSize(font.GetPointSize() - 1);
+ _reference_note->SetFont(font);
+
+ _sizer->Add (reference_sizer);
+
wxGridBagSizer* grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
_sizer->Add (grid, 0, wxALL, 8);
int r = 0;
- _reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's subtitle as OV and make VF"));
- grid->Add (_reference, wxGBPosition (r, 0), wxGBSpan (1, 2));
- ++r;
-
_use = new wxCheckBox (this, wxID_ANY, _("Use subtitles"));
grid->Add (_use, wxGBPosition (r, 0), wxGBSpan (1, 2));
++r;
@@ -277,7 +288,7 @@ SubtitlePanel::setup_sensitivity ()
string why_not;
bool const can_reference = dcp && dcp->can_reference_subtitle (why_not);
- setup_refer_button (_reference, dcp, can_reference, why_not);
+ setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
bool const reference = _reference->GetValue ();
diff --git a/src/wx/subtitle_panel.h b/src/wx/subtitle_panel.h
index 5e619a995..cb69e676e 100644
--- a/src/wx/subtitle_panel.h
+++ b/src/wx/subtitle_panel.h
@@ -52,6 +52,7 @@ private:
void setup_sensitivity ();
wxCheckBox* _reference;
+ wxStaticText* _reference_note;
wxCheckBox* _use;
wxCheckBox* _burn;
wxSpinCtrl* _x_offset;
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index 5fbe518c4..2c6b4597d 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -74,15 +74,26 @@ scale_to_index (VideoContentScale scale)
VideoPanel::VideoPanel (ContentPanel* p)
: ContentSubPanel (p, _("Video"))
{
+ wxBoxSizer* reference_sizer = new wxBoxSizer (wxVERTICAL);
+
+ _reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's video as OV and make VF"));
+ reference_sizer->Add (_reference, 0, wxLEFT | wxRIGHT | wxTOP, DCPOMATIC_SIZER_GAP);
+
+ _reference_note = new wxStaticText (this, wxID_ANY, _(""));
+ _reference_note->Wrap (200);
+ reference_sizer->Add (_reference_note, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
+ wxFont font = _reference_note->GetFont();
+ font.SetStyle(wxFONTSTYLE_ITALIC);
+ font.SetPointSize(font.GetPointSize() - 1);
+ _reference_note->SetFont(font);
+
+ _sizer->Add (reference_sizer);
+
wxGridBagSizer* grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
_sizer->Add (grid, 0, wxALL, 8);
int r = 0;
- _reference = new wxCheckBox (this, wxID_ANY, _("Use this DCP's video as OV and make VF"));
- grid->Add (_reference, wxGBPosition (r, 0), wxGBSpan (1, 2));
- ++r;
-
add_label_to_sizer (grid, this, _("Type"), true, wxGBPosition (r, 0));
_frame_type = new ContentChoice<VideoContent, VideoFrameType> (
this,
@@ -215,9 +226,6 @@ VideoPanel::VideoPanel (ContentPanel* p)
_description = new wxStaticText (this, wxID_ANY, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
grid->Add (_description, wxGBPosition (r, 0), wxGBSpan (1, 4), wxEXPAND | wxALIGN_CENTER_VERTICAL, 6);
- wxFont font = _description->GetFont();
- font.SetStyle(wxFONTSTYLE_ITALIC);
- font.SetPointSize(font.GetPointSize() - 1);
_description->SetFont(font);
++r;
@@ -464,7 +472,7 @@ VideoPanel::setup_sensitivity ()
string why_not;
bool const can_reference = dcp && dcp->can_reference_video (why_not);
- setup_refer_button (_reference, dcp, can_reference, why_not);
+ setup_refer_button (_reference, _reference_note, dcp, can_reference, why_not);
if (_reference->GetValue ()) {
_frame_type->wrapped()->Enable (false);
diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h
index 2be7eb049..a1579bf62 100644
--- a/src/wx/video_panel.h
+++ b/src/wx/video_panel.h
@@ -57,6 +57,7 @@ private:
void setup_sensitivity ();
wxCheckBox* _reference;
+ wxStaticText* _reference_note;
ContentChoice<VideoContent, VideoFrameType>* _frame_type;
ContentSpinCtrl<VideoContent>* _left_crop;
ContentSpinCtrl<VideoContent>* _right_crop;