From 04c6f60d1f1fb94f6a9dca81439026db22ebb88e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 11 Mar 2007 23:45:54 +0000 Subject: Auto-arranging in flowcanvas/machina. git-svn-id: http://svn.drobilla.net/lad/machina@353 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/MachinaCanvas.cpp | 1 + src/gui/MachinaGUI.cpp | 4 +++- src/gui/MachinaGUI.hpp | 1 + src/gui/Makefile.am | 2 +- src/gui/machina.glade | 19 +++++++++++++++++-- 5 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index 878e790..2c22791 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -219,6 +219,7 @@ MachinaCanvas::build(SharedPtr machine) } } + arrange(); } diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp index 121e25a..1266147 100644 --- a/src/gui/MachinaGUI.cpp +++ b/src/gui/MachinaGUI.cpp @@ -131,8 +131,9 @@ MachinaGUI::MachinaGUI(SharedPtr engine) xml->get_widget("bpm_spinbutton", _bpm_spinbutton); xml->get_widget("quantize_checkbutton", _quantize_checkbutton); xml->get_widget("quantize_spinbutton", _quantize_spinbutton); - xml->get_widget("zoom_full_but", _zoom_full_button); xml->get_widget("zoom_normal_but", _zoom_normal_button); + xml->get_widget("zoom_full_but", _zoom_full_button); + xml->get_widget("arrange_but", _arrange_button); _canvas_scrolledwindow->add(*_canvas); //m_canvas_scrolledwindow->signal_event().connect(sigc::mem_fun(_canvas, &FlowCanvas::scroll_event_handler)); @@ -145,6 +146,7 @@ MachinaGUI::MachinaGUI(SharedPtr engine) sigc::mem_fun(this, &MachinaGUI::zoom), 1.0)); _zoom_full_button->signal_clicked().connect(sigc::mem_fun(_canvas.get(), &MachinaCanvas::zoom_full)); + _arrange_button->signal_clicked().connect(sigc::mem_fun(_canvas.get(), &MachinaCanvas::arrange)); _menu_file_open->signal_activate().connect( sigc::mem_fun(this, &MachinaGUI::menu_file_open)); diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp index 0e507fc..7774ff6 100644 --- a/src/gui/MachinaGUI.hpp +++ b/src/gui/MachinaGUI.hpp @@ -118,6 +118,7 @@ protected: Gtk::SpinButton* _quantize_spinbutton; Gtk::ToolButton* _zoom_normal_button; Gtk::ToolButton* _zoom_full_button; + Gtk::ToolButton* _arrange_button; }; #endif // MACHINA_GUI_H diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 570cc8a..5c6cf47 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,5 +1,5 @@ AM_CXXFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" @LIBGLADEMM_CFLAGS@ @GNOMECANVASMM_CFLAGS@ @JACK_CFLAGS@ @FLOWCANVAS_CFLAGS@ @RAUL_CFLAGS@ -I$(top_srcdir)/src/engine -machina_gui_LDADD = @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @JACK_LIBS@ @FLOWCANVAS_LIBS@ @RAUL_CFLAGS@ ../engine/libmachina.la +machina_gui_LDADD = @FLOWCANVAS_LIBS@ @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @JACK_LIBS@ @RAUL_CFLAGS@ ../engine/libmachina.la EXTRA_DIST = machina.gladep diff --git a/src/gui/machina.glade b/src/gui/machina.glade index c0d1b87..216dfeb 100644 --- a/src/gui/machina.glade +++ b/src/gui/machina.glade @@ -85,7 +85,7 @@ - + True gtk-media-record 1 @@ -107,7 +107,7 @@ - + True gtk-convert 1 @@ -405,6 +405,21 @@ True + + + + True + Automatically arrange nodes + gtk-refresh + True + True + False + + + False + True + + 0 -- cgit v1.2.1