summaryrefslogtreecommitdiff
path: root/libs/canvas/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/canvas/item.cc')
-rw-r--r--libs/canvas/item.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/libs/canvas/item.cc b/libs/canvas/item.cc
index 9be1f62d92..5aef4cc779 100644
--- a/libs/canvas/item.cc
+++ b/libs/canvas/item.cc
@@ -45,6 +45,8 @@ Item::Item (Canvas* canvas)
, _lut (0)
, _ignore_events (false)
{
+ _tooltip = "This is a tooltip";
+
DEBUG_TRACE (DEBUG::CanvasItems, string_compose ("new canvas item %1\n", this));
}
@@ -59,6 +61,8 @@ Item::Item (Item* parent)
, _lut (0)
, _ignore_events (false)
{
+ _tooltip = "This is a tooltip";
+
DEBUG_TRACE (DEBUG::CanvasItems, string_compose ("new canvas item %1\n", this));
if (parent) {
@@ -80,6 +84,8 @@ Item::Item (Item* parent, Duple const& p)
, _lut (0)
, _ignore_events (false)
{
+ _tooltip = "This is a tooltip";
+
DEBUG_TRACE (DEBUG::CanvasItems, string_compose ("new canvas item %1\n", this));
if (parent) {
@@ -982,6 +988,26 @@ Item::add_items_at_point (Duple const point, vector<Item const *>& items) const
}
void
+Item::set_tooltip (const std::string& s)
+{
+ _tooltip = s;
+}
+
+void
+Item::start_tooltip_timeout ()
+{
+ if (!_tooltip.empty()) {
+ _canvas->start_tooltip_timeout (this);
+ }
+}
+
+void
+Item::stop_tooltip_timeout ()
+{
+ _canvas->stop_tooltip_timeout ();
+}
+
+void
Item::dump (ostream& o) const
{
boost::optional<ArdourCanvas::Rect> bb = bounding_box();