ArdourDropdown: new utility methods
This commit is contained in:
@@ -168,6 +168,13 @@ ArdourDropdown::clear_items ()
|
||||
_menu.items ().clear ();
|
||||
}
|
||||
|
||||
void
|
||||
ArdourDropdown::add_separator ()
|
||||
{
|
||||
using namespace Menu_Helpers;
|
||||
add_menu_elem (SeparatorElem());
|
||||
}
|
||||
|
||||
void
|
||||
ArdourDropdown::add_menu_elem (Menu_Helpers::Element e)
|
||||
{
|
||||
@@ -201,3 +208,9 @@ ArdourDropdown::append (Glib::RefPtr<Action> action)
|
||||
{
|
||||
_menu.items().push_back (Menu_Helpers::MenuElem (action->get_short_label(), sigc::mem_fun (action.get(), &Action::activate)));
|
||||
}
|
||||
|
||||
void
|
||||
ArdourDropdown::append (Gtk::Menu& submenu, Glib::RefPtr<Action> action)
|
||||
{
|
||||
submenu.items().push_back (Menu_Helpers::MenuElem (action->get_short_label(), sigc::mem_fun (action.get(), &Action::activate)));
|
||||
}
|
||||
|
||||
@@ -45,14 +45,16 @@ public:
|
||||
|
||||
void clear_items ();
|
||||
void add_menu_elem (Gtk::Menu_Helpers::Element e);
|
||||
void append_text_item (std::string const& text);
|
||||
void add_separator ();
|
||||
void append (Glib::RefPtr<Gtk::Action>);
|
||||
void append (Gtk::Menu&, Glib::RefPtr<Gtk::Action>);
|
||||
|
||||
void disable_scrolling();
|
||||
|
||||
Gtk::Menu_Helpers::MenuList& items () { return _menu.items (); }
|
||||
Gtk::Menu& menu () { return _menu; }
|
||||
|
||||
void append_text_item (std::string const& text);
|
||||
void set_active (std::string const& text);
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user