From 7471821294765f6da694d14ff81581b31d1a983a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 28 Sep 2008 03:02:58 +0000 Subject: Select all support (from kfoltman). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1519 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/PatchCanvas.cpp | 9 +++++++++ src/libs/gui/PatchCanvas.hpp | 1 + src/libs/gui/PatchWindow.cpp | 11 +++++++++++ src/libs/gui/PatchWindow.hpp | 2 ++ src/libs/gui/ingen_gui.glade | 11 +++++++++++ 5 files changed, 34 insertions(+) diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp index bd3a6bee..ddbbdc2b 100644 --- a/src/libs/gui/PatchCanvas.cpp +++ b/src/libs/gui/PatchCanvas.cpp @@ -561,6 +561,15 @@ PatchCanvas::destroy_selection() } } +void +PatchCanvas::select_all() +{ + unselect_ports(); + for (list >::iterator m = _items.begin(); m != _items.end(); ++m) + if (boost::dynamic_pointer_cast(*m)) + if (!(*m)->selected()) + select_item(*m); +} void PatchCanvas::copy_selection() diff --git a/src/libs/gui/PatchCanvas.hpp b/src/libs/gui/PatchCanvas.hpp index 667b65a1..fcf68e76 100644 --- a/src/libs/gui/PatchCanvas.hpp +++ b/src/libs/gui/PatchCanvas.hpp @@ -81,6 +81,7 @@ public: void destroy_selection(); void copy_selection(); void paste(); + void select_all(); void show_menu(GdkEvent* event); diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp index e0dc4b06..664b06c5 100644 --- a/src/libs/gui/PatchWindow.cpp +++ b/src/libs/gui/PatchWindow.cpp @@ -67,6 +67,7 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("patch_copy_menuitem", _menu_copy); xml->get_widget("patch_paste_menuitem", _menu_paste); xml->get_widget("patch_delete_menuitem", _menu_delete); + xml->get_widget("patch_select_all_menuitem", _menu_select_all); xml->get_widget("patch_close_menuitem", _menu_close); xml->get_widget("patch_quit_menuitem", _menu_quit); xml->get_widget("patch_view_control_window_menuitem", _menu_view_control_window); @@ -103,6 +104,8 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_delete)); + _menu_select_all->signal_activate().connect( + sigc::mem_fun(this, &PatchWindow::event_select_all)); _menu_quit->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_quit)); _menu_fullscreen->signal_activate().connect( @@ -417,6 +420,14 @@ PatchWindow::event_delete() } +void +PatchWindow::event_select_all() +{ + if (_view) + _view->canvas()->select_all(); +} + + void PatchWindow::on_show() { diff --git a/src/libs/gui/PatchWindow.hpp b/src/libs/gui/PatchWindow.hpp index ec3d14e8..4d4f0f1e 100644 --- a/src/libs/gui/PatchWindow.hpp +++ b/src/libs/gui/PatchWindow.hpp @@ -91,6 +91,7 @@ private: void event_copy(); void event_paste(); void event_delete(); + void event_select_all(); void event_quit(); void event_destroy(); void event_clear(); @@ -122,6 +123,7 @@ private: Gtk::MenuItem* _menu_copy; Gtk::MenuItem* _menu_paste; Gtk::MenuItem* _menu_delete; + Gtk::MenuItem* _menu_select_all; Gtk::MenuItem* _menu_close; Gtk::MenuItem* _menu_quit; Gtk::CheckMenuItem* _menu_human_names; diff --git a/src/libs/gui/ingen_gui.glade b/src/libs/gui/ingen_gui.glade index 5dbc318b..aa0680ea 100644 --- a/src/libs/gui/ingen_gui.glade +++ b/src/libs/gui/ingen_gui.glade @@ -183,6 +183,17 @@ + + + True + Select all objects in a patch + gtk-select-all + True + True + + + + True -- cgit v1.2.1