From 2c31cdbe878648a3de035b7af0efbd12574d496a Mon Sep 17 00:00:00 2001 From: nikolay Date: Thu, 26 Jun 2014 10:54:31 +0300 Subject: [PATCH] [Summary] Added support of SpinButton [Review] GZharun --- gtk2_ardour/waves_ui.cc | 15 ++++++++++++++- gtk2_ardour/waves_ui.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/waves_ui.cc b/gtk2_ardour/waves_ui.cc index f4946bcd3b..25246e53d6 100644 --- a/gtk2_ardour/waves_ui.cc +++ b/gtk2_ardour/waves_ui.cc @@ -93,7 +93,9 @@ WavesUI::create_widget (const XMLNode& definition, const XMLNodeMap& styles) child = manage (new Gtk::Label (text)); } else if (widget_type == "ENTRY") { child = manage (new Gtk::Entry ()); - } else if (widget_type == "LAYOUT") { + } else if (widget_type == "SPINBUTTON") { + child = manage (new Gtk::SpinButton ()); + } else if (widget_type == "LAYOUT") { child = manage (new Gtk::Layout); } else if (widget_type == "CANVAS") { std::map named_items; @@ -562,6 +564,17 @@ WavesUI::get_entry(const char* id) return *child; } +Gtk::SpinButton& +WavesUI::get_spin_button(const char* id) +{ + Gtk::SpinButton* child = dynamic_cast (get_object(id)); + if (child == NULL ) { + dbg_msg (std::string("Gtk::SpinButton ") + id + " not found !"); + throw std::exception(); + } + return *child; +} + WavesButton& WavesUI::get_waves_button (const char* id) { diff --git a/gtk2_ardour/waves_ui.h b/gtk2_ardour/waves_ui.h index aa1a56dd10..99edfd4b36 100644 --- a/gtk2_ardour/waves_ui.h +++ b/gtk2_ardour/waves_ui.h @@ -50,6 +50,7 @@ class WavesUI : public std::map { Gtk::Image& get_image (const char* id); Gtk::ComboBoxText& get_combo_box_text (const char* id); Gtk::Entry& get_entry(const char* id); + Gtk::SpinButton& get_spin_button(const char* id); WavesButton& get_waves_button (const char* id); Gtkmm2ext::Fader& get_fader (const char* id); const XMLTree* xml_tree() { return _xml_tree; }