| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
_CONFIGINCLUDE(gtkmmconfig.h) |
| 18 |
|
| 19 |
#include <glibmm/object.h> |
| 20 |
_DEFS(gtkmm,gtk) |
| 21 |
_PINCLUDE(glibmm/private/object_p.h) |
| 22 |
|
| 23 |
namespace Gtk |
| 24 |
{ |
| 25 |
|
| 26 |
/** A class representing an adjustable bounded value. |
| 27 |
* |
| 28 |
* The Gtk::Adjustment object represents a value which has an associated |
| 29 |
* lower and upper bound, together with step and page increments, and a page |
| 30 |
* size. It is used within several gtkmm widgets, including |
| 31 |
* Gtk::SpinButton, Gtk::Viewport, and Gtk::Range (which is a base class for |
| 32 |
* Gtk::HScrollbar, Gtk::VScrollbar, Gtk::HScale, and Gtk::VScale). |
| 33 |
* |
| 34 |
* The Gtk::Adjustment object does not update the value itself. Instead it |
| 35 |
* is left up to the owner of the Gtk::Adjustment to control the value. |
| 36 |
* |
| 37 |
* The owner of the Gtk::Adjustment typically calls the value_changed() and |
| 38 |
* changed() functions after changing the value and its bounds. This results |
| 39 |
* in the emission of the "value_changed" or "changed" signal respectively. |
| 40 |
* |
| 41 |
*/ |
| 42 |
class GTKMM_API Adjustment : public Glib::Object |
| 43 |
{ |
| 44 |
_CLASS_GOBJECT(Adjustment,GtkAdjustment,GTK_ADJUSTMENT,Glib::Object,GObject,,,GTKMM_API) |
| 45 |
_DERIVES_INITIALLY_UNOWNED() |
| 46 |
public: |
| 47 |
|
| 48 |
friend class GTKMM_API Range; |
| 49 |
friend class GTKMM_API HScrollbar; |
| 50 |
friend class GTKMM_API VScrollbar; |
| 51 |
|
| 52 |
protected: |
| 53 |
/** Constructor to create an Adjustment object. |
| 54 |
* @param value The initial value |
| 55 |
* @param lower The minimum value |
| 56 |
* @param upper The maximum value |
| 57 |
* @param step_increment The step increment |
| 58 |
* @param page_increment The page increment |
| 59 |
* @param page_size The page size |
| 60 |
*/ |
| 61 |
Adjustment(double value, double lower, double upper, double step_increment = 1, double page_increment = 10, double page_size = 0); |
| 62 |
|
| 63 |
public: |
| 64 |
_WRAP_CREATE(double value, double lower, double upper, double step_increment = 1, double page_increment = 10, double page_size = 0) |
| 65 |
|
| 66 |
_WRAP_METHOD(void changed(), gtk_adjustment_changed, |
| 67 |
deprecated "GTK+ emits a 'changed' signal itself whenever any of the properties (other than value) change.") |
| 68 |
_WRAP_METHOD(void value_changed(), gtk_adjustment_value_changed, |
| 69 |
deprecated "GTK+ emits a 'value_changed' signal itself whenever the value changes.") |
| 70 |
|
| 71 |
_WRAP_METHOD(void clamp_page(double lower, double upper), gtk_adjustment_clamp_page) |
| 72 |
|
| 73 |
_WRAP_METHOD(void set_value(double value), gtk_adjustment_set_value) |
| 74 |
_WRAP_METHOD(double get_value() const, gtk_adjustment_get_value) |
| 75 |
|
| 76 |
_WRAP_METHOD(void set_lower(double lower), gtk_adjustment_set_lower) |
| 77 |
_WRAP_METHOD(double get_lower() const, gtk_adjustment_get_lower) |
| 78 |
|
| 79 |
_WRAP_METHOD(void set_upper(double upper), gtk_adjustment_set_upper) |
| 80 |
_WRAP_METHOD(double get_upper() const, gtk_adjustment_get_upper) |
| 81 |
|
| 82 |
_WRAP_METHOD(void set_step_increment(double step_increment), gtk_adjustment_set_step_increment) |
| 83 |
_WRAP_METHOD(double get_step_increment() const, gtk_adjustment_get_step_increment) |
| 84 |
|
| 85 |
_WRAP_METHOD(void set_page_increment(double page_increment), gtk_adjustment_set_page_increment) |
| 86 |
_WRAP_METHOD(double get_page_increment() const, gtk_adjustment_get_page_increment) |
| 87 |
|
| 88 |
_WRAP_METHOD(void set_page_size(double page_size), gtk_adjustment_set_page_size) |
| 89 |
_WRAP_METHOD(double get_page_size() const, gtk_adjustment_get_page_size) |
| 90 |
|
| 91 |
_WRAP_METHOD(void configure(double value, double lower, double upper, double step_increment, double page_increment, double page_size), gtk_adjustment_configure) |
| 92 |
|
| 93 |
_WRAP_METHOD(double get_minimum_increment() const, gtk_adjustment_get_minimum_increment) |
| 94 |
|
| 95 |
_WRAP_SIGNAL(void changed(), "changed") |
| 96 |
_WRAP_SIGNAL(void value_changed(), "value_changed") |
| 97 |
|
| 98 |
_WRAP_PROPERTY("value", double) |
| 99 |
_WRAP_PROPERTY("lower", double) |
| 100 |
_WRAP_PROPERTY("upper", double) |
| 101 |
_WRAP_PROPERTY("step-increment", double) |
| 102 |
_WRAP_PROPERTY("page-increment", double) |
| 103 |
_WRAP_PROPERTY("page-size", double) |
| 104 |
|
| 105 |
}; |
| 106 |
|
| 107 |
} //namespace Gtk |