summaryrefslogtreecommitdiff
path: root/src/wx/content_sub_panel.cc
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 /src/wx/content_sub_panel.cc
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).
Diffstat (limited to 'src/wx/content_sub_panel.cc')
-rw-r--r--src/wx/content_sub_panel.cc17
1 files changed, 12 insertions, 5 deletions
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 ();
}