summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-06 05:09:37 +0000
committerDavid Robillard <d@drobilla.net>2011-12-06 05:09:37 +0000
commita5f256cf923d165afd273914a13726d745a59cbc (patch)
tree6a6df04779f361f727de6bb04a2761a201f7647b
parent1a3615279866b201f842ea95addfa0cbb7731d6d (diff)
downloadingen-a5f256cf923d165afd273914a13726d745a59cbc.tar.gz
ingen-a5f256cf923d165afd273914a13726d745a59cbc.tar.bz2
ingen-a5f256cf923d165afd273914a13726d745a59cbc.zip
Death to Module.cpp.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3817 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/gui/NodeModule.cpp16
-rw-r--r--src/gui/NodeModule.hpp2
-rw-r--r--src/gui/PatchCanvas.cpp2
3 files changed, 6 insertions, 14 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 8d7dd702..497e6a0a 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -81,15 +81,6 @@ NodeModule::~NodeModule()
}
bool
-NodeModule::on_click(GdkEventButton* ev)
-{
- if (ev->button == 3) {
- return show_menu(ev);
- }
- return false;
-}
-
-bool
NodeModule::show_menu(GdkEventButton* ev)
{
WidgetFactory::get_widget_derived("object_menu", _menu);
@@ -221,6 +212,7 @@ NodeModule::embed_gui(bool embed)
Gtk::Container* container = new Gtk::EventBox();
container->set_name("ingen_embedded_node_gui_container");
+ container->set_border_width(2.0);
container->add(*_gui_widget);
FlowCanvas::Module::embed(container);
} else {
@@ -249,7 +241,7 @@ NodeModule::embed_gui(bool embed)
false);
}
- if (embed && _embed_item) {
+ if (embed) {
set_control_values();
}
}
@@ -363,7 +355,9 @@ NodeModule::show_control_window()
bool
NodeModule::on_event(GdkEvent* ev)
{
- if (ev->type == GDK_2BUTTON_PRESS) {
+ 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();
}
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index 16d777ba..8a46f4f9 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -70,8 +70,6 @@ protected:
NodeModule(PatchCanvas& canvas, SharedPtr<const NodeModel> node);
bool on_event(GdkEvent* ev);
- bool on_click(GdkEventButton* ev);
- void on_double_click(GdkEventButton* ev);
void show_control_window();
void embed_gui(bool embed);
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index d61b3969..a25acac3 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -401,7 +401,7 @@ PatchCanvas::add_node(SharedPtr<const NodeModel> nm)
module = NodeModule::create(*this, nm, _human_names);
const PluginModel* plugm = dynamic_cast<const PluginModel*>(nm->plugin());
if (plugm && !plugm->icon_path().empty())
- module->set_icon(_app.icon_from_path(plugm->icon_path(), 100));
+ module->set_icon(_app.icon_from_path(plugm->icon_path(), 100).operator->());
}
module->show();