Ardour  9.0-pre0-582-g084a23a80d
spinbutton.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_SPINBUTTON_H
4 #define _GTKMM_SPINBUTTON_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: spinbutton.hg,v 1.4 2006/07/19 15:35:02 murrayc Exp $ */
11 
12 /* Copyright (C) 1998-2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 #include <gtkmm/entry.h>
30 #include <gtkmm/editable.h>
31 
32 
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkSpinButton GtkSpinButton;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37 
38 
39 namespace Gtk
40 { class SpinButton_Class; } // namespace Gtk
41 namespace Gtk
42 {
43 
44 
52 {
55 };
56 
57 } // namespace Gtk
58 
59 
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
61 namespace Glib
62 {
63 
64 template <>
65 class Value<Gtk::SpinButtonUpdatePolicy> : public Glib::Value_Enum<Gtk::SpinButtonUpdatePolicy>
66 {
67 public:
68  static GType value_type() G_GNUC_CONST;
69 };
70 
71 } // namespace Glib
72 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
73 
74 
75 namespace Gtk
76 {
77 
83 {
91 };
92 
93 } // namespace Gtk
94 
95 
96 #ifndef DOXYGEN_SHOULD_SKIP_THIS
97 namespace Glib
98 {
99 
100 template <>
101 class Value<Gtk::SpinType> : public Glib::Value_Enum<Gtk::SpinType>
102 {
103 public:
104  static GType value_type() G_GNUC_CONST;
105 };
106 
107 } // namespace Glib
108 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
109 
110 
111 namespace Gtk
112 {
113 
114 
116 enum { INPUT_ERROR = -1 };
117 
118 class Adjustment;
119 
126 class SpinButton : public Entry
127 {
128  public:
129 #ifndef DOXYGEN_SHOULD_SKIP_THIS
130  typedef SpinButton CppObjectType;
131  typedef SpinButton_Class CppClassType;
132  typedef GtkSpinButton BaseObjectType;
133  typedef GtkSpinButtonClass BaseClassType;
134 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
135 
136  virtual ~SpinButton();
137 
138 #ifndef DOXYGEN_SHOULD_SKIP_THIS
139 
140 private:
141  friend class SpinButton_Class;
142  static CppClassType spinbutton_class_;
143 
144  // noncopyable
145  SpinButton(const SpinButton&);
146  SpinButton& operator=(const SpinButton&);
147 
148 protected:
149  explicit SpinButton(const Glib::ConstructParams& construct_params);
150  explicit SpinButton(GtkSpinButton* castitem);
151 
152 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
153 
154 public:
155 #ifndef DOXYGEN_SHOULD_SKIP_THIS
156  static GType get_type() G_GNUC_CONST;
157 
158 
159  static GType get_base_type() G_GNUC_CONST;
160 #endif
161 
163  GtkSpinButton* gobj() { return reinterpret_cast<GtkSpinButton*>(gobject_); }
164 
166  const GtkSpinButton* gobj() const { return reinterpret_cast<GtkSpinButton*>(gobject_); }
167 
168 
169 public:
170  //C++ methods used to invoke GTK+ virtual functions:
171 
172 protected:
173  //GTK+ Virtual Functions (override these to change behaviour):
174 
175  //Default Signal Handlers::
177  virtual int on_input(double* new_value);
179  virtual bool on_output();
181  virtual void on_value_changed();
182 
183 
184 private:
185 
186 
187 public:
188 
189  //: create instance
190  // adjustment: see Gtk::Adjustment
191  // climb_rate:
192  // digits: number of decimal digits (has to be < 6)
193  SpinButton(double climb_rate = 0.0, guint digits = 0);
194  explicit SpinButton(Adjustment& adjustment, double climb_rate = 0.0, guint digits = 0);
195 
196 
204  void configure(Adjustment& adjustment, double climb_rate, guint digits);
205 
206 
211  void set_adjustment(Adjustment& adjustment);
213 
219 
225 
226 
232  void set_digits(guint digits);
233 
238  guint get_digits() const;
239 
240 
247  void set_increments(double step, double page);
248 
255  void get_increments(double& step, double& page) const;
256 
257 
263  void set_range(double min, double max);
264 
271  void get_range(double& min, double& max) const;
272 
273 
278  double get_value() const;
279 
284  int get_value_as_int() const;
285 
290  void set_value(double value);
291 
292 
299 
306 
307 
313  void set_numeric(bool numeric = true);
314 
320  bool get_numeric() const;
321 
322 
329  void spin(SpinType direction, double increment);
330 
331 
337  void set_wrap(bool wrap = true);
338 
345  bool get_wrap() const;
346 
347 
353  void set_snap_to_ticks(bool snap_to_ticks = true);
354 
360  bool get_snap_to_ticks() const;
361 
362 
365  void update();
366 
367 
380  Glib::SignalProxy1< int,double* > signal_input();
381 
382 
394  Glib::SignalProxy0< bool > signal_output();
395 
396 
403  Glib::SignalProxy0< bool > signal_wrapped();
404 
405 
412  Glib::SignalProxy0< void > signal_value_changed();
413 
414 
415  //Keybinding signals:
416 
417 
423  Glib::PropertyProxy< Gtk::Adjustment* > property_adjustment() ;
424 
430  Glib::PropertyProxy_ReadOnly< Gtk::Adjustment* > property_adjustment() const;
431 
437  Glib::PropertyProxy< double > property_climb_rate() ;
438 
444  Glib::PropertyProxy_ReadOnly< double > property_climb_rate() const;
445 
451  Glib::PropertyProxy< guint > property_digits() ;
452 
458  Glib::PropertyProxy_ReadOnly< guint > property_digits() const;
459 
465  Glib::PropertyProxy< bool > property_snap_to_ticks() ;
466 
472  Glib::PropertyProxy_ReadOnly< bool > property_snap_to_ticks() const;
473 
479  Glib::PropertyProxy< bool > property_numeric() ;
480 
486  Glib::PropertyProxy_ReadOnly< bool > property_numeric() const;
487 
493  Glib::PropertyProxy< bool > property_wrap() ;
494 
500  Glib::PropertyProxy_ReadOnly< bool > property_wrap() const;
501 
507  Glib::PropertyProxy< SpinButtonUpdatePolicy > property_update_policy() ;
508 
514  Glib::PropertyProxy_ReadOnly< SpinButtonUpdatePolicy > property_update_policy() const;
515 
521  Glib::PropertyProxy< double > property_value() ;
522 
528  Glib::PropertyProxy_ReadOnly< double > property_value() const;
529 
530 
531 };
532 
533 } // namespace Gtk
534 
535 
536 namespace Glib
537 {
546  Gtk::SpinButton* wrap(GtkSpinButton* object, bool take_copy = false);
547 } //namespace Glib
548 
549 
550 #endif /* _GTKMM_SPINBUTTON_H */
551 
static GType get_type() G_GNUC_CONST
void configure(Adjustment &adjustment, double climb_rate, guint digits)
Glib::PropertyProxy< Gtk::Adjustment * > property_adjustment()
void set_numeric(bool numeric=true)
Glib::PropertyProxy< guint > property_digits()
Glib::PropertyProxy_ReadOnly< bool > property_wrap() const
bool get_wrap() const
void set_adjustment(Adjustment &adjustment)
void set_snap_to_ticks(bool snap_to_ticks=true)
Glib::PropertyProxy_ReadOnly< Gtk::Adjustment * > property_adjustment() const
Glib::SignalProxy0< bool > signal_output()
Glib::PropertyProxy< SpinButtonUpdatePolicy > property_update_policy()
Glib::PropertyProxy< bool > property_wrap()
void set_digits(guint digits)
Glib::SignalProxy0< bool > signal_wrapped()
void get_increments(double &step, double &page) const
guint get_digits() const
SpinButtonUpdatePolicy get_update_policy() const
virtual ~SpinButton()
SpinButton(double climb_rate=0.0, guint digits=0)
Gtk::Adjustment * get_adjustment()
void get_range(double &min, double &max) const
double get_value() const
void set_value(double value)
void spin(SpinType direction, double increment)
Glib::PropertyProxy_ReadOnly< double > property_value() const
Glib::PropertyProxy_ReadOnly< double > property_climb_rate() const
void set_update_policy(SpinButtonUpdatePolicy policy)
Glib::SignalProxy1< int, double * > signal_input()
void set_range(double min, double max)
void set_increments(double step, double page)
Glib::PropertyProxy< double > property_value()
virtual int on_input(double *new_value)
This is a default handler for the signal signal_input().
GtkSpinButton * gobj()
Provides access to the underlying C GtkObject.
Definition: spinbutton.h:163
Gtk::SpinButton * wrap(GtkSpinButton *object, bool take_copy=false)
Glib::PropertyProxy< double > property_climb_rate()
virtual bool on_output()
This is a default handler for the signal signal_output().
Glib::PropertyProxy_ReadOnly< bool > property_snap_to_ticks() const
const Gtk::Adjustment * get_adjustment() const
int get_value_as_int() const
SpinButton(Adjustment &adjustment, double climb_rate=0.0, guint digits=0)
const GtkSpinButton * gobj() const
Provides access to the underlying C GtkObject.
Definition: spinbutton.h:166
Glib::PropertyProxy< bool > property_numeric()
Glib::PropertyProxy< bool > property_snap_to_ticks()
Glib::PropertyProxy_ReadOnly< SpinButtonUpdatePolicy > property_update_policy() const
Glib::PropertyProxy_ReadOnly< bool > property_numeric() const
void set_wrap(bool wrap=true)
bool get_numeric() const
virtual void on_value_changed()
This is a default handler for the signal signal_value_changed().
bool get_snap_to_ticks() const
void unset_adjustment()
Glib::SignalProxy0< void > signal_value_changed()
Glib::PropertyProxy_ReadOnly< guint > property_digits() const
SpinType
Definition: spinbutton.h:83
SpinButtonUpdatePolicy
Definition: spinbutton.h:52
@ SPIN_STEP_FORWARD
Definition: spinbutton.h:84
@ SPIN_HOME
Definition: spinbutton.h:88
@ SPIN_USER_DEFINED
Definition: spinbutton.h:90
@ SPIN_PAGE_FORWARD
Definition: spinbutton.h:86
@ SPIN_PAGE_BACKWARD
Definition: spinbutton.h:87
@ SPIN_STEP_BACKWARD
Definition: spinbutton.h:85
@ SPIN_END
Definition: spinbutton.h:89
@ INPUT_ERROR
Definition: spinbutton.h:116
@ UPDATE_IF_VALID
Definition: spinbutton.h:54
@ UPDATE_ALWAYS
Definition: spinbutton.h:53
Definition: ardour_ui.h:188
Wrap increment(Time &timecode, uint32_t)
Definition: lobject.h:100