summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-05 02:38:40 +0000
committerDavid Robillard <d@drobilla.net>2012-04-05 02:38:40 +0000
commitabcc960e3a6a41973e8cd66fc528faf76745ffb8 (patch)
tree9d0f1674ad56b3de2f37ddb86119780f08a06da6
parentaa399711b4d87d9fbe9b116559aff5271177d416 (diff)
downloadingen-abcc960e3a6a41973e8cd66fc528faf76745ffb8.tar.gz
ingen-abcc960e3a6a41973e8cd66fc528faf76745ffb8.tar.bz2
ingen-abcc960e3a6a41973e8cd66fc528faf76745ffb8.zip
Fix subpatch creation (fix #826).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4144 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/gui/NodeModule.cpp14
-rw-r--r--src/gui/NodeModule.hpp2
-rw-r--r--src/gui/PatchBox.cpp11
-rw-r--r--src/gui/PatchWindow.cpp14
-rw-r--r--src/gui/PatchWindow.hpp2
-rw-r--r--src/gui/SubpatchModule.cpp3
-rw-r--r--src/gui/SubpatchModule.hpp2
7 files changed, 25 insertions, 23 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index eb278e51..9719ed67 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -354,15 +354,21 @@ NodeModule::show_control_window()
}
bool
+NodeModule::on_double_click(GdkEventButton* event)
+{
+ if (!popup_gui()) {
+ show_control_window();
+ }
+ return true;
+}
+
+bool
NodeModule::on_event(GdkEvent* ev)
{
if (ev->type == GDK_BUTTON_PRESS && ev->button.button == 3) {
return show_menu(&ev->button);
} else if (ev->type == GDK_2BUTTON_PRESS) {
- if (!popup_gui()) {
- show_control_window();
- }
- return true;
+ return on_double_click(&ev->button);
}
return false;
}
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index e16672f0..a0dd3417 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -68,6 +68,8 @@ public:
protected:
NodeModule(PatchCanvas& canvas, SharedPtr<const NodeModel> node);
+ virtual bool on_double_click(GdkEventButton* ev);
+
bool on_event(GdkEvent* ev);
void show_control_window();
diff --git a/src/gui/PatchBox.cpp b/src/gui/PatchBox.cpp
index 61f2fb9f..11921fa6 100644
--- a/src/gui/PatchBox.cpp
+++ b/src/gui/PatchBox.cpp
@@ -198,7 +198,16 @@ PatchBox::init_box(App& app)
void
PatchBox::set_patch_from_path(const Raul::Path& path, SharedPtr<PatchView> view)
{
- std::cerr << "FIXME: Set patch from path" << std::endl;
+ if (view) {
+ assert(view->patch()->path() == path);
+ _app->window_factory()->present_patch(view->patch(), _window, view);
+ } else {
+ SharedPtr<const PatchModel> model = PtrCast<const PatchModel>(
+ _app->store()->object(path));
+ if (model) {
+ _app->window_factory()->present_patch(model, _window);
+ }
+ }
}
/** Sets the patch for this box and initializes everything.
diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp
index 6b3bc7a6..526b7fec 100644
--- a/src/gui/PatchWindow.cpp
+++ b/src/gui/PatchWindow.cpp
@@ -56,20 +56,6 @@ PatchWindow::init_window(App& app)
}
void
-PatchWindow::set_patch_from_path(const Raul::Path& path, SharedPtr<PatchView> view)
-{
- if (view) {
- assert(view->patch()->path() == path);
- _app->window_factory()->present_patch(view->patch(), this, view);
- } else {
- SharedPtr<const PatchModel> model = PtrCast<const PatchModel>(
- _app->store()->object(path));
- if (model)
- _app->window_factory()->present_patch(model, this);
- }
-}
-
-void
PatchWindow::on_show()
{
if (_position_stored)
diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp
index 9ed46a40..c1540c66 100644
--- a/src/gui/PatchWindow.hpp
+++ b/src/gui/PatchWindow.hpp
@@ -50,8 +50,6 @@ public:
SharedPtr<const PatchModel> patch() const { return _box->patch(); }
PatchBox* box() const { return _box; }
- void set_patch_from_path(const Raul::Path& path, SharedPtr<PatchView> view);
-
void show_documentation(const std::string& doc, bool html) {
_box->show_documentation(doc, html);
}
diff --git a/src/gui/SubpatchModule.cpp b/src/gui/SubpatchModule.cpp
index bf0ecd95..3960b4fd 100644
--- a/src/gui/SubpatchModule.cpp
+++ b/src/gui/SubpatchModule.cpp
@@ -45,7 +45,7 @@ SubpatchModule::SubpatchModule(PatchCanvas& canvas,
assert(patch);
}
-void
+bool
SubpatchModule::on_double_click(GdkEventButton* event)
{
assert(_patch);
@@ -57,6 +57,7 @@ SubpatchModule::on_double_click(GdkEventButton* event)
: app().window_factory()->patch_window(parent) );
app().window_factory()->present_patch(_patch, preferred);
+ return true;
}
void
diff --git a/src/gui/SubpatchModule.hpp b/src/gui/SubpatchModule.hpp
index f72ed6bf..93a7b647 100644
--- a/src/gui/SubpatchModule.hpp
+++ b/src/gui/SubpatchModule.hpp
@@ -49,7 +49,7 @@ public:
virtual ~SubpatchModule() {}
- void on_double_click(GdkEventButton* ev);
+ bool on_double_click(GdkEventButton* ev);
void store_location(double x, double y);