/[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 3364 by schoenebeck, Tue Nov 14 18:07:25 2017 UTC revision 3441 by schoenebeck, Sun Dec 9 20:48:18 2018 UTC
# Line 70  public: Line 70  public:
70          return sig_changed;          return sig_changed;
71      }      }
72  protected:  protected:
73        virtual void on_show_tooltips_changed();
74  #ifdef OLD_TOOLTIPS  #ifdef OLD_TOOLTIPS
75      Gtk::Tooltips tooltips;      Gtk::Tooltips tooltips;
76  #endif  #endif
# Line 98  protected: Line 99  protected:
99      static int round_to_int(double x) {      static int round_to_int(double x) {
100          return int(x < 0.0 ? x - 0.5 : x + 0.5);          return int(x < 0.0 ? x - 0.5 : x + 0.5);
101      }      }
102    
103  public:  public:
104      NumEntry(const char* labelText, double lower = 0, double upper = 127,      NumEntry(const char* labelText, double lower = 0, double upper = 127,
105               int decimals = 0);               int decimals = 0);
# Line 115  public: Line 117  public:
117          adjust->set_upper(upper);          adjust->set_upper(upper);
118  #endif  #endif
119      }      }
120        void on_show_tooltips_changed();
121  };  };
122    
123  class NumEntryGain : public NumEntry {  class NumEntryGain : public NumEntry {
# Line 202  public: Line 205  public:
205      void set_value(uint16_t value);      void set_value(uint16_t value);
206  };  };
207    
208    class ChoiceEntryBase : public LabelWidget {
209    protected:
210        ChoiceEntryBase(const char* labelText, Gtk::Widget& widget) : LabelWidget(labelText, widget) {};
211        Gtk::ComboBoxText combobox;
212        void on_show_tooltips_changed();
213    };
214    
215  template<typename T>  template<typename T>
216  class ChoiceEntry : public LabelWidget {  class ChoiceEntry : public ChoiceEntryBase {
217  private:  private:
     Gtk::ComboBoxText combobox;  
218  #if HAS_GTKMM_ALIGNMENT  #if HAS_GTKMM_ALIGNMENT
219      Gtk::Alignment align;      Gtk::Alignment align;
220  #endif  #endif
# Line 229  public: Line 237  public:
237  template<typename T>  template<typename T>
238  ChoiceEntry<T>::ChoiceEntry(const char* labelText) :  ChoiceEntry<T>::ChoiceEntry(const char* labelText) :
239  #if HAS_GTKMM_ALIGNMENT  #if HAS_GTKMM_ALIGNMENT
240      LabelWidget(labelText, align),      ChoiceEntryBase(labelText, align),
241      align(0, 0, 0, 0),      align(0, 0, 0, 0),
242  #else  #else
243      LabelWidget(labelText, combobox),      ChoiceEntryBase(labelText, combobox),
244  #endif  #endif
245      values(0)      values(0)
246  {  {
# Line 245  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  {  {
256        combobox.remove_all();
257      for (int i = 0 ; texts[i] ; i++) {      for (int i = 0 ; texts[i] ; i++) {
258  #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
259          combobox.append_text(texts[i]);          combobox.append_text(texts[i]);
# Line 282  private: Line 291  private:
291      Gtk::Alignment align;      Gtk::Alignment align;
292  #endif  #endif
293      void value_changed();      void value_changed();
294    protected:
295        void on_show_tooltips_changed();
296  public:  public:
297      ChoiceEntryLeverageCtrl(const char* labelText);      ChoiceEntryLeverageCtrl(const char* labelText);
298      gig::leverage_ctrl_t get_value() const { return value; }      gig::leverage_ctrl_t get_value() const { return value; }
# Line 311  public: Line 322  public:
322    
323  class BoolBox : public Gtk::CheckButton {  class BoolBox : public Gtk::CheckButton {
324  public:  public:
325      BoolBox(const char* labelText) : Gtk::CheckButton(labelText) {      BoolBox(const char* labelText);
         signal_toggled().connect(sig_changed.make_slot());  
     }  
326      bool get_value() const { return get_active(); }      bool get_value() const { return get_active(); }
327      void set_value(bool value) { set_active(value); }      void set_value(bool value) { set_active(value); }
328      sigc::signal<void>& signal_value_changed() { return sig_changed; }      sigc::signal<void>& signal_value_changed() { return sig_changed; }
329  protected:  protected:
330        void on_show_tooltips_changed();
331    
332      sigc::signal<void> sig_changed;      sigc::signal<void> sig_changed;
333  };  };
334    
# Line 328  private: Line 339  private:
339      void value_changed();      void value_changed();
340      NumEntryGain& eGain;      NumEntryGain& eGain;
341      int32_t plus6value;      int32_t plus6value;
342    protected:
343        void on_show_tooltips_changed();
344  public:  public:
345      BoolEntryPlus6(const char* labelText, NumEntryGain& eGain, int32_t plus6value);      BoolEntryPlus6(const char* labelText, NumEntryGain& eGain, int32_t plus6value);
346      int32_t get_value() const;      int32_t get_value() const;
# Line 350  private: Line 363  private:
363      Gtk::TextView text_view;      Gtk::TextView text_view;
364      Glib::RefPtr<Gtk::TextBuffer> text_buffer;      Glib::RefPtr<Gtk::TextBuffer> text_buffer;
365      Gtk::Frame frame;      Gtk::Frame frame;
366    protected:
367        void on_show_tooltips_changed();
368  public:  public:
369      StringEntryMultiLine(const char* labelText);      StringEntryMultiLine(const char* labelText);
370      gig::String get_value() const;      gig::String get_value() const;

Legend:
Removed from v.3364  
changed lines
  Added in v.3441

  ViewVC Help
Powered by ViewVC