13
0

Make ArdourDisplay a subclass of ArdourDropdown

This commit is contained in:
Julien "_FrnchFrgg_" RIVAUD 2016-08-07 19:44:54 +02:00
parent 054b347181
commit f97696d7f3
2 changed files with 3 additions and 19 deletions

View 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)));
}

View 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__ */