diff options
Diffstat (limited to 'src/gui/PatchView.cpp')
-rw-r--r-- | src/gui/PatchView.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index 1c5c2c51..6e2ff1cd 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -107,6 +107,12 @@ PatchView::set_patch(SharedPtr<PatchModel> patch) _poly_spin->signal_value_changed().connect( sigc::mem_fun(*this, &PatchView::poly_changed)); + _canvas->signal_port_entered.connect( + sigc::mem_fun(*this, &PatchView::canvas_port_entered)); + + _canvas->signal_item_entered.connect( + sigc::mem_fun(*this, &PatchView::canvas_item_entered)); + _canvas->grab_focus(); } @@ -121,7 +127,8 @@ SharedPtr<PatchView> PatchView::create(SharedPtr<PatchModel> patch) { - const Glib::RefPtr<Gnome::Glade::Xml>& xml = GladeFactory::new_glade_reference("patch_view_box"); + +const Glib::RefPtr<Gnome::Glade::Xml>& xml = GladeFactory::new_glade_reference("patch_view_box"); PatchView* result = NULL; xml->get_widget_derived("patch_view_box", result); assert(result); @@ -148,6 +155,24 @@ PatchView::editable_toggled() void +PatchView::canvas_port_entered(FlowCanvas::Port* port) +{ + Port* p = dynamic_cast<Port*>(port); + if (p) + signal_object_entered.emit(p->model().get()); +} + + +void +PatchView::canvas_item_entered(FlowCanvas::Item* item) +{ + NodeModule* m = dynamic_cast<NodeModule*>(item); + if (m) + signal_object_entered.emit(m->node().get()); +} + + +void PatchView::process_toggled() { if (!_enable_signal) |