1/*
2 * Copyright (C) 2007 The gtkmm Development Team
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
20#undef GTK_DISABLE_DEPRECATED
21#m4 _POP()
22_CONFIGINCLUDE(gtkmmconfig.h)
23
24#include <gtkmm/button.h>
25#include <gtkmm/adjustment.h>
26#include <gtkmm/enums.h>
27_DEFS(gtkmm,gtk)
28_PINCLUDE(gtkmm/private/button_p.h)
29
30namespace Gtk
31{
32
33//TODO: Inherit/Implement Orientation when we can break ABI.
34
35/** A button which pops up a scale widget.
36 *
37 * This kind of widget is commonly used for volume controls in multimedia
38 * applications, and there is a Gtk::VolumeButton subclass that is tailored
39 * for this use case.
40 *
41 * @ingroup Widgets
42 * @newin{2,12}
43 */
44class ScaleButton : public Button
45{
46  _CLASS_GTKOBJECT(ScaleButton, GtkScaleButton, GTK_SCALE_BUTTON, Gtk::Button, GtkButton)
47
48public:
49  _WRAP_CTOR(ScaleButton(IconSize size, double min, double max, double step, const Glib::StringArrayHandle& icons), gtk_scale_button_new)
50
51  _WRAP_METHOD(void set_icons(const Glib::StringArrayHandle& icons), gtk_scale_button_set_icons)
52  _WRAP_METHOD(double get_value() const, gtk_scale_button_get_value)
53  _WRAP_METHOD(void set_value(double value), gtk_scale_button_set_value)
54
55  _WRAP_METHOD(Gtk::Adjustment*	get_adjustment(), gtk_scale_button_get_adjustment, deprecated)
56
57  //The return type should bge const. This has been fixed in the gtkmm-3maybe branch.
58  _WRAP_METHOD(Gtk::Adjustment*	get_adjustment() const, gtk_scale_button_get_adjustment, constversion, deprecated)
59
60  _WRAP_METHOD(void set_adjustment(Gtk::Adjustment& adjustment), gtk_scale_button_set_adjustment)
61
62  // TODO: Should be deprecated, but we have no replacement yet, until we break ABI.
63  _WRAP_METHOD(Orientation get_orientation(), gtk_scale_button_get_orientation)
64  _WRAP_METHOD(void set_orientation(Orientation orientation), gtk_scale_button_set_orientation)
65
66  _WRAP_METHOD(Widget* get_plus_button(), gtk_scale_button_get_plus_button)
67  _WRAP_METHOD(const Widget* get_plus_button() const, gtk_scale_button_get_plus_button, constversion)
68  _WRAP_METHOD(Widget* get_minus_button(), gtk_scale_button_get_minus_button)
69  _WRAP_METHOD(const Widget* get_minus_button() const, gtk_scale_button_get_minus_button, constversion)
70  _WRAP_METHOD(Gtk::Widget* get_popup(), gtk_scale_button_get_popup)
71  _WRAP_METHOD(const Gtk::Widget* get_popup() const, gtk_scale_button_get_popup)
72
73  _WRAP_SIGNAL(void value_changed(double value), "value_changed")
74
75  //Ignore key-binding signals:
76  _IGNORE_SIGNAL("popup")
77  _IGNORE_SIGNAL("popdown")
78
79  _WRAP_PROPERTY("value", double)
80  _WRAP_PROPERTY("size", IconSize)
81  _WRAP_PROPERTY("adjustment", Adjustment*)
82  _WRAP_PROPERTY("icons", Glib::StringArrayHandle)
83  _WRAP_PROPERTY("orientation", Orientation)
84};
85
86} // namespace Gtk
87