Tooltips don't seem to work on disabled widgets in Windows (at least).
+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)
: 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 (""));
_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;
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);
void reference_clicked ();
wxCheckBox* _reference;
+ wxStaticText* _reference_note;
wxButton* _show;
ContentSpinCtrlDouble<AudioContent>* _gain;
wxButton* _gain_calculate_button;
}
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 ();
}
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;
, _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;
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 ();
void setup_sensitivity ();
wxCheckBox* _reference;
+ wxStaticText* _reference_note;
wxCheckBox* _use;
wxCheckBox* _burn;
wxSpinCtrl* _x_offset;
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,
_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;
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);
void setup_sensitivity ();
wxCheckBox* _reference;
+ wxStaticText* _reference_note;
ContentChoice<VideoContent, VideoFrameType>* _frame_type;
ContentSpinCtrl<VideoContent>* _left_crop;
ContentSpinCtrl<VideoContent>* _right_crop;