Make ArdourDisplay a subclass of ArdourDropdown
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Sun, 7 Aug 2016 17:44:54 +0000 (19:44 +0200)
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Sun, 7 Aug 2016 17:44:54 +0000 (19:44 +0200)
gtk2_ardour/ardour_display.cc
gtk2_ardour/ardour_display.h

index a682833706fe4cd562160845275f5db54291a6f4..d4c75af7bb5d534513cd6402f2a89e30686cc3d2 100644 (file)
@@ -51,8 +51,6 @@ using namespace std;
 
 ArdourDisplay::ArdourDisplay (Element e)
 {
-       add_elements(e);
-       add_elements(ArdourButton::Menu);
        add_elements(ArdourButton::Text);
 }
 
@@ -60,12 +58,6 @@ ArdourDisplay::~ArdourDisplay ()
 {
 }
 
-bool
-ArdourDisplay::on_button_press_event (GdkEventButton*)
-{
-       _menu.popup (1, gtk_get_current_event_time());
-       return true;
-}
 
 bool
 ArdourDisplay::on_scroll_event (GdkEventScroll* ev)
@@ -101,10 +93,7 @@ void
 ArdourDisplay::add_controllable_preset (const char *txt, float val)
 {
        using namespace Menu_Helpers;
-
-       MenuList& items = _menu.items ();
-
-       items.push_back (MenuElem (txt, sigc::bind (sigc::mem_fun(*this, &ArdourDisplay::handle_controllable_preset), val)));
+       AddMenuElem(MenuElem (txt, sigc::bind (sigc::mem_fun(*this, &ArdourDisplay::handle_controllable_preset), val)));
 }
 
 
index 8b7712ddcc67e25fbc6aa41e4d91e5fe3b0996c5..1b7c65480e009bf4f0cbbd8eb26639054767a9ad 100644 (file)
@@ -27,9 +27,9 @@
 #include <gtkmm/menuitem.h>
 
 
-#include "ardour_button.h"
+#include "ardour_dropdown.h"
 
-class ArdourDisplay : public ArdourButton
+class ArdourDisplay : public ArdourDropdown
 {
   public:
 
@@ -39,8 +39,6 @@ class ArdourDisplay : public ArdourButton
        boost::shared_ptr<PBD::Controllable> get_controllable() { return binding_proxy.get_controllable(); }
        void set_controllable (boost::shared_ptr<PBD::Controllable> c);
 
-       bool on_button_press_event (GdkEventButton*);  //mousedown will pop up our preset menu
-//     bool on_button_press_event (GdkEventButton*);
 //     bool on_button_release_event (GdkEventButton*);
        bool on_scroll_event (GdkEventScroll* ev);
 //     bool on_motion_notify_event (GdkEventMotion *ev) ;
@@ -50,9 +48,6 @@ class ArdourDisplay : public ArdourButton
 
        void controllable_changed ();
        PBD::ScopedConnection watch_connection;
-
-  private:
-       Gtk::Menu      _menu;
 };
 
 #endif /* __gtk2_ardour_ardour_menu_h__ */