req->width = max(req->width, get_allocation().get_width());
}
-void
-ArdourDropdown::position_menu(int& x, int& y, bool& push_in) {
- Gtkmm2ext::position_menu_anchored (&_menu, this, get_text(), x, y, push_in);
-}
-
bool
ArdourDropdown::on_button_press_event (GdkEventButton* ev)
{
if (ev->type == GDK_BUTTON_PRESS) {
- _menu.popup (sigc::mem_fun(this, &ArdourDropdown::position_menu),
- 1, ev->time);
+ Gtkmm2ext::anchored_menu_popup(&_menu, this, get_text(), 1, ev->time);
}
return true;
}
bool on_button_press_event (GdkEventButton*);
bool on_scroll_event (GdkEventScroll*);
- void position_menu(int&, int&, bool&);
void menu_size_request(Gtk::Requisition*);
void clear_items ();
items.push_back (MenuElem (_("Touch"),
sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Touch, cui)));
- automation_menu->popup (
- boost::bind (&Gtkmm2ext::position_menu_anchored, automation_menu, &cui->automate_button, "", _1, _2, _3),
- 1, gtk_get_current_event_time());
+ anchored_menu_popup(automation_menu, &cui->automate_button, "", 1, gtk_get_current_event_time());
}
void
int clip_height,
Gdk::Color fg);
- LIBGTKMM2EXT_API void position_menu_anchored (const Gtk::Menu* const menu,
- Gtk::Widget* const anchor,
- const std::string& selected,
- int& x, int& y, bool& push_in);
+ LIBGTKMM2EXT_API void anchored_menu_popup (Gtk::Menu* const menu,
+ Gtk::Widget* const anchor,
+ const std::string& selected,
+ guint button, guint32 time);
LIBGTKMM2EXT_API void set_popdown_strings (Gtk::ComboBoxText&,
const std::vector<std::string>&);
}
void
-Gtkmm2ext::position_menu_anchored (const Gtk::Menu* const menu,
+_position_menu_anchored (int& x, int& y, bool& push_in,
+ const Gtk::Menu* const menu,
Gtk::Widget* const anchor,
- const std::string& selected,
- int& x, int& y, bool& push_in) {
+ const std::string& selected) {
using namespace Gdk;
using namespace Gtk;
using namespace Gtk::Menu_Helpers;
push_in = false;
}
+void
+Gtkmm2ext::anchored_menu_popup (Gtk::Menu* const menu,
+ Gtk::Widget* const anchor,
+ const std::string& selected,
+ guint button, guint32 time) {
+ menu->popup(
+ sigc::bind (sigc::ptr_fun(&_position_menu_anchored),
+ menu, anchor, selected),
+ button,
+ time);
+}
+
void
Gtkmm2ext::set_popdown_strings (Gtk::ComboBoxText& cr, const vector<string>& strings)
{