1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006-2017 Andreas Persson |
* Copyright (C) 2006-2019 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 |
253 |
template<typename T> |
template<typename T> |
254 |
void ChoiceEntry<T>::set_choices(const char** texts, const T* values) |
void ChoiceEntry<T>::set_choices(const char** texts, const T* values) |
255 |
{ |
{ |
|
for (int i = 0 ; texts[i] ; i++) { |
|
256 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 24) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 24) || GTKMM_MAJOR_VERSION < 2 |
257 |
|
combobox.clear_items(); |
258 |
|
for (int i = 0 ; texts[i] ; i++) { |
259 |
combobox.append_text(texts[i]); |
combobox.append_text(texts[i]); |
260 |
|
} |
261 |
#else |
#else |
262 |
|
combobox.remove_all(); |
263 |
|
for (int i = 0 ; texts[i] ; i++) { |
264 |
combobox.append(texts[i]); |
combobox.append(texts[i]); |
|
#endif |
|
265 |
} |
} |
266 |
|
#endif |
267 |
this->values = values; |
this->values = values; |
268 |
} |
} |
269 |
|
|
305 |
} |
} |
306 |
}; |
}; |
307 |
|
|
308 |
|
class ChoiceEntryLfoWave : public LabelWidget { |
309 |
|
private: |
310 |
|
gig::lfo_wave_t value; |
311 |
|
Gtk::ComboBoxText combobox; |
312 |
|
#if HAS_GTKMM_ALIGNMENT |
313 |
|
Gtk::Alignment align; |
314 |
|
#endif |
315 |
|
void value_changed(); |
316 |
|
protected: |
317 |
|
void on_show_tooltips_changed(); |
318 |
|
public: |
319 |
|
ChoiceEntryLfoWave(const char* labelText); |
320 |
|
gig::lfo_wave_t get_value() const { return value; } |
321 |
|
void set_value(gig::lfo_wave_t value); |
322 |
|
void set_tip(const Glib::ustring& tip_text) { |
323 |
|
combobox.set_tooltip_text(tip_text); |
324 |
|
} |
325 |
|
}; |
326 |
|
|
327 |
|
|
328 |
class BoolEntry : public LabelWidget { |
class BoolEntry : public LabelWidget { |
329 |
private: |
private: |
355 |
}; |
}; |
356 |
|
|
357 |
|
|
|
class BoolEntryPlus6 : public LabelWidget { |
|
|
private: |
|
|
Gtk::CheckButton checkbutton; |
|
|
void value_changed(); |
|
|
NumEntryGain& eGain; |
|
|
int32_t plus6value; |
|
|
protected: |
|
|
void on_show_tooltips_changed(); |
|
|
public: |
|
|
BoolEntryPlus6(const char* labelText, NumEntryGain& eGain, int32_t plus6value); |
|
|
int32_t get_value() const; |
|
|
void set_value(int32_t value); |
|
|
}; |
|
|
|
|
|
|
|
358 |
class StringEntry : public LabelWidget { |
class StringEntry : public LabelWidget { |
359 |
private: |
private: |
360 |
Gtk::Entry entry; |
Gtk::Entry entry; |
392 |
public: |
public: |
393 |
Table(int x, int y); |
Table(int x, int y); |
394 |
void add(BoolEntry& boolentry); |
void add(BoolEntry& boolentry); |
|
void add(BoolEntryPlus6& boolentry); |
|
395 |
void add(LabelWidget& labelwidget); |
void add(LabelWidget& labelwidget); |
396 |
private: |
private: |
397 |
#if USE_GTKMM_GRID |
#if USE_GTKMM_GRID |
442 |
sigc::bind(sigc::mem_fun(*this, f), &widget, setter)); |
sigc::bind(sigc::mem_fun(*this, f), &widget, setter)); |
443 |
} |
} |
444 |
|
|
445 |
|
template<class C, class F> |
446 |
|
void connectLambda(C& widget, F fn) { |
447 |
|
widget.signal_value_changed().connect([&widget,fn]{ |
448 |
|
fn( widget.get_value() ); |
449 |
|
}); |
450 |
|
} |
451 |
|
|
452 |
void connect(NoteEntry& eKeyRangeLow, NoteEntry& eKeyRangeHigh, |
void connect(NoteEntry& eKeyRangeLow, NoteEntry& eKeyRangeHigh, |
453 |
gig::range_t M::* range) { |
gig::range_t M::* range) { |
454 |
eKeyRangeLow.signal_value_changed().connect( |
eKeyRangeLow.signal_value_changed().connect( |