add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / src / adjustment.ccg
1 // -*- c++ -*-
2 /* $Id: adjustment.ccg,v 1.3 2006/11/08 21:51:35 murrayc Exp $ */
3
4 /* 
5  *
6  * Copyright 1998-2002 The gtkmm Development Team
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22 #include <gtk/gtkadjustment.h>
23
24 namespace Gtk
25 {
26
27 //This is hand-coded so we can change the sequence of properties.
28 //If we don't do this then the value is restricted to the initial values, ignoring the specified boundaries:
29 Adjustment::Adjustment(double value, double lower, double upper, double step_increment, double page_increment, double page_size)
30 :
31   _CONSTRUCT("lower", lower, "upper", upper, "step_increment", step_increment, "page_increment", page_increment, "page_size", page_size, "value", value)
32 {
33 }
34
35 void Adjustment::set_lower(double lower)
36 {
37   gobj()->lower = lower;
38   changed();
39 }
40
41 void Adjustment::set_upper(double upper)
42 {
43   gobj()->upper = upper;
44   changed();
45 }
46
47 void Adjustment::set_step_increment(double incr)
48 {
49   gobj()->step_increment = incr;
50   changed();
51 }
52
53 void Adjustment::set_page_increment(double incr)
54 {
55   gobj()->page_increment = incr;
56   changed();
57 }
58
59 void Adjustment::set_page_size(double size)
60 {
61   gobj()->page_size = size;
62   changed();
63 }
64
65 } // namespace Gtk
66