/[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 3363 by schoenebeck, Sun Jul 23 18:31:53 2017 UTC revision 3364 by schoenebeck, Tue Nov 14 18:07:25 2017 UTC
# Line 28  Line 28 
28    
29  #include <cmath>  #include <cmath>
30    
31    #include "compat.h"
32    
33  #include <glibmm/convert.h>  #include <glibmm/convert.h>
34  #include <gtkmm/box.h>  #include <gtkmm/box.h>
35  #include <gtkmm/adjustment.h>  #include <gtkmm/adjustment.h>
36  #include <gtkmm/alignment.h>  #if HAS_GTKMM_ALIGNMENT
37    # include <gtkmm/alignment.h>
38    #endif
39  #include <gtkmm/checkbutton.h>  #include <gtkmm/checkbutton.h>
40  #include <gtkmm/comboboxtext.h>  #include <gtkmm/comboboxtext.h>
41  #include <gtkmm/frame.h>  #include <gtkmm/frame.h>
42  #include <gtkmm/label.h>  #include <gtkmm/label.h>
43  #include <gtkmm/scale.h>  #include <gtkmm/scale.h>
44  #include <gtkmm/spinbutton.h>  #include <gtkmm/spinbutton.h>
45  #include <gtkmm/table.h>  #if USE_GTKMM_GRID
46    # include <gtkmm/grid.h>
47    #else
48    # include <gtkmm/table.h>
49    #endif
50  #include <gtkmm/textview.h>  #include <gtkmm/textview.h>
51    
52  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 12) || GTKMM_MAJOR_VERSION < 2  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 12) || GTKMM_MAJOR_VERSION < 2
# Line 83  protected: Line 91  protected:
91  #else  #else
92      Glib::RefPtr<Gtk::Adjustment> adjust;      Glib::RefPtr<Gtk::Adjustment> adjust;
93  #endif  #endif
94      Gtk::HScale scale;      HScale scale;
95      Gtk::SpinButton spinbutton;      Gtk::SpinButton spinbutton;
96      Gtk::HBox box;      HBox box;
97    
98      static int round_to_int(double x) {      static int round_to_int(double x) {
99          return int(x < 0.0 ? x - 0.5 : x + 0.5);          return int(x < 0.0 ? x - 0.5 : x + 0.5);
# Line 199  template<typename T> Line 207  template<typename T>
207  class ChoiceEntry : public LabelWidget {  class ChoiceEntry : public LabelWidget {
208  private:  private:
209      Gtk::ComboBoxText combobox;      Gtk::ComboBoxText combobox;
210    #if HAS_GTKMM_ALIGNMENT
211      Gtk::Alignment align;      Gtk::Alignment align;
212    #endif
213      const T* values;      const T* values;
214  public:  public:
215      ChoiceEntry(const char* labelText);      ChoiceEntry(const char* labelText);
# Line 218  public: Line 228  public:
228    
229  template<typename T>  template<typename T>
230  ChoiceEntry<T>::ChoiceEntry(const char* labelText) :  ChoiceEntry<T>::ChoiceEntry(const char* labelText) :
231    #if HAS_GTKMM_ALIGNMENT
232      LabelWidget(labelText, align),      LabelWidget(labelText, align),
233      align(0, 0, 0, 0),      align(0, 0, 0, 0),
234    #else
235        LabelWidget(labelText, combobox),
236    #endif
237      values(0)      values(0)
238  {  {
239      combobox.signal_changed().connect(sig_changed.make_slot());      combobox.signal_changed().connect(sig_changed.make_slot());
240    #if HAS_GTKMM_ALIGNMENT
241      align.add(combobox);      align.add(combobox);
242    #endif
243  }  }
244    
245  template<typename T>  template<typename T>
# Line 262  class ChoiceEntryLeverageCtrl : public L Line 278  class ChoiceEntryLeverageCtrl : public L
278  private:  private:
279      gig::leverage_ctrl_t value;      gig::leverage_ctrl_t value;
280      Gtk::ComboBoxText combobox;      Gtk::ComboBoxText combobox;
281    #if HAS_GTKMM_ALIGNMENT
282      Gtk::Alignment align;      Gtk::Alignment align;
283    #endif
284      void value_changed();      void value_changed();
285  public:  public:
286      ChoiceEntryLeverageCtrl(const char* labelText);      ChoiceEntryLeverageCtrl(const char* labelText);
# Line 342  public: Line 360  public:
360  /**  /**
361   * Container widget for LabelWidgets.   * Container widget for LabelWidgets.
362   */   */
363  class Table : public Gtk::Table  class Table :
364    #if USE_GTKMM_GRID
365        public Gtk::Grid
366    #else
367        public Gtk::Table
368    #endif
369  {  {
370  public:  public:
371      Table(int x, int y);      Table(int x, int y);
# Line 350  public: Line 373  public:
373      void add(BoolEntryPlus6& boolentry);      void add(BoolEntryPlus6& boolentry);
374      void add(LabelWidget& labelwidget);      void add(LabelWidget& labelwidget);
375  private:  private:
376    #if USE_GTKMM_GRID
377        int cols;
378    #endif
379      int rowno;      int rowno;
380  };  };
381    

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

  ViewVC Help
Powered by ViewVC