1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006-2013 Andreas Persson |
* Copyright (C) 2006-2014 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
46 |
Glib::ustring gig_to_utf8(const gig::String& gig_string); |
Glib::ustring gig_to_utf8(const gig::String& gig_string); |
47 |
gig::String gig_from_utf8(const Glib::ustring& utf8_string); |
gig::String gig_from_utf8(const Glib::ustring& utf8_string); |
48 |
|
|
49 |
|
int note_value(const Glib::ustring& note); |
50 |
|
Glib::ustring note_str(int note); |
51 |
|
|
52 |
|
void spin_button_show_notes(Gtk::SpinButton& spin_button); |
53 |
|
|
54 |
class LabelWidget { |
class LabelWidget { |
55 |
public: |
public: |
211 |
template<typename T> |
template<typename T> |
212 |
ChoiceEntry<T>::ChoiceEntry(const char* labelText) : |
ChoiceEntry<T>::ChoiceEntry(const char* labelText) : |
213 |
LabelWidget(labelText, align), |
LabelWidget(labelText, align), |
214 |
align(0, 0, 0, 0) |
align(0, 0, 0, 0), |
215 |
|
values(0) |
216 |
{ |
{ |
217 |
combobox.signal_changed().connect(sig_changed.make_slot()); |
combobox.signal_changed().connect(sig_changed.make_slot()); |
218 |
align.add(combobox); |
align.add(combobox); |
222 |
void ChoiceEntry<T>::set_choices(const char** texts, const T* values) |
void ChoiceEntry<T>::set_choices(const char** texts, const T* values) |
223 |
{ |
{ |
224 |
for (int i = 0 ; texts[i] ; i++) { |
for (int i = 0 ; texts[i] ; i++) { |
225 |
#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 |
226 |
combobox.append_text(texts[i]); |
combobox.append_text(texts[i]); |
227 |
#else |
#else |
228 |
combobox.append(texts[i]); |
combobox.append(texts[i]); |
346 |
protected: |
protected: |
347 |
M* m; |
M* m; |
348 |
int update_model; // to prevent infinite update loops |
int update_model; // to prevent infinite update loops |
349 |
PropEditor() : update_model(0) { } |
PropEditor() : m(0), update_model(0) { } |
350 |
sigc::signal<void> sig_changed; |
sigc::signal<void> sig_changed; |
351 |
|
|
352 |
template<class C, typename T> |
template<class C, typename T> |