2014-03-29 18:56:09 -05:00
|
|
|
/*
|
2014-05-19 16:30:55 -05:00
|
|
|
Copyright (C) 2014 Waves Audio Ltd.
|
2014-03-29 18:56:09 -05:00
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
*/
|
2014-05-01 06:06:16 -05:00
|
|
|
|
|
|
|
|
#include <exception>
|
|
|
|
|
|
2014-03-29 18:56:09 -05:00
|
|
|
#include "waves_ui.h"
|
2014-05-01 06:06:16 -05:00
|
|
|
#include "pbd/file_utils.h"
|
|
|
|
|
#include "ardour/filesystem_paths.h"
|
2014-05-15 08:25:23 -05:00
|
|
|
#include "utils.h"
|
2014-05-07 10:29:26 -05:00
|
|
|
|
|
|
|
|
#include "pbd/convert.h"
|
2014-05-01 06:06:16 -05:00
|
|
|
#include "dbg_msg.h"
|
2014-03-29 18:56:09 -05:00
|
|
|
|
2014-05-01 06:06:16 -05:00
|
|
|
using namespace PBD;
|
|
|
|
|
using namespace ARDOUR;
|
2014-03-29 18:56:09 -05:00
|
|
|
|
|
|
|
|
Gtk::Widget*
|
2014-05-01 06:06:16 -05:00
|
|
|
WavesUI::create_widget (const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*>& named_widgets)
|
2014-03-29 18:56:09 -05:00
|
|
|
{
|
|
|
|
|
Gtk::Widget* child = NULL;
|
|
|
|
|
std::string widget_type = definition.name();
|
2014-04-14 12:37:20 -05:00
|
|
|
std::string widget_id = xml_property (definition, "id", styles, "");
|
2014-03-29 18:56:09 -05:00
|
|
|
|
2014-04-14 12:37:20 -05:00
|
|
|
std::string text = xml_property (definition, "text", styles, "");
|
2014-03-29 18:56:09 -05:00
|
|
|
boost::replace_all(text, "\\n", "\n");
|
|
|
|
|
|
|
|
|
|
std::transform(widget_type.begin(), widget_type.end(), widget_type.begin(), ::toupper);
|
2014-05-01 06:06:16 -05:00
|
|
|
|
2014-03-29 18:56:09 -05:00
|
|
|
if (widget_type == "BUTTON") {
|
2014-05-15 08:25:23 -05:00
|
|
|
WavesButton& button = *manage (new WavesButton(text));
|
|
|
|
|
child = &button;
|
|
|
|
|
button.set_border_width (xml_property (definition, "borderwidth", styles, "0").c_str());
|
|
|
|
|
button.set_border_color (xml_property (definition, "bordercolor", styles, "#000000").c_str());
|
|
|
|
|
} else if (widget_type == "ICONBUTTON") {
|
|
|
|
|
WavesIconButton& iconbutton = *manage (new WavesIconButton);
|
|
|
|
|
child = &iconbutton;
|
|
|
|
|
iconbutton.set_border_width (xml_property (definition, "borderwidth", styles, "0").c_str());
|
|
|
|
|
iconbutton.set_border_color (xml_property (definition, "bordercolor", styles, "#000000").c_str());
|
|
|
|
|
|
|
|
|
|
std::string property = xml_property (definition, "normalicon", styles, "");
|
|
|
|
|
if (!property.empty ()) {
|
|
|
|
|
iconbutton.set_normal_image(get_icon(property.c_str()));
|
|
|
|
|
}
|
|
|
|
|
property = xml_property (definition, "activeicon", styles, "");
|
|
|
|
|
if (!property.empty ()) {
|
|
|
|
|
iconbutton.set_active_image(get_icon(property.c_str()));
|
|
|
|
|
}
|
|
|
|
|
property = xml_property (definition, "prelighticon", styles, "");
|
|
|
|
|
if (!property.empty ()) {
|
|
|
|
|
iconbutton.set_prelight_image(get_icon(property.c_str()));
|
|
|
|
|
}
|
|
|
|
|
property = xml_property (definition, "inactiveicon", styles, "");
|
|
|
|
|
if (!property.empty ()) {
|
|
|
|
|
iconbutton.set_inactive_image(get_icon(property.c_str()));
|
|
|
|
|
}
|
2014-03-29 18:56:09 -05:00
|
|
|
} else if (widget_type == "COMBOBOXTEXT") {
|
|
|
|
|
child = manage (new Gtk::ComboBoxText);
|
|
|
|
|
} else if (widget_type == "LABEL") {
|
|
|
|
|
child = manage (new Gtk::Label(text));
|
|
|
|
|
} else if (widget_type == "LAYOUT") {
|
|
|
|
|
child = manage (new Gtk::Layout);
|
2014-04-14 12:37:20 -05:00
|
|
|
} else if (widget_type == "CANVAS") {
|
|
|
|
|
std::map<std::string, ArdourCanvas::Item*> named_items;
|
2014-04-29 01:07:37 -05:00
|
|
|
child = manage (new ArdourCanvas::GtkCanvas(definition, styles, named_items));
|
|
|
|
|
} else if (widget_type == "SCROLLEDWINDOW") {
|
|
|
|
|
child = manage (new Gtk::ScrolledWindow);
|
2014-05-01 06:06:16 -05:00
|
|
|
Gtk::PolicyType hscrollbar_policy = Gtk::POLICY_AUTOMATIC;
|
|
|
|
|
Gtk::PolicyType vscrollbar_policy = Gtk::POLICY_AUTOMATIC;
|
|
|
|
|
std::string property = xml_property (definition, "hscroll", styles, "");
|
|
|
|
|
if (property == "never") {
|
|
|
|
|
hscrollbar_policy = Gtk::POLICY_NEVER;
|
|
|
|
|
} else if (property == "always") {
|
|
|
|
|
hscrollbar_policy = Gtk::POLICY_ALWAYS;
|
|
|
|
|
} else if (property == "auto") {
|
|
|
|
|
hscrollbar_policy = Gtk::POLICY_AUTOMATIC;
|
|
|
|
|
}
|
|
|
|
|
property = xml_property (definition, "vscroll", styles, "");
|
|
|
|
|
if (property == "never") {
|
|
|
|
|
vscrollbar_policy = Gtk::POLICY_NEVER;
|
|
|
|
|
} else if (property == "always") {
|
|
|
|
|
vscrollbar_policy = Gtk::POLICY_ALWAYS;
|
|
|
|
|
} else if (property == "auto") {
|
|
|
|
|
vscrollbar_policy = Gtk::POLICY_AUTOMATIC;
|
|
|
|
|
}
|
|
|
|
|
((Gtk::ScrolledWindow*)child)->set_policy(hscrollbar_policy, vscrollbar_policy);
|
2014-04-29 01:07:37 -05:00
|
|
|
} else if (widget_type == "VBOX") {
|
|
|
|
|
child = manage (new Gtk::VBox);
|
|
|
|
|
} else if (widget_type == "HBOX") {
|
|
|
|
|
child = manage (new Gtk::HBox);
|
2014-03-29 18:56:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (child != NULL) {
|
|
|
|
|
if (!widget_id.empty())
|
|
|
|
|
{
|
|
|
|
|
named_widgets[widget_id] = child;
|
|
|
|
|
}
|
2014-05-01 06:06:16 -05:00
|
|
|
set_attributes(*child, definition, styles);
|
2014-03-29 18:56:09 -05:00
|
|
|
}
|
|
|
|
|
return child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gtk::Widget*
|
2014-05-01 06:06:16 -05:00
|
|
|
WavesUI::add_widget (Gtk::Box& parent, const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*>& named_widgets)
|
2014-03-29 18:56:09 -05:00
|
|
|
{
|
2014-04-01 16:03:54 -05:00
|
|
|
Gtk::Widget* child = create_widget(definition, styles, named_widgets);
|
2014-03-29 18:56:09 -05:00
|
|
|
|
|
|
|
|
if (child != NULL)
|
|
|
|
|
{
|
|
|
|
|
parent.pack_start(*child, false, false);
|
|
|
|
|
}
|
|
|
|
|
return child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-04-29 01:07:37 -05:00
|
|
|
Gtk::Widget*
|
2014-05-01 06:06:16 -05:00
|
|
|
WavesUI::add_widget (Gtk::ScrolledWindow& parent, const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*>& named_widgets)
|
2014-04-29 01:07:37 -05:00
|
|
|
{
|
|
|
|
|
Gtk::Widget* child = create_widget(definition, styles, named_widgets);
|
|
|
|
|
|
|
|
|
|
if (child != NULL)
|
|
|
|
|
{
|
|
|
|
|
parent.add(*child);
|
|
|
|
|
}
|
|
|
|
|
return child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-05-19 16:30:55 -05:00
|
|
|
Gtk::Widget*
|
|
|
|
|
WavesUI::add_widget (Gtk::Window& parent, const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*>& named_widgets)
|
|
|
|
|
{
|
|
|
|
|
Gtk::Widget* child = create_widget(definition, styles, named_widgets);
|
|
|
|
|
|
|
|
|
|
if (child != NULL)
|
|
|
|
|
{
|
|
|
|
|
parent.add(*child);
|
|
|
|
|
}
|
|
|
|
|
return child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-03-29 18:56:09 -05:00
|
|
|
Gtk::Widget*
|
2014-05-01 06:06:16 -05:00
|
|
|
WavesUI::add_widget (Gtk::Layout& parent, const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*>& named_widgets)
|
2014-03-29 18:56:09 -05:00
|
|
|
{
|
2014-04-01 16:03:54 -05:00
|
|
|
Gtk::Widget* child = create_widget(definition, styles, named_widgets);
|
2014-03-29 18:56:09 -05:00
|
|
|
|
|
|
|
|
if (child != NULL)
|
|
|
|
|
{
|
|
|
|
|
parent.put (*child,
|
2014-04-14 12:37:20 -05:00
|
|
|
xml_property (definition, "x", styles, 0),
|
|
|
|
|
xml_property (definition, "y", styles, 0));
|
2014-03-29 18:56:09 -05:00
|
|
|
}
|
|
|
|
|
return child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gtk::Widget*
|
2014-05-01 06:06:16 -05:00
|
|
|
WavesUI::add_widget (Gtk::Container& parent, const XMLNode& definition, const XMLNodeMap& styles, std::map<std::string, Gtk::Widget*>& named_widgets)
|
2014-03-29 18:56:09 -05:00
|
|
|
{
|
|
|
|
|
Gtk::Widget* child = NULL;
|
|
|
|
|
if(dynamic_cast<Gtk::Layout*> (&parent)) {
|
2014-04-01 16:03:54 -05:00
|
|
|
child = WavesUI::add_widget (*dynamic_cast<Gtk::Layout*> (&parent), definition, styles, named_widgets);
|
2014-04-29 01:07:37 -05:00
|
|
|
} else if(dynamic_cast<Gtk::Box*> (&parent)) {
|
2014-04-01 16:03:54 -05:00
|
|
|
child = WavesUI::add_widget (*dynamic_cast<Gtk::Box*> (&parent), definition, styles, named_widgets);
|
2014-04-29 01:07:37 -05:00
|
|
|
} else if(dynamic_cast<Gtk::ScrolledWindow*> (&parent)) {
|
|
|
|
|
child = WavesUI::add_widget (*dynamic_cast<Gtk::ScrolledWindow*> (&parent), definition, styles, named_widgets);
|
2014-05-19 17:28:29 -05:00
|
|
|
} else if(dynamic_cast<Gtk::Window*> (&parent)) {
|
|
|
|
|
child = WavesUI::add_widget (*dynamic_cast<Gtk::Window*> (&parent), definition, styles, named_widgets);
|
2014-03-29 18:56:09 -05:00
|
|
|
}
|
|
|
|
|
|
2014-05-01 06:06:16 -05:00
|
|
|
Gtk::Container* container = dynamic_cast<Gtk::Container*>(child);
|
|
|
|
|
|
|
|
|
|
if (container != NULL) {
|
|
|
|
|
WavesUI::create_ui (definition.children(), styles, *container, named_widgets);
|
2014-05-07 10:29:26 -05:00
|
|
|
Gtk::ScrolledWindow* sw = dynamic_cast<Gtk::ScrolledWindow*>(child);
|
|
|
|
|
if (sw != NULL) {
|
|
|
|
|
Gtk::Viewport* vp = (Gtk::Viewport*)sw->get_child();
|
|
|
|
|
if (vp != NULL) {
|
|
|
|
|
set_attributes(*(Gtk::Widget*)vp, definition, styles);
|
|
|
|
|
vp->set_shadow_type(Gtk::SHADOW_NONE);
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-03-29 18:56:09 -05:00
|
|
|
}
|
|
|
|
|
return child;
|
|
|
|
|
}
|
|
|
|
|
|
2014-04-01 16:03:54 -05:00
|
|
|
void
|
2014-05-01 06:06:16 -05:00
|
|
|
WavesUI::create_ui (const XMLNodeList& definition, const XMLNodeMap& styles, Gtk::Container& root, std::map<std::string, Gtk::Widget*>& named_widgets)
|
2014-03-29 18:56:09 -05:00
|
|
|
{
|
|
|
|
|
for (XMLNodeList::const_iterator i = definition.begin(); i != definition.end(); ++i) {
|
2014-05-01 06:06:16 -05:00
|
|
|
WavesUI::add_widget (root, **i, styles, named_widgets);
|
2014-03-29 18:56:09 -05:00
|
|
|
}
|
2014-04-01 16:03:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2014-05-01 06:06:16 -05:00
|
|
|
WavesUI::create_ui (const XMLTree& layout, Gtk::Container& root, std::map<std::string, Gtk::Widget*>& named_widgets)
|
2014-04-01 16:03:54 -05:00
|
|
|
{
|
|
|
|
|
XMLNodeMap styles;
|
2014-04-14 12:37:20 -05:00
|
|
|
get_styles(layout, styles);
|
2014-04-01 16:03:54 -05:00
|
|
|
const XMLNodeList& definition = layout.root()->children();
|
|
|
|
|
WavesUI::create_ui (definition, styles, root, named_widgets);
|
2014-05-01 06:06:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static std::map<std::string, const XMLTree*> xml_tree_cache;
|
|
|
|
|
|
|
|
|
|
const XMLTree*
|
|
|
|
|
WavesUI::load_layout (const std::string xml_file_name)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
std::map<std::string, const XMLTree*>::const_iterator it = xml_tree_cache.find(xml_file_name);
|
|
|
|
|
if (it != xml_tree_cache.end()) {
|
|
|
|
|
return (*it).second;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string layout_file;
|
|
|
|
|
Searchpath spath (ardour_data_search_path());
|
|
|
|
|
spath.add_subdirectory_to_paths("ui");
|
|
|
|
|
|
|
|
|
|
if (!find_file_in_search_path (spath, xml_file_name, layout_file)) {
|
|
|
|
|
dbg_msg("File not found: " + xml_file_name);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const XMLTree* tree = new XMLTree (layout_file, false);
|
|
|
|
|
xml_tree_cache[xml_file_name] = tree;
|
|
|
|
|
|
|
|
|
|
return tree;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
WavesUI::set_attributes (Gtk::Widget& widget, const XMLNode& definition, const XMLNodeMap& styles)
|
|
|
|
|
{
|
|
|
|
|
int height = xml_property (definition, "height", styles, -1);
|
|
|
|
|
int width = xml_property (definition, "width", styles, -1);
|
|
|
|
|
widget.set_size_request (width, height);
|
|
|
|
|
|
|
|
|
|
std::string property = xml_property (definition, "bgnormal", styles, "");
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_bg(Gtk::STATE_NORMAL, Gdk::Color(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property = xml_property (definition, "bgdisabled", styles, property);
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_bg(Gtk::STATE_INSENSITIVE, Gdk::Color(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property = xml_property (definition, "bgactive", styles, "");
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_bg(Gtk::STATE_ACTIVE, Gdk::Color(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property = xml_property (definition, "bghover", styles, "");
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_bg(Gtk::STATE_PRELIGHT, Gdk::Color(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property = xml_property (definition, "fgnormal", styles, "");
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_fg(Gtk::STATE_NORMAL, Gdk::Color(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property = xml_property (definition, "fgdisabled", styles, property);
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_fg(Gtk::STATE_INSENSITIVE, Gdk::Color(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property = xml_property (definition, "fgactive", styles, "");
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_fg(Gtk::STATE_ACTIVE, Gdk::Color(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property = xml_property (definition, "fghover", styles, "");
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_fg(Gtk::STATE_PRELIGHT, Gdk::Color(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property = xml_property (definition, "font", styles, "");
|
2014-05-15 08:25:23 -05:00
|
|
|
if (!property.empty ()) {
|
2014-05-01 06:06:16 -05:00
|
|
|
widget.modify_font(Pango::FontDescription(property));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (xml_property (definition, "visible", styles, true)) {
|
|
|
|
|
widget.show();
|
|
|
|
|
} else {
|
|
|
|
|
widget.hide();
|
|
|
|
|
}
|
2014-05-15 08:25:23 -05:00
|
|
|
|
|
|
|
|
Gtk::Box* box = dynamic_cast<Gtk::Box*> (&widget);
|
|
|
|
|
if (box)
|
|
|
|
|
{
|
|
|
|
|
box->set_spacing(xml_property (definition, "spacing", styles, 0));
|
|
|
|
|
}
|
2014-05-01 06:06:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gtk::Widget*
|
|
|
|
|
WavesUI::WidgetMap::get_widget(char *id)
|
|
|
|
|
{
|
|
|
|
|
Gtk::Widget *child = NULL;
|
|
|
|
|
std::map<std::string, Gtk::Widget*>::iterator it = find(id);
|
|
|
|
|
if(it != end())
|
|
|
|
|
child = it->second;
|
|
|
|
|
|
|
|
|
|
return child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Gtk::VBox&
|
|
|
|
|
WavesUI::WidgetMap::get_vbox (char* id)
|
|
|
|
|
{
|
|
|
|
|
Gtk::VBox* child = dynamic_cast<Gtk::VBox*> (get_widget(id));
|
|
|
|
|
if (child == NULL ) {
|
|
|
|
|
throw std::exception();
|
|
|
|
|
}
|
|
|
|
|
return *child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gtk::HBox&
|
|
|
|
|
WavesUI::WidgetMap::get_hbox (char* id)
|
|
|
|
|
{
|
|
|
|
|
Gtk::HBox* child = dynamic_cast<Gtk::HBox*> (get_widget(id));
|
|
|
|
|
if (child == NULL ) {
|
|
|
|
|
throw std::exception();
|
|
|
|
|
}
|
|
|
|
|
return *child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gtk::Layout&
|
|
|
|
|
WavesUI::WidgetMap::get_layout (char* id)
|
|
|
|
|
{
|
|
|
|
|
Gtk::Layout* child = dynamic_cast<Gtk::Layout*> (get_widget(id));
|
|
|
|
|
if (child == NULL ) {
|
|
|
|
|
throw std::exception();
|
|
|
|
|
}
|
|
|
|
|
return *child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gtk::Label&
|
|
|
|
|
WavesUI::WidgetMap::get_label (char* id)
|
|
|
|
|
{
|
|
|
|
|
Gtk::Label* child = dynamic_cast<Gtk::Label*> (get_widget(id));
|
|
|
|
|
if (child == NULL ) {
|
|
|
|
|
throw std::exception();
|
|
|
|
|
}
|
|
|
|
|
return *child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gtk::ComboBoxText&
|
|
|
|
|
WavesUI::WidgetMap::get_combo_box_text (char* id)
|
|
|
|
|
{
|
|
|
|
|
Gtk::ComboBoxText* child = dynamic_cast<Gtk::ComboBoxText*> (get_widget(id));
|
|
|
|
|
if (child == NULL ) {
|
|
|
|
|
throw std::exception();
|
|
|
|
|
}
|
|
|
|
|
return *child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WavesButton&
|
|
|
|
|
WavesUI::WidgetMap::get_waves_button (char* id)
|
|
|
|
|
{
|
|
|
|
|
WavesButton* child = dynamic_cast<WavesButton*> (get_widget(id));
|
|
|
|
|
if (child == NULL ) {
|
|
|
|
|
throw std::exception();
|
|
|
|
|
}
|
|
|
|
|
return *child;
|
|
|
|
|
}
|
|
|
|
|
|