/[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 2446 by persson, Sun Apr 28 15:40:43 2013 UTC revision 2690 by schoenebeck, Sun Jan 4 18:36:42 2015 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006-2013 Andreas Persson   * Copyright (C) 2006-2015 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 46  Line 46 
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:
# Line 64  protected: Line 68  protected:
68      sigc::signal<void> sig_changed;      sigc::signal<void> sig_changed;
69  };  };
70    
71    class ReadOnlyLabelWidget : public LabelWidget {
72    public:
73        Gtk::Label text;
74    
75        ReadOnlyLabelWidget(const char* leftHandText);
76        ReadOnlyLabelWidget(const char* leftHandText, const char* rightHandText);
77    };
78    
79  class NumEntry : public LabelWidget {  class NumEntry : public LabelWidget {
80  protected:  protected:
81  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
# Line 207  public: Line 219  public:
219  template<typename T>  template<typename T>
220  ChoiceEntry<T>::ChoiceEntry(const char* labelText) :  ChoiceEntry<T>::ChoiceEntry(const char* labelText) :
221      LabelWidget(labelText, align),      LabelWidget(labelText, align),
222      align(0, 0, 0, 0)      align(0, 0, 0, 0),
223        values(0)
224  {  {
225      combobox.signal_changed().connect(sig_changed.make_slot());      combobox.signal_changed().connect(sig_changed.make_slot());
226      align.add(combobox);      align.add(combobox);
# Line 217  template<typename T> Line 230  template<typename T>
230  void ChoiceEntry<T>::set_choices(const char** texts, const T* values)  void ChoiceEntry<T>::set_choices(const char** texts, const T* values)
231  {  {
232      for (int i = 0 ; texts[i] ; i++) {      for (int i = 0 ; texts[i] ; i++) {
233  #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
234          combobox.append_text(texts[i]);          combobox.append_text(texts[i]);
235  #else  #else
236          combobox.append(texts[i]);          combobox.append(texts[i]);
# Line 255  public: Line 268  public:
268      ChoiceEntryLeverageCtrl(const char* labelText);      ChoiceEntryLeverageCtrl(const char* labelText);
269      gig::leverage_ctrl_t get_value() const { return value; }      gig::leverage_ctrl_t get_value() const { return value; }
270      void set_value(gig::leverage_ctrl_t value);      void set_value(gig::leverage_ctrl_t value);
271        void set_tip(const Glib::ustring& tip_text) {
272            combobox.set_tooltip_text(tip_text);
273        }
274  };  };
275    
276    
# Line 341  public: Line 357  public:
357  protected:  protected:
358      M* m;      M* m;
359      int update_model; // to prevent infinite update loops      int update_model; // to prevent infinite update loops
360      PropEditor() : update_model(0) { }      PropEditor() : m(0), update_model(0) { }
361      sigc::signal<void> sig_changed;      sigc::signal<void> sig_changed;
362    
363      template<class C, typename T>      template<class C, typename T>

Legend:
Removed from v.2446  
changed lines
  Added in v.2690

  ViewVC Help
Powered by ViewVC