2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit 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
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkScale.html
51 private import gtk
.gtktypes
;
53 private import lib
.gtk
;
58 * A GtkScale is a slider control used to select a numeric value.
59 * To use it, you'll probably want to investigate the methods on
60 * its base class, GtkRange, in addition to the methods for GtkScale itself.
61 * To set the value of a scale, you would normally use gtk_range_set_value().
62 * To detect changes to the value, you would normally use the "value_changed"
64 * The GtkScale widget is an abstract class, used only for deriving the
65 * subclasses GtkHScale and GtkVScale. To create a scale widget,
66 * call gtk_hscale_new_with_range() or gtk_vscale_new_with_range().
68 private import gtk
.Range
;
69 public class Scale
: Range
72 /** the main Gtk struct */
73 protected GtkScale
* gtkScale
;
76 public GtkScale
* getScaleStruct()
82 /** the main Gtk struct as a void* */
83 protected void* getStruct()
85 return cast(void*)gtkScale
;
89 * Sets our main struct and passes it to the parent class
91 public this (GtkScale
* gtkScale
)
93 super(cast(GtkRange
*)gtkScale
);
94 this.gtkScale
= gtkScale
;
100 // imports for the signal processing
101 private import gobject
.Signals
;
102 private import gdk
.gdktypes
;
103 int[char[]] connectedSignals
;
105 char[] delegate(gdouble
, Scale
)[] onFormatValueListeners
;
106 void addOnFormatValue(char[] delegate(gdouble
, Scale
) dlg
)
108 if ( !("format-value" in connectedSignals
) )
113 cast(GCallback
)&callBackFormatValue
,
116 cast(ConnectFlags
)0);
117 connectedSignals
["format-value"] = 1;
119 onFormatValueListeners
~= dlg
;
121 extern(C
) static void callBackFormatValue(GtkScale
* scaleStruct
, gdouble arg1
, Scale scale
)
123 bit consumed
= false;
125 foreach ( char[] delegate(gdouble
, Scale
) dlg
; scale
.onFormatValueListeners
)
136 * Sets the number of decimal places that are displayed in the value. Also causes
137 * the value of the adjustment to be rounded off to this number of digits, so the
138 * retrieved value matches the value the user saw.
142 * the number of decimal places to display, e.g. use 1 to display 1.0,
143 * 2 to display 1.00 etc.
145 public void setDigits(int digits
)
147 // void gtk_scale_set_digits (GtkScale *scale, gint digits);
148 gtk_scale_set_digits(gtkScale
, digits
);
152 * Specifies whether the current value is displayed as a string next to the
159 public void setDrawValue(int drawValue
)
161 // void gtk_scale_set_draw_value (GtkScale *scale, gboolean draw_value);
162 gtk_scale_set_draw_value(gtkScale
, drawValue
);
166 * Sets the position in which the current value is displayed.
170 * the position in which the current value is displayed.
172 public void setValuePos(GtkPositionType pos
)
174 // void gtk_scale_set_value_pos (GtkScale *scale, GtkPositionType pos);
175 gtk_scale_set_value_pos(gtkScale
, pos
);
179 * Gets the number of decimal places that are displayed in the value.
183 * the number of decimal places that are displayed.
185 public int getDigits()
187 // gint gtk_scale_get_digits (GtkScale *scale);
188 return gtk_scale_get_digits(gtkScale
);
192 * Returns whether the current value is displayed as a string next to the
197 * whether the current value is displayed as a string.
199 public int getDrawValue()
201 // gboolean gtk_scale_get_draw_value (GtkScale *scale);
202 return gtk_scale_get_draw_value(gtkScale
);
206 * Gets the position in which the current value is displayed.
210 * the position in which the current value is displayed.
212 public GtkPositionType
getValuePos()
214 // GtkPositionType gtk_scale_get_value_pos (GtkScale *scale);
215 return gtk_scale_get_value_pos(gtkScale
);
219 * Gets the PangoLayout used to display the scale. The returned object
220 * is owned by the scale so does not need to be freed by the caller.
224 * the PangoLayout for this scale, or NULL if the draw_value property
228 public PangoLayout
* getLayout()
230 // PangoLayout* gtk_scale_get_layout (GtkScale *scale);
231 return gtk_scale_get_layout(gtkScale
);
235 * Obtains the coordinates where the scale will draw the PangoLayout
236 * representing the text in the scale. Remember
237 * when using the PangoLayout function you need to convert to
238 * and from pixels using PANGO_PIXELS() or PANGO_SCALE.
239 * If the draw_value property is FALSE, the return values are
244 * location to store X offset of layout, or NULL
246 * location to store Y offset of layout, or NULL
249 * The "digits" property
250 * "digits" gint : Read / Write
251 * The number of decimal places that are displayed in the value.
252 * Allowed values: [-1,64]
255 public void getLayoutOffsets(int* x
, int* y
)
257 // void gtk_scale_get_layout_offsets (GtkScale *scale, gint *x, gint *y);
258 gtk_scale_get_layout_offsets(gtkScale
, x
, y
);