diff options
author | David Robillard <d@drobilla.net> | 2007-04-17 02:34:44 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-04-17 02:34:44 +0000 |
commit | 3b1c0f0988922dad659a3ed3273dddd24fead682 (patch) | |
tree | fc35b7ae9fe757a43f96df5f104061254624340e | |
parent | b6aaaaf9bc54d478f3435845912007022c4d6380 (diff) | |
download | machina-3b1c0f0988922dad659a3ed3273dddd24fead682.tar.gz machina-3b1c0f0988922dad659a3ed3273dddd24fead682.tar.bz2 machina-3b1c0f0988922dad659a3ed3273dddd24fead682.zip |
Event handling fixes.
Changed button assignments to not conflict with canvas zooming.
git-svn-id: http://svn.drobilla.net/lad/machina@450 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/gui/EdgeView.cpp | 20 | ||||
-rw-r--r-- | src/gui/MachinaCanvas.cpp | 10 | ||||
-rw-r--r-- | src/gui/machina.glade | 7 |
3 files changed, 21 insertions, 16 deletions
diff --git a/src/gui/EdgeView.cpp b/src/gui/EdgeView.cpp index faa89d0..dceb0d0 100644 --- a/src/gui/EdgeView.cpp +++ b/src/gui/EdgeView.cpp @@ -68,17 +68,17 @@ EdgeView::update_label() bool EdgeView::on_event(GdkEvent* ev) { - using namespace std; - if (ev->type == GDK_BUTTON_PRESS) { - if (ev->button.button == 1) { - _edge->set_probability(_edge->probability() - 0.1); - update_label(); - return true; - } else if (ev->button.button == 3) { - _edge->set_probability(_edge->probability() + 0.1); - update_label(); - return true; + if (ev->button.state & GDK_CONTROL_MASK) { + if (ev->button.button == 1) { + _edge->set_probability(_edge->probability() - 0.1); + update_label(); + return true; + } else if (ev->button.button == 3) { + _edge->set_probability(_edge->probability() + 0.1); + update_label(); + return true; + } } } diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index c689e24..d78c89d 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -84,7 +84,8 @@ MachinaCanvas::canvas_event(GdkEvent* event) return false; if (event->type == GDK_BUTTON_RELEASE - && event->button.button == 2) { + && event->button.button == 3 + && !(event->button.state & (GDK_CONTROL_MASK))) { const double x = event->button.x; const double y = event->button.y; @@ -102,9 +103,12 @@ MachinaCanvas::canvas_event(GdkEvent* event) view->raise_to_top(); machine->add_node(node); - } - return FlowCanvas::canvas_event(event); + return true; + + } else { + return FlowCanvas::canvas_event(event); + } } diff --git a/src/gui/machina.glade b/src/gui/machina.glade index c57bb88..8fcb8ad 100644 --- a/src/gui/machina.glade +++ b/src/gui/machina.glade @@ -640,7 +640,6 @@ along with Machina; if not, write to the Free Software Foundation, Inc., <property name="modal">False</property> <property name="resizable">False</property> <property name="destroy_with_parent">False</property> - <property name="icon">machina.svg</property> <property name="icon_name">gtk-help</property> <property name="decorated">True</property> <property name="skip_taskbar_hint">False</property> @@ -689,12 +688,14 @@ along with Machina; if not, write to the Free Software Foundation, Inc., <property name="label" translatable="yes">Initial nodes are shown with a thick border. Selector nodes are shown in green. -- Middle click canvas to create a new node +- Right click canvas to create a new node - Middle click nodes to learn a MIDI note for that node - Right click two nodes in succession to connect nodes - Double click a node to show its properties dialog - Ctrl+Left click a node to make it an initial node -- Ctrl+Right click a node to make it a selector node</property> +- Ctrl+Right click a node to make it a selector node +- Ctrl+Left click edge probabilities to decrease +- Ctrl+Right click edge probabilities to increase</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> |