2 // Generated by gtkmmproc -- DO NOT MODIFY!
10 /* Copyright (C) 1998-2002 The gtkmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <gtkmm/widget.h>
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 typedef struct _GtkRange GtkRange;
32 typedef struct _GtkRangeClass GtkRangeClass;
33 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37 { class Range_Class; } // namespace Gtk
43 /** Base class for widgets which visualize an adjustment.
48 class Range : public Widget
51 #ifndef DOXYGEN_SHOULD_SKIP_THIS
52 typedef Range CppObjectType;
53 typedef Range_Class CppClassType;
54 typedef GtkRange BaseObjectType;
55 typedef GtkRangeClass BaseClassType;
56 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 friend class Range_Class;
64 static CppClassType range_class_;
68 Range& operator=(const Range&);
71 explicit Range(const Glib::ConstructParams& construct_params);
72 explicit Range(GtkRange* castitem);
74 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
77 #ifndef DOXYGEN_SHOULD_SKIP_THIS
78 static GType get_type() G_GNUC_CONST;
79 static GType get_base_type() G_GNUC_CONST;
82 ///Provides access to the underlying C GtkObject.
83 GtkRange* gobj() { return reinterpret_cast<GtkRange*>(gobject_); }
85 ///Provides access to the underlying C GtkObject.
86 const GtkRange* gobj() const { return reinterpret_cast<GtkRange*>(gobject_); }
90 //C++ methods used to invoke GTK+ virtual functions:
93 //GTK+ Virtual Functions (override these to change behaviour):
95 //Default Signal Handlers::
96 virtual void on_value_changed();
97 virtual void on_adjust_bounds(double new_value);
98 virtual void on_move_slider(ScrollType scroll);
108 /** Sets the update policy for the range. Gtk::UPDATE_CONTINUOUS means that
109 * anytime the range slider is moved, the range value will change and the
110 * value_changed signal will be emitted. Gtk::UPDATE_DELAYED means that
111 * the value will be updated after a brief timeout where no slider motion
112 * occurs, so updates are spaced by a short time rather than
113 * continuous. Gtk::UPDATE_DISCONTINUOUS means that the value will only
114 * be updated when the user releases the button and ends the slider
116 * @param policy Update policy.
118 void set_update_policy(UpdateType policy);
120 /** Gets the update policy of @a range . See set_update_policy().
121 * @return The current update policy.
123 UpdateType get_update_policy() const;
125 /** Sets the adjustment to be used as the "model" object for this range
126 * widget. The adjustment indicates the current range value, the
127 * minimum and maximum range values, the step/page increments used
128 * for keybindings and scrolling, and the page size. The page size
129 * is normally 0 for Gtk::Scale and nonzero for Gtk::Scrollbar, and
130 * indicates the size of the visible area of the widget being scrolled.
131 * The page size affects the size of the scrollbar slider.
132 * @param adjustment A Gtk::Adjustment.
134 void set_adjustment(Gtk::Adjustment& adjustment);
135 void unset_adjustment();
138 /** Get the Gtk::Adjustment which is the "model" object for Gtk::Range.
139 * See set_adjustment() for details.
140 * The return value does not have a reference added, so should not
142 * @return A Gtk::Adjustment.
144 Gtk::Adjustment* get_adjustment();
146 /** Get the Gtk::Adjustment which is the "model" object for Gtk::Range.
147 * See set_adjustment() for details.
148 * The return value does not have a reference added, so should not
150 * @return A Gtk::Adjustment.
152 const Gtk::Adjustment* get_adjustment() const;
154 /** Ranges normally move from lower to higher values as the
155 * slider moves from top to bottom or left to right. Inverted
156 * ranges have higher values at the top or on the right rather than
157 * on the bottom or left.
158 * @param setting <tt>true</tt> to invert the range.
160 void set_inverted(bool setting = true);
162 /** Gets the value set by set_inverted().
163 * @return <tt>true</tt> if the range is inverted.
165 bool get_inverted() const;
167 /** Sets the step and page sizes for the range.
168 * The step size is used when the user clicks the Gtk::Scrollbar
169 * arrows or moves Gtk::Scale via arrow keys. The page size
170 * is used for example when moving via Page Up or Page Down keys.
171 * @param step Step size.
172 * @param page Page size.
174 void set_increments(double step, double page);
176 /** Sets the allowable values in the Gtk::Range, and clamps the range
177 * value to be between @a min and @a max . (If the range has a non-zero
178 * page size, it is clamped between @a min and @a max - page-size.)
179 * @param min Minimum range value.
180 * @param max Maximum range value.
182 void set_range(double min, double max);
184 /** Sets the current value of the range; if the value is outside the
185 * minimum or maximum range values, it will be clamped to fit inside
186 * them. The range emits the "value_changed" signal if the value
188 * @param value New value of the range.
190 void set_value(double value);
192 /** Gets the current value of the range.
193 * @return Current value of the range.
195 double get_value() const;
198 Glib::SignalProxy0< void > signal_value_changed();
201 Glib::SignalProxy1< void,double > signal_adjust_bounds();
204 Glib::SignalProxy1< void,ScrollType > signal_move_slider();
207 //We use no_default_handler for this, because we can not add a new vfunc to 2.5 without breaking ABI.
208 //TODO: Remove no_default_handler when we do an ABI-break-with-parallel-install.
211 Glib::SignalProxy2< bool,ScrollType,double > signal_change_value();
214 /** How the range should be updated on the screen.
216 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
217 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
218 * the value of the property changes.
220 Glib::PropertyProxy<UpdateType> property_update_policy() ;
222 /** How the range should be updated on the screen.
224 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
225 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
226 * the value of the property changes.
228 Glib::PropertyProxy_ReadOnly<UpdateType> property_update_policy() const;
230 /** The GtkAdjustment that contains the current value of this range object.
232 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
233 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
234 * the value of the property changes.
236 Glib::PropertyProxy<Adjustment*> property_adjustment() ;
238 /** The GtkAdjustment that contains the current value of this range object.
240 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
241 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
242 * the value of the property changes.
244 Glib::PropertyProxy_ReadOnly<Adjustment*> property_adjustment() const;
246 /** Invert direction slider moves to increase range value.
248 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
249 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
250 * the value of the property changes.
252 Glib::PropertyProxy<bool> property_inverted() ;
254 /** Invert direction slider moves to increase range value.
256 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
257 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
258 * the value of the property changes.
260 Glib::PropertyProxy_ReadOnly<bool> property_inverted() const;
264 virtual void get_range_border_vfunc(GtkBorder* border) const;
274 /** @relates Gtk::Range
275 * @param object The C instance
276 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
277 * @result A C++ instance that wraps this C instance.
279 Gtk::Range* wrap(GtkRange* object, bool take_copy = false);
281 #endif /* _GTKMM_RANGE_H */