summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view_item.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-04-25 16:06:12 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-04-25 16:06:12 -0400
commit7de31d5a41da673c13711d3a1ae3aa038f588821 (patch)
tree66b783ee9f7bff1be3908e8c630df8be4efa56db /gtk2_ardour/time_axis_view_item.cc
parentb604dd24139b4c84f20521af91ec4c0cd721bd13 (diff)
use virtual bool canvas_group_event () in TimeAxisViewItems to get suitably delegatable/inherited event handling
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r--gtk2_ardour/time_axis_view_item.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index 76a21ce4aa..b25ed5a934 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -111,10 +111,7 @@ TimeAxisViewItem::TimeAxisViewItem(
, _automation (automation)
, _dragging (false)
{
- group = new ArdourCanvas::Group (&parent);
- CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", it_name));
-
- init (it_name, spu, base_color, start, duration, vis, true, true);
+ init (it_name, &parent, spu, base_color, start, duration, vis, true, true);
}
TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
@@ -136,21 +133,22 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
/* share the other's parent, but still create a new group */
ArdourCanvas::Group* parent = other.group->parent();
-
- group = new ArdourCanvas::Group (parent);
- CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
-
+
_selected = other._selected;
-
- init (other.item_name, other.samples_per_pixel, c, other.frame_position,
+
+ init (other.item_name, parent, other.samples_per_pixel, c, other.frame_position,
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
}
void
-TimeAxisViewItem::init (const string& it_name, double fpp, Gdk::Color const & base_color,
+TimeAxisViewItem::init (const string& it_name, ArdourCanvas::Group* parent, double fpp, Gdk::Color const & base_color,
framepos_t start, framepos_t duration, Visibility vis,
bool wide, bool high)
{
+ group = new ArdourCanvas::Group (parent);
+ CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
+ group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
+
item_name = it_name;
samples_per_pixel = fpp;
frame_position = start;
@@ -266,6 +264,12 @@ TimeAxisViewItem::~TimeAxisViewItem()
delete group;
}
+bool
+TimeAxisViewItem::canvas_group_event (GdkEvent* ev)
+{
+ return false;
+}
+
void
TimeAxisViewItem::hide_rect ()
{