/[svn]/gigedit/trunk/src/gigedit/paramedit.h
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/paramedit.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3409 by schoenebeck, Tue Jan 23 16:30:56 2018 UTC revision 3643 by schoenebeck, Sat Dec 7 15:04:51 2019 UTC
# Line 1  Line 1 
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
# Line 253  ChoiceEntry<T>::ChoiceEntry(const char* Line 253  ChoiceEntry<T>::ChoiceEntry(const char*
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    
# Line 301  public: Line 305  public:
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:
# Line 332  protected: Line 355  protected:
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;
# Line 384  class Table : Line 392  class Table :
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
# Line 435  protected: Line 442  protected:
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(

Legend:
Removed from v.3409  
changed lines
  Added in v.3643

  ViewVC Help
Powered by ViewVC