/[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 2151 by persson, Sun Nov 21 12:38:41 2010 UTC revision 2169 by persson, Sun Mar 6 07:51:04 2011 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2006-2010 Andreas Persson   * Copyright (C) 2006-2011 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 27  Line 27 
27  #include <gtkmm/adjustment.h>  #include <gtkmm/adjustment.h>
28  #include <gtkmm/alignment.h>  #include <gtkmm/alignment.h>
29  #include <gtkmm/box.h>  #include <gtkmm/box.h>
30    #include <gtkmm/checkbutton.h>
31  #include <gtkmm/comboboxtext.h>  #include <gtkmm/comboboxtext.h>
32  #include <gtkmm/frame.h>  #include <gtkmm/frame.h>
33  #include <gtkmm/label.h>  #include <gtkmm/label.h>
# Line 58  protected: Line 59  protected:
59    
60  class NumEntry : public LabelWidget {  class NumEntry : public LabelWidget {
61  protected:  protected:
62    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
63      Gtk::Adjustment adjust;      Gtk::Adjustment adjust;
64    #else
65        Glib::RefPtr<Gtk::Adjustment> adjust;
66    #endif
67      Gtk::HScale scale;      Gtk::HScale scale;
68      Gtk::SpinButton spinbutton;      Gtk::SpinButton spinbutton;
69      Gtk::HBox box;      Gtk::HBox box;
# Line 77  public: Line 82  public:
82  #endif  #endif
83      }      }
84      void set_upper(double upper) {      void set_upper(double upper) {
85    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
86          adjust.set_upper(upper);          adjust.set_upper(upper);
87    #else
88            adjust->set_upper(upper);
89    #endif
90      }      }
91  };  };
92    
# Line 130  void NumEntryTemp<T>::value_changed() Line 139  void NumEntryTemp<T>::value_changed()
139  template<typename T>  template<typename T>
140  void NumEntryTemp<T>::set_value(T value)  void NumEntryTemp<T>::set_value(T value)
141  {  {
142    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
143      if (value > adjust.get_upper()) value = T(adjust.get_upper());      if (value > adjust.get_upper()) value = T(adjust.get_upper());
144    #else
145        if (value > adjust->get_upper()) value = T(adjust->get_upper());
146    #endif
147      if (this->value != value) {      if (this->value != value) {
148          this->value = value;          this->value = value;
149          const double f = pow(10, spinbutton.get_digits());          const double f = pow(10, spinbutton.get_digits());
# Line 197  template<typename T> Line 210  template<typename T>
210  void ChoiceEntry<T>::set_choices(const char** texts, const T* values)  void ChoiceEntry<T>::set_choices(const char** texts, const T* values)
211  {  {
212      for (int i = 0 ; texts[i] ; i++) {      for (int i = 0 ; texts[i] ; i++) {
213    #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
214          combobox.append_text(texts[i]);          combobox.append_text(texts[i]);
215    #else
216            combobox.append(texts[i]);
217    #endif
218      }      }
219      this->values = values;      this->values = values;
220  }  }

Legend:
Removed from v.2151  
changed lines
  Added in v.2169

  ViewVC Help
Powered by ViewVC