--- gigedit/trunk/src/gigedit/paramedit.h 2013/02/24 15:19:39 2423 +++ gigedit/trunk/src/gigedit/paramedit.h 2014/05/20 14:35:36 2566 @@ -1,5 +1,5 @@ /* -*- c++ -*- - * Copyright (C) 2006-2013 Andreas Persson + * Copyright (C) 2006-2014 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 @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -41,6 +42,15 @@ #include #endif + +Glib::ustring gig_to_utf8(const gig::String& gig_string); +gig::String gig_from_utf8(const Glib::ustring& utf8_string); + +int note_value(const Glib::ustring& note); +Glib::ustring note_str(int note); + +void spin_button_show_notes(Gtk::SpinButton& spin_button); + class LabelWidget { public: Gtk::Label label; @@ -201,7 +211,8 @@ template ChoiceEntry::ChoiceEntry(const char* labelText) : LabelWidget(labelText, align), - align(0, 0, 0, 0) + align(0, 0, 0, 0), + values(0) { combobox.signal_changed().connect(sig_changed.make_slot()); align.add(combobox); @@ -211,7 +222,7 @@ void ChoiceEntry::set_choices(const char** texts, const T* values) { for (int i = 0 ; texts[i] ; i++) { -#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 +#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 24) || GTKMM_MAJOR_VERSION < 2 combobox.append_text(texts[i]); #else combobox.append(texts[i]); @@ -249,6 +260,9 @@ ChoiceEntryLeverageCtrl(const char* labelText); gig::leverage_ctrl_t get_value() const { return value; } void set_value(gig::leverage_ctrl_t value); + void set_tip(const Glib::ustring& tip_text) { + combobox.set_tooltip_text(tip_text); + } }; @@ -282,13 +296,14 @@ void set_value(int32_t value); }; + class StringEntry : public LabelWidget { private: Gtk::Entry entry; public: StringEntry(const char* labelText); - gig::String get_value() const { return entry.get_text(); } - void set_value(gig::String value) { entry.set_text(value); } + gig::String get_value() const; + void set_value(const gig::String& value); void set_width_chars(int n_chars) { entry.set_width_chars(n_chars); } }; @@ -300,7 +315,7 @@ public: StringEntryMultiLine(const char* labelText); gig::String get_value() const; - void set_value(gig::String value); + void set_value(const gig::String& value); }; @@ -334,7 +349,7 @@ protected: M* m; int update_model; // to prevent infinite update loops - PropEditor() : update_model(0) { } + PropEditor() : m(0), update_model(0) { } sigc::signal sig_changed; template