From 2b9b38d0a6a69327fa2f4c49ec82fc3ab8f338c9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 16 Jun 2006 17:52:50 +0000 Subject: Removed Add menu from patch window (in favour of context menu only), other GUI tweaks git-svn-id: http://svn.drobilla.net/lad/grauph@44 a436a847-0d15-0410-975c-d299462d15a1 --- src/progs/gtk/OmFlowCanvas.cpp | 24 ++- src/progs/gtk/OmFlowCanvas.h | 11 +- src/progs/gtk/PatchWindow.cpp | 20 ++- src/progs/gtk/PatchWindow.h | 6 +- src/progs/gtk/om_gtk.glade | 336 ++++++++++++++++++++++++++--------------- src/progs/gtk/om_gtk.glade.bak | 220 ++++++++++++++++++++++++--- 6 files changed, 459 insertions(+), 158 deletions(-) diff --git a/src/progs/gtk/OmFlowCanvas.cpp b/src/progs/gtk/OmFlowCanvas.cpp index cac5b87d..863ba014 100644 --- a/src/progs/gtk/OmFlowCanvas.cpp +++ b/src/progs/gtk/OmFlowCanvas.cpp @@ -27,7 +27,7 @@ #include "OmPort.h" #include "NodeModel.h" #include "OmModule.h" - +#include "GladeFactory.h" namespace OmGtk { @@ -40,13 +40,27 @@ OmFlowCanvas::OmFlowCanvas(PatchController* controller, int width, int height) { assert(controller != NULL); - Gtk::Menu::MenuList& items = m_menu.items(); + /*Gtk::Menu::MenuList& items = m_menu.items(); items.push_back(Gtk::Menu_Helpers::MenuElem("Load Plugin...", sigc::mem_fun(this, &OmFlowCanvas::menu_load_plugin))); items.push_back(Gtk::Menu_Helpers::MenuElem("Load Subpatch...", sigc::mem_fun(this, &OmFlowCanvas::menu_load_subpatch))); items.push_back(Gtk::Menu_Helpers::MenuElem("New Subpatch...", - sigc::mem_fun(this, &OmFlowCanvas::menu_create_subpatch))); + sigc::mem_fun(this, &OmFlowCanvas::menu_create_subpatch)));*/ + + Glib::RefPtr xml = GladeFactory::new_glade_reference(); + xml->get_widget("canvas_menu", m_menu); + + xml->get_widget("canvas_menu_load_plugin", m_menu_load_plugin); + xml->get_widget("canvas_menu_load_patch", m_menu_load_patch); + xml->get_widget("canvas_menu_new_patch", m_menu_new_patch); + + m_menu_load_plugin->signal_activate().connect( + sigc::mem_fun(this, &OmFlowCanvas::menu_load_plugin)); + m_menu_load_patch->signal_activate().connect( + sigc::mem_fun(this, &OmFlowCanvas::menu_load_patch)); + m_menu_new_patch->signal_activate().connect( + sigc::mem_fun(this, &OmFlowCanvas::menu_new_patch)); } @@ -145,7 +159,7 @@ OmFlowCanvas::menu_load_plugin() void -OmFlowCanvas::menu_load_subpatch() +OmFlowCanvas::menu_load_patch() { m_patch_controller->window()->load_subpatch_window()->set_next_module_location( m_last_click_x, m_last_click_y); @@ -154,7 +168,7 @@ OmFlowCanvas::menu_load_subpatch() void -OmFlowCanvas::menu_create_subpatch() +OmFlowCanvas::menu_new_patch() { m_patch_controller->window()->new_subpatch_window()->set_next_module_location( m_last_click_x, m_last_click_y); diff --git a/src/progs/gtk/OmFlowCanvas.h b/src/progs/gtk/OmFlowCanvas.h index 2a553f5b..1871de80 100644 --- a/src/progs/gtk/OmFlowCanvas.h +++ b/src/progs/gtk/OmFlowCanvas.h @@ -50,18 +50,21 @@ public: void destroy_selected(); void show_menu(GdkEvent* event) - { m_menu.popup(event->button.button, event->button.time); } + { m_menu->popup(event->button.button, event->button.time); } void menu_load_plugin(); - void menu_load_subpatch(); - void menu_create_subpatch(); + void menu_new_patch(); + void menu_load_patch(); private: PatchController* m_patch_controller; int m_last_click_x; int m_last_click_y; - Gtk::Menu m_menu; + Gtk::Menu* m_menu; + Gtk::MenuItem* m_menu_load_plugin; + Gtk::MenuItem* m_menu_load_patch; + Gtk::MenuItem* m_menu_new_patch; }; diff --git a/src/progs/gtk/PatchWindow.cpp b/src/progs/gtk/PatchWindow.cpp index 0814e1ac..46b5ce91 100644 --- a/src/progs/gtk/PatchWindow.cpp +++ b/src/progs/gtk/PatchWindow.cpp @@ -70,9 +70,9 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("patch_fullscreen_menuitem", m_menu_fullscreen); xml->get_widget("patch_clear_menuitem", m_menu_clear); xml->get_widget("patch_destroy_menuitem", m_menu_destroy_patch); - xml->get_widget("patch_add_plugin_menuitem", m_menu_add_plugin); + /*xml->get_widget("patch_add_plugin_menuitem", m_menu_add_plugin); xml->get_widget("patch_add_new_subpatch_menuitem", m_menu_new_subpatch); - xml->get_widget("patch_add_subpatch_from_file_menuitem", m_menu_load_subpatch); + xml->get_widget("patch_add_subpatch_from_file_menuitem", m_menu_load_subpatch);*/ xml->get_widget("patch_view_messages_window_menuitem", m_menu_view_messages_window); xml->get_widget("patch_view_patch_tree_window_menuitem", m_menu_view_patch_tree_window); xml->get_widget("patch_help_about_menuitem", m_menu_help_about); @@ -105,7 +105,7 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_activate().connect( sigc::mem_fun(App::instance().configuration_dialog(), &ConfigWindow::show)); - m_menu_fullscreen->signal_toggled().connect( + m_menu_fullscreen->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_fullscreen_toggled)); m_menu_view_engine_window->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_show_engine)); @@ -117,12 +117,12 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_clear)); - m_menu_add_plugin->signal_activate().connect( + /*m_menu_add_plugin->signal_activate().connect( sigc::mem_fun(m_load_plugin_window, &LoadPluginWindow::present)); m_menu_new_subpatch->signal_activate().connect( sigc::mem_fun(m_new_subpatch_window, &NewSubpatchWindow::present)); m_menu_load_subpatch->signal_activate().connect( - sigc::mem_fun(m_load_subpatch_window, &LoadSubpatchWindow::present)); + sigc::mem_fun(m_load_subpatch_window, &LoadSubpatchWindow::present));*/ m_menu_view_messages_window->signal_activate().connect( sigc::mem_fun(App::instance().messages_dialog(), &MessagesWindow::present)); m_menu_view_patch_tree_window->signal_activate().connect( @@ -567,10 +567,16 @@ PatchWindow::event_clear() void PatchWindow::event_fullscreen_toggled() { - if (m_menu_fullscreen->get_active()) + // FIXME: ugh, use GTK signals to track state and now for sure + static bool is_fullscreen = false; + + if (!is_fullscreen) { fullscreen(); - else + is_fullscreen = true; + } else { unfullscreen(); + is_fullscreen = false; + } } diff --git a/src/progs/gtk/PatchWindow.h b/src/progs/gtk/PatchWindow.h index 2821fa41..e835c9e3 100644 --- a/src/progs/gtk/PatchWindow.h +++ b/src/progs/gtk/PatchWindow.h @@ -116,15 +116,15 @@ private: Gtk::MenuItem* m_menu_configuration; Gtk::MenuItem* m_menu_close; Gtk::MenuItem* m_menu_quit; - Gtk::CheckMenuItem* m_menu_fullscreen; + Gtk::MenuItem* m_menu_fullscreen; Gtk::MenuItem* m_menu_clear; Gtk::MenuItem* m_menu_destroy_patch; Gtk::MenuItem* m_menu_view_engine_window; Gtk::MenuItem* m_menu_view_control_window; Gtk::MenuItem* m_menu_view_patch_properties; - Gtk::MenuItem* m_menu_add_plugin; + /*Gtk::MenuItem* m_menu_add_plugin; Gtk::MenuItem* m_menu_new_subpatch; - Gtk::MenuItem* m_menu_load_subpatch; + Gtk::MenuItem* m_menu_load_subpatch;*/ Gtk::MenuItem* m_menu_view_messages_window; Gtk::MenuItem* m_menu_view_patch_tree_window; Gtk::MenuItem* m_menu_help_about; diff --git a/src/progs/gtk/om_gtk.glade b/src/progs/gtk/om_gtk.glade index 39af1fd1..16e15a2e 100644 --- a/src/progs/gtk/om_gtk.glade +++ b/src/progs/gtk/om_gtk.glade @@ -52,7 +52,7 @@ - + True gtk-open 1 @@ -107,7 +107,7 @@ - + True gtk-preferences 1 @@ -166,13 +166,11 @@ - + True - Fullscreen - True - True + gtk-fullscreen + True - @@ -192,7 +190,7 @@ - + True gtk-preferences 1 @@ -234,7 +232,7 @@ - + True gtk-delete 1 @@ -252,113 +250,8 @@ - + True - _Add - True - - - - - - - - True - Load a plugin as a child of this patch - _Plugin... - True - - - - - True - gtk-execute - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - Load a patch as a child of this patch - _Patch From File... - True - - - - - - True - gtk-open - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - Create a new (empty) patch as a child of this patch - _New Patch... - True - - - - - - True - gtk-new - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - - - True - - - - - - True - False - Using this menu will place items randomly - right click! - Right click on canvas to manually place an object - True - - - - - True - gtk-info - 1 - 0.5 - 0.5 - 0 - 0 - - - - - - @@ -382,7 +275,7 @@ - + True gtk-connect 1 @@ -405,7 +298,7 @@ - + True gtk-index 1 @@ -428,7 +321,7 @@ - + True gtk-dialog-error 1 @@ -455,6 +348,33 @@ + + + True + Right-click the canvas to add objects + True + + + + + True + gtk-info + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + True @@ -3767,4 +3687,184 @@ Contributors: + + True + + + + True + Input + True + + + + True + gtk-connect + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + Add an audio input to this patch + Audio + True + + + + + + + True + Add a control input (and a control slider for it) to this patch + Control + True + + + + + + + True + Add a MIDI input to this patch + MIDI + True + + + + + + + + + + + True + Output + True + + + + True + gtk-connect + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + Add an audio output to this patch + Audio + True + + + + + + + True + Add a control output to this patch + Control + True + + + + + + + True + Add a MIDI output to this patch + MIDI + True + + + + + + + + + + + True + Load a plugin as a child of this patch + _Plugin... + True + + + + + True + gtk-execute + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Load a patch as a child of this patch + Patch From _File... + True + + + + + True + gtk-open + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Create a new (empty) patch as a child of this patch + _New Patch... + True + + + + + True + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + diff --git a/src/progs/gtk/om_gtk.glade.bak b/src/progs/gtk/om_gtk.glade.bak index db3e01b4..ac12bb1e 100644 --- a/src/progs/gtk/om_gtk.glade.bak +++ b/src/progs/gtk/om_gtk.glade.bak @@ -52,7 +52,7 @@ - + True gtk-open 1 @@ -107,7 +107,7 @@ - + True gtk-preferences 1 @@ -166,13 +166,11 @@ - + True - Fullscreen - True - True + gtk-fullscreen + True - @@ -192,7 +190,7 @@ - + True gtk-preferences 1 @@ -234,7 +232,7 @@ - + True gtk-delete 1 @@ -270,7 +268,7 @@ - + True gtk-execute 1 @@ -293,7 +291,7 @@ - + True gtk-open 1 @@ -316,7 +314,7 @@ - + True gtk-new 1 @@ -345,7 +343,7 @@ - + True gtk-info 1 @@ -382,7 +380,7 @@ - + True gtk-connect 1 @@ -405,7 +403,7 @@ - + True gtk-index 1 @@ -428,7 +426,7 @@ - + True gtk-dialog-error 1 @@ -3267,7 +3265,7 @@ Contributors: 0 False - False + True @@ -3315,7 +3313,7 @@ Contributors: 0 False - False + True @@ -3338,7 +3336,7 @@ Contributors: True - 8 + 4 True True @@ -3472,11 +3470,11 @@ Contributors: True 1 0 - False + True GTK_UPDATE_ALWAYS False False - 1 0 100 1 10 10 + 16180 1 65535 1 10 10 0 @@ -3767,4 +3765,184 @@ Contributors: + + True + + + + True + Input + True + + + + True + gtk-connect + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + Add an audio input to this patch + Audio + True + + + + + + + True + Add a control input (and a control slider for it) to this patch + Control + True + + + + + + + True + Add a MIDI input to this patch + MIDI + True + + + + + + + + + + + True + Output + True + + + + True + gtk-connect + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + Add an audio output to this patch + Audio + True + + + + + + + True + Add a control output to this patch + Control + True + + + + + + + True + Add a MIDI output to this patch + MIDI + True + + + + + + + + + + + True + Load a plugin as a child of this patch + _Plugin... + True + + + + + True + gtk-execute + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Load a patch as a child of this patch + Patch From _File... + True + + + + + True + gtk-open + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Create a new (empty) patch as a child of this patch + _New Patch... + True + + + + + True + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + -- cgit v1.2.1