1 /* === S I N F G =========================================================== */
2 /*! \file widget_enum.cpp
3 ** \brief Template File
5 ** $Id: widget_enum.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include <gtkmm/menu.h>
32 #include "widget_enum.h"
33 #include <ETL/stringf>
34 #include <sinfg/valuenode.h>
38 /* === U S I N G =========================================================== */
42 using namespace sinfg;
43 using namespace studio;
45 /* === M A C R O S ========================================================= */
47 /* === G L O B A L S ======================================================= */
49 /* === P R O C E D U R E S ================================================= */
51 /* === M E T H O D S ======================================================= */
53 Widget_Enum::Widget_Enum()
57 Widget_Enum::~Widget_Enum()
62 Widget_Enum::set_param_desc(const sinfg::ParamDesc &x)
69 Widget_Enum::set_value_(int data)
76 Widget_Enum::refresh()
78 enum_menu = manage(new class Gtk::Menu());
80 std::list<sinfg::ParamDesc::EnumData> enum_list=param_desc.get_enum_list();
81 std::list<sinfg::ParamDesc::EnumData>::iterator iter;
83 String name=strprintf("(%d)",value);
85 for(iter=enum_list.begin();iter!=enum_list.end();iter++)
86 if(iter->value!=value)
87 enum_menu->items().push_back(Gtk::Menu_Helpers::MenuElem(iter->local_name,
88 sigc::bind(sigc::mem_fun(*this,&Widget_Enum::set_value_),iter->value)
91 name=iter->local_name;
93 enum_menu->items().push_front(Gtk::Menu_Helpers::MenuElem(name));
99 Widget_Enum::set_value(int data)
109 Widget_Enum::get_value() const