From 3fbbae59dc5f6ea3f610777fa19199a29f48ac91 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 1 Dec 2011 03:40:57 +0000 Subject: Remove menu stuff from FlowCanvas. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3717 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/NodeModule.cpp | 9 +++++++++ src/gui/NodeModule.hpp | 1 + src/gui/PatchCanvas.cpp | 2 +- src/gui/PatchPortModule.cpp | 1 - src/gui/Port.cpp | 9 +++++++++ src/gui/Port.hpp | 1 + 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 420bcb28..f30e2fc4 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -77,6 +77,15 @@ NodeModule::~NodeModule() delete win; // Will be removed from window factory via signal } +bool +NodeModule::on_click(GdkEventButton* ev) +{ + if (ev->button == 3) { + return show_menu(ev); + } + return false; +} + bool NodeModule::show_menu(GdkEventButton* ev) { diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 60b4cb86..c0cf3ec5 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -69,6 +69,7 @@ public: protected: NodeModule(PatchCanvas& canvas, SharedPtr node); + bool on_click(GdkEventButton* ev); void on_double_click(GdkEventButton* ev); void show_control_window(); diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 9e8b232b..af68bbae 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -145,7 +145,7 @@ PatchCanvas::PatchCanvas(App& app, } void -PatchCanvas::show_menu(bool position, unsigned button, uint32_t time) +PatchCanvas::show_menu(bool position, unsigned button, uint32_t time) { if (!_internal_menu) build_menus(); diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index 51669f6d..670de9e9 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -79,7 +79,6 @@ PatchPortModule::app() const bool PatchPortModule::show_menu(GdkEventButton* ev) { - std::cout << "PPM SHOW MENU" << std::endl; return _port->show_menu(ev); } diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index a7153ff3..dc7d0254 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -162,6 +162,15 @@ Port::on_event(GdkEvent* ev) break; } + return Object::on_event(ev); +} + +bool +Port::on_click(GdkEventButton* ev) +{ + if (ev->button == 3) { + return show_menu(ev); + } return false; } diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp index 8a8d901f..e63401d5 100644 --- a/src/gui/Port.hpp +++ b/src/gui/Port.hpp @@ -74,6 +74,7 @@ private: void property_changed(const Raul::URI& key, const Raul::Atom& value); bool on_event(GdkEvent* ev); + bool on_click(GdkEventButton* ev); void moved(); //static ArtVpathDash* _dash; -- cgit v1.2.1