aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-03-23 02:45:37 +0000
committerDavid Robillard <d@drobilla.net>2007-03-23 02:45:37 +0000
commitb9da1483a9f505879893d1882cba9e72babaa645 (patch)
tree52e11812795aa7cedd8f499f4659d5cf306cbbbb /src
parent642f35f5bb17990cf699050cfe777bd903942912 (diff)
downloadmachina-b9da1483a9f505879893d1882cba9e72babaa645.tar.gz
machina-b9da1483a9f505879893d1882cba9e72babaa645.tar.bz2
machina-b9da1483a9f505879893d1882cba9e72babaa645.zip
Changed to middle click for adding nodes.
Added visual representation of initial nodes (thick border). git-svn-id: http://svn.drobilla.net/lad/machina@372 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/gui/MachinaCanvas.cpp34
-rw-r--r--src/gui/NodeView.cpp2
-rw-r--r--src/gui/machina.glade10
3 files changed, 22 insertions, 24 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 10334d0..6fdbc86 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -89,27 +89,25 @@ MachinaCanvas::canvas_event(GdkEvent* event)
return false;
if (event->type == GDK_BUTTON_RELEASE
- && event->button.state & GDK_CONTROL_MASK) {
-
+ && event->button.button == 2) {
+
const double x = event->button.x;
const double y = event->button.y;
- if (event->button.button == 1) {
- string name = string("Note")+(char)(last++ +'0');
-
- SharedPtr<Machina::Node> node(new Machina::Node(1.0, false));
- //node->add_enter_action(SharedPtr<Machina::Action>(new Machina::PrintAction(name)));
- SharedPtr<NodeView> view(new NodeView(node, shared_from_this(),
- name, x, y));
-
- view->signal_clicked.connect(sigc::bind<0>(sigc::mem_fun(this,
- &MachinaCanvas::node_clicked), WeakPtr<NodeView>(view)));
- add_item(view);
- view->resize();
- view->raise_to_top();
-
- machine->add_node(node);
- }
+ string name = string("Note")+(char)(last++ +'0');
+
+ SharedPtr<Machina::Node> node(new Machina::Node(1.0, false));
+ //node->add_enter_action(SharedPtr<Machina::Action>(new Machina::PrintAction(name)));
+ SharedPtr<NodeView> view(new NodeView(node, shared_from_this(),
+ name, x, y));
+
+ view->signal_clicked.connect(sigc::bind<0>(sigc::mem_fun(this,
+ &MachinaCanvas::node_clicked), WeakPtr<NodeView>(view)));
+ add_item(view);
+ view->resize();
+ view->raise_to_top();
+
+ machine->add_node(node);
}
return FlowCanvas::canvas_event(event);
diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp
index f34c658..d675f1d 100644
--- a/src/gui/NodeView.cpp
+++ b/src/gui/NodeView.cpp
@@ -34,8 +34,8 @@ void
NodeView::on_double_click(GdkEventButton*)
{
bool is_initial = _node->is_initial();
- std::cerr << "Initial: " << is_initial << std::endl;
_node->set_initial( ! is_initial );
+ set_border_width(is_initial ? 1.0 : 2.0);
}
diff --git a/src/gui/machina.glade b/src/gui/machina.glade
index b53398b..8536e8f 100644
--- a/src/gui/machina.glade
+++ b/src/gui/machina.glade
@@ -85,7 +85,7 @@
<accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image16">
+ <widget class="GtkImage" id="image18">
<property name="visible">True</property>
<property name="stock">gtk-media-record</property>
<property name="icon_size">1</property>
@@ -107,7 +107,7 @@
<accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image17">
+ <widget class="GtkImage" id="image19">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
<property name="icon_size">1</property>
@@ -135,7 +135,7 @@
<accelerator key="G" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image18">
+ <widget class="GtkImage" id="image20">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
<property name="icon_size">1</property>
@@ -640,9 +640,9 @@ along with Machina; if not, write to the Free Software Foundation, Inc.,
<child>
<widget class="GtkLabel" id="label5">
<property name="visible">True</property>
- <property name="label" translatable="yes">Interface is a bit sketchy still:
+ <property name="label" translatable="yes">Interface is still a bit arbitrary:
-- Ctrl+Left click the canvas to create a new node
+- Middle 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 make it an initial node