Back to index

easystroke  0.5.5.1
Classes | Public Member Functions | Private Member Functions | Private Attributes
Combo< T > Class Template Reference
Inheritance diagram for Combo< T >:
Inheritance graph
[legend]
Collaboration diagram for Combo< T >:
Collaboration graph
[legend]

List of all members.

Classes

struct  Info

Public Member Functions

 Combo (IO< T > &io_, const Glib::ustring &name, const Info *info_)

Private Member Functions

virtual void notify ()
void on_changed ()

Private Attributes

IO< T > & io
const Infoinfo
Gtk::ComboBoxText * combo

Detailed Description

template<class T>
class Combo< T >

Definition at line 86 of file prefs.cc.


Class Documentation

struct Combo::Info

template<class T>
struct Combo< T >::Info

Definition at line 88 of file prefs.cc.

Collaboration diagram for Combo< T >::Info:
Class Members
const char * name
T value

Constructor & Destructor Documentation

template<class T >
Combo< T >::Combo ( IO< T > &  io_,
const Glib::ustring &  name,
const Info info_ 
) [inline]

Definition at line 112 of file prefs.cc.

                                                                     : io(io_), info(info_) {
              io.connect(this);
              Gtk::Bin *parent;
              widgets->get_widget(name, parent);
              combo = Gtk::manage(new Gtk::ComboBoxText);
              parent->add(*combo);
              for (const Info *i = info; i->name; i++)
                     combo->append_text(_(i->name));
              notify();
              combo->signal_changed().connect(sigc::mem_fun(*this, &Combo::on_changed));
              combo->show();
       }

Here is the call graph for this function:


Member Function Documentation

template<class T >
virtual void Combo< T >::notify ( ) [inline, private, virtual]

Implements Base.

Definition at line 96 of file prefs.cc.

                             {
              T value = io.get();
              int i = 0;
              while (info[i].name && info[i].value != value) i++;
              combo->set_active(i);
       }

Here is the caller graph for this function:

template<class T >
void Combo< T >::on_changed ( ) [inline, private]

Definition at line 102 of file prefs.cc.

                         {
              int row = combo->get_active_row_number();
              if (row < 0)
                     return;
              T value = info[row].value;
              if (value == io.get())
                     return;
              io.set(value);
       }

Here is the caller graph for this function:


Member Data Documentation

template<class T >
Gtk::ComboBoxText* Combo< T >::combo [private]

Definition at line 95 of file prefs.cc.

template<class T >
const Info* Combo< T >::info [private]

Definition at line 94 of file prefs.cc.

template<class T >
IO<T>& Combo< T >::io [private]

Definition at line 93 of file prefs.cc.


The documentation for this class was generated from the following file: