--- gigedit/trunk/src/gigedit/paramedit.h 2007/12/08 12:28:53 1582 +++ gigedit/trunk/src/gigedit/paramedit.h 2010/11/21 12:38:41 2151 @@ -1,5 +1,5 @@ /* -*- c++ -*- - * Copyright (C) 2006, 2007 Andreas Persson + * Copyright (C) 2006-2010 Andreas Persson * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -22,7 +22,7 @@ #include -#include +#include #include #include @@ -33,7 +33,11 @@ #include #include #include + +#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 12) || GTKMM_MAJOR_VERSION < 2 +#define OLD_TOOLTIPS #include +#endif class LabelWidget { public: @@ -46,7 +50,9 @@ return sig_changed; } protected: +#ifdef OLD_TOOLTIPS Gtk::Tooltips tooltips; +#endif sigc::signal sig_changed; }; @@ -64,7 +70,11 @@ NumEntry(const char* labelText, double lower = 0, double upper = 127, int decimals = 0); void set_tip(const Glib::ustring& tip_text) { +#ifdef OLD_TOOLTIPS tooltips.set_tip(spinbutton, tip_text); +#else + spinbutton.set_tooltip_text(tip_text); +#endif } void set_upper(double upper) { adjust.set_upper(upper); @@ -166,14 +176,18 @@ void set_choices(const char** texts, const T* values); void set_tip(const Glib::ustring& tip_text) { - tooltips.set_tip(combobox, tip_text); //FIXME: don't Gtk::ComboBoxes support tooltips ??? +#ifdef OLD_TOOLTIPS + tooltips.set_tip(combobox, tip_text); +#else + combobox.set_tooltip_text(tip_text); +#endif } }; template ChoiceEntry::ChoiceEntry(const char* labelText) : - align(0, 0, 0, 0), - LabelWidget(labelText, align) + LabelWidget(labelText, align), + align(0, 0, 0, 0) { combobox.signal_changed().connect(sig_changed.make_slot()); align.add(combobox); @@ -229,7 +243,11 @@ void set_value(bool value) { checkbutton.set_active(value); } void set_tip(const Glib::ustring& tip_text) { +#ifdef OLD_TOOLTIPS tooltips.set_tip(checkbutton, tip_text); +#else + checkbutton.set_tooltip_text(tip_text); +#endif } };