## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --               GtkAda - Ada95 binding for Gtk+/Gnome               --

3.     --                                                                   --

4.     --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --

5.     --                Copyright (C) 2000-2007 AdaCore                    --

6.     --                                                                   --

7.     -- This library is free software; you can redistribute it and/or     --

8.     -- modify it under the terms of the GNU General Public               --

9.     -- License as published by the Free Software Foundation; either      --

10.     -- version 2 of the License, or (at your option) any later version.  --

11.     --                                                                   --

12.     -- This library is distributed in the hope that it will be useful,   --

13.     -- but WITHOUT ANY WARRANTY; without even the implied warranty of    --

14.     -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --

15.     -- General Public License for more details.                          --

16.     --                                                                   --

17.     -- You should have received a copy of the GNU General Public         --

18.     -- License along with this library; if not, write to the             --

19.     -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --

20.     -- Boston, MA 02111-1307, USA.                                       --

21.     --                                                                   --

22.     -- As a special exception, if other files instantiate generics from  --

23.     -- this unit, or you link this unit with other files to produce an   --

24.     -- executable, this  unit  does not  by itself cause  the resulting  --

25.     -- executable to be covered by the GNU General Public License. This  --

26.     -- exception does not however invalidate any other reasons why the   --

27.     -- executable file  might be covered by the  GNU Public License.     --

28.     -----------------------------------------------------------------------

30.     --  <description>

31.     --  A Gtk_Spin_Button is a single line text editing widget for text that

32.     --  represents a number. At the right hand side of the text line there are

33.     --  small up- and down arrow buttons for incrementing or decrementing

34.     --  (spinning) the number within a given range.

35.     --  It allows the value to have zero or a number of decimal places and

36.     --  to be incremented/decremented in configurable steps.

37.     --  The action of holding down one of the buttons optionally results in an

38.     --  acceleration of change in the value according to how long it is

39.     --  depressed.

40.     --

41.     --  See Gtk.GEntry for a text editing widget without spin buttons.

42.     --  </description>

43.     --  <c_version>2.8.17</c_version>

44.     --  <group>Numeric/Text Data Entry</group>

45.     --  <screenshot>gtk-spin_button</screenshot>

46.     --  <testgtk>create_spin.adb</testgtk>

48.     with Glib.Generic_PropertiesTo API docTo specTo body;

49.     with Glib.PropertiesTo API docTo specTo body;

50.     with Gtk.AdjustmentTo API docTo specTo body;

51.     with Gtk.GEntryTo API docTo specTo body;

53.     package Gtk.Spin_ButtonTo API docTo specTo body is

55.        type Gtk_Spin_Button_RecordTo API docTo body is new Gtk.GEntry.Gtk_Entry_RecordTo API docTo specTo body with private;

56.        type Gtk_Spin_Button is access all Gtk_Spin_Button_RecordTo API docTo specTo body'Class;

58.        type Gtk_Spin_Button_Update_Policy is

59.          (Update_Always,

60.           --  Update always, errors are ignored while converting text into a

61.           --  numeric value.

63.           Update_If_Valid

64.           --  The spin button's value gets changed if the text input is a numeric

65.           --  value that is within the range specified by the adjustment.

66.          );

67.        --  Determine the update policy of the spin button which affects the

68.        --  behaviour when parsing inserted text and syncing its value with the

69.        --  values of the adjustment.

70.        pragma Convention (C, Gtk_Spin_Button_Update_PolicyTo API docTo spec);

72.        type Gtk_Spin_Type is

73.          (Spin_Step_Forward,

74.           Spin_Step_Backward,

75.           Spin_Page_Forward,

76.           Spin_Page_Backward,

77.           Spin_Home,

78.           Spin_End,

79.           Spin_User_Defined);

80.        --  Determine how manual spinning should be done.

81.        --  See also the Spin procedure.

82.        pragma Convention (C, Gtk_Spin_TypeTo API docTo spec);

84.        procedure Gtk_NewTo API docTo body

85.          (Spin_Button : out Gtk_Spin_ButtonTo API docTo spec;

86.           Adjustment  : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec;

87.           Climb_Rate  : GdoubleTo API docTo spec;

88.           The_Digits  : GintTo API docTo spec);

89.        --  Create a spin button with the given parameters.

90.        --  Adjustment contains the range, current value, step value and

91.        --  "page" value. The step value is the increment/decrement when pressing

92.        --  mouse button 1 on a button; the page value when mouse button 2 is

93.        --  pressed. Additionally, mouse button 3 can be used to jump directly to

94.        --  the or lower values when used to select one of the buttons.

95.        --  Climb_Rate takes a value between 0.0 and 1.0 and indicates the

96.        --  amount of acceleration that the Spin Button has.

97.        --  The_Digits is the number of digits behind the decimal point to be

98.        --  displayed for the value.

100.        procedure Gtk_NewTo API docTo body

101.          (Spin_Button : out Gtk_Spin_ButtonTo API docTo spec;

102.           Min         : GdoubleTo API docTo spec;

103.           Max         : GdoubleTo API docTo spec;

104.           Step        : GdoubleTo API docTo spec);

105.        --  Same as above, but with explicit range instead of an adjustment.

106.        --  The adjustment associated with Spin_Button is created internally.

108.        procedure InitializeTo API docTo body

109.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body'Class;

110.           Adjustment  : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec;

111.           Climb_Rate  : GdoubleTo API docTo spec;

112.           The_Digits  : GintTo API docTo spec);

113.        --  Internal initialization function.

114.        --  See the section "Creating your own widgets" in the documentation.

116.        procedure InitializeTo API docTo body

117.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body'Class;

118.           Min         : GdoubleTo API docTo spec;

119.           Max         : GdoubleTo API docTo spec;

120.           Step        : GdoubleTo API docTo spec);

121.        --  Internal initialization function.

123.        function Get_TypeTo API docTo body return Gtk.Gtk_TypeTo API docTo spec;

124.        --  Return the internal value associated with a Gtk_Spin_Button.

126.        procedure Set_AdjustmentTo API docTo body

127.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

128.           Adjustment  : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec);

129.        function Get_AdjustmentTo API docTo body

130.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body)

131.           return Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec;

132.        --  Set or Get the adjustment settings of the spin button.

134.        procedure Set_DigitsTo API docTo body

135.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

136.           The_Digits  : GuintTo API docTo spec);

137.        function Get_DigitsTo API docTo body

138.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body) return GuintTo API docTo spec;

139.        --  Set or Get number of decimals of the spin button.

141.        procedure Set_IncrementsTo API docTo body

142.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

143.           Step        : GdoubleTo API docTo spec;

144.           Page        : GdoubleTo API docTo spec);

145.        procedure Get_IncrementsTo API docTo body

146.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

147.           Step        : out GdoubleTo API docTo spec;

148.           Page        : out GdoubleTo API docTo spec);

149.        --  Set or Get the increments for a single step and a page move.

151.        procedure Set_RangeTo API docTo body

152.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

153.           Min         : GdoubleTo API docTo spec;

154.           Max         : GdoubleTo API docTo spec);

155.        procedure Get_RangeTo API docTo body

156.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

157.           Min         : out GdoubleTo API docTo spec;

158.           Max         : out GdoubleTo API docTo spec);

159.        --  Set or Get range of the spin button.

161.        procedure Set_ValueTo API docTo body

162.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

163.           Value       : GdoubleTo API docTo spec);

164.        function Get_ValueTo API docTo body

165.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body) return GdoubleTo API docTo spec;

166.        --  Set or Get the current value of the spin button in a double.

168.        function Get_Value_As_IntTo API docTo body

169.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body) return GintTo API docTo spec;

170.        --  Return the current value of the spin button in an integer.

172.        procedure Set_Update_PolicyTo API docTo body

173.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

174.           PolicyTo API docTo body      : Gtk_Spin_Button_Update_PolicyTo API docTo spec);

175.        function Get_Update_PolicyTo API docTo body

176.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body)

177.           return Gtk_Spin_Button_Update_PolicyTo API docTo spec;

178.        --  Set the update policy of the spin button.

179.        --  See Gtk_Spin_Button_Update_Policy for the meaning of Policy.

181.        procedure Set_NumericTo API docTo body

182.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

183.           Numeric     : Boolean);

184.        function Get_NumericTo API docTo body

185.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body) return Boolean;

186.        --  If Numeric is True, then only a numeric value can be typed in the

187.        --  text entry, otherwise also nonnumeric text.

189.        procedure SpinTo API docTo body

190.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body;

191.           DirectionTo API docTo body   : Gtk_Spin_TypeTo API docTo spec;

192.           Step        : GdoubleTo API docTo spec);

193.        --  Set the value of the spin button relative to its current value.

194.        --  Depending on Direction, it will be incremented or decremented with

195.        --  the step value.

197.        procedure Set_WrapTo API docTo body

198.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body; Wrap : Boolean);

199.        function Get_WrapTo API docTo body

200.          (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body) return Boolean;

201.        --  Set whether the spin button should "wrap around" when exceeding the

202.        --  upper and lower limits.

204.        procedure Set_Snap_To_TicksTo API docTo body

205.         (Spin_Button   : access Gtk_Spin_Button_RecordTo API docTo specTo body;

206.          Snap_To_Ticks : Boolean);

207.        function Get_Snap_To_TicksTo API docTo body

208.         (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body) return Boolean;

209.        --  Set the spin button to round the value to the nearest step value

210.        --  which is set within its adjustment settings.

212.        procedure UpdateTo API docTo body (Spin_Button : access Gtk_Spin_Button_RecordTo API docTo specTo body);

213.        --  Manually force an update of the spin button.

215.        ----------------

216.        -- Properties --

217.        ----------------

219.        --  <properties>

220.        --  The following properties are defined for this widget. See

221.        --  Glib.Properties for more information on properties.

222.        --

223.        --  Name:  Adjustment_Property

224.        --  Type:  Object

225.        --  Descr: The adjustment that holds the value of the spinbutton

226.        --

227.        --  Name:  Climb_Rate_Property

228.        --  Type:  Double

229.        --  Descr: The acceleration rate when you hold down a button

230.        --

231.        --  Name:  Digits_Property

232.        --  Type:  Uint

233.        --  Descr: The number of decimal places to display

234.        --

235.        --  Name:  Numeric_Property

236.        --  Type:  Boolean

237.        --  Descr: Whether non-numeric characters should be ignored

238.        --

239.        --  Name:  Snap_To_Ticks_Property

240.        --  Type:  Boolean

241.        --  Descr: Whether erroneous values are automatically changed to a spin

242.        --         button's nearest step increment

243.        --

244.        --  Name:  Update_Policy_Property

245.        --  Type:  Enum

246.        --  Descr: Whether the spin button should update always, or only when the

247.        --         value is legal

248.        --

249.        --  Name:  Value_Property

250.        --  Type:  Double

251.        --  Descr: Reads the current value, or sets a new value

252.        --

253.        --  Name:  Wrap_Property

254.        --  Type:  Boolean

255.        --  Descr: Whether a spin button should wrap upon reaching its limits

256.        --

257.        --  </properties>

259.        package Spin_Button_Update_Policy_Properties is new

260.          Glib.Generic_Properties.Generic_Internal_Discrete_PropertyTo API docTo specTo body

261.            (Gtk_Spin_Button_Update_PolicyTo API docTo spec);

262.        type Property_Spin_Button_Update_Policy_Type is new

263.          Spin_Button_Update_Policy_Properties.PropertyTo API docTo spec;

265.        Adjustment_Property    : constant Glib.Properties.Property_ObjectTo API docTo spec;

266.        Climb_Rate_Property    : constant Glib.Properties.Property_DoubleTo API docTo spec;

267.        Digits_Property        : constant Glib.Properties.Property_UintTo API docTo spec;

268.        Numeric_Property       : constant Glib.Properties.Property_BooleanTo API docTo spec;

269.        Snap_To_Ticks_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

270.        Update_Policy_Property : constant Property_Spin_Button_Update_Policy_TypeTo API docTo spec;

271.        Value_Property         : constant Glib.Properties.Property_DoubleTo API docTo spec;

272.        Wrap_Property          : constant Glib.Properties.Property_BooleanTo API docTo spec;

274.        -------------

275.        -- Signals --

276.        -------------

278.        --  <signals>

279.        --  The following new signals are defined for this widget:

280.        --

281.        --  - "change_value"

282.        --    procedure Handler

283.        --      (Spin : access Gtk_Spin_Button_Record'Class;

284.        --       Typ  : Gtk_Scroll_Type);

285.        --    You should emit this signal to request a change in the value of the

286.        --    spin button. This is mostly useful as a keybinding, and is bound, by

287.        --    default, to the arrow keys, PageUp, PageDown, Home and End keys.

288.        --

289.        --  - "input"

290.        --    procedure Handler

291.        --       (Spin  : access Gtk_Spin_Button_Record'Class;

292.        --        Value : out Gint);

293.        --    ???

294.        --

295.        --  - "output"

296.        --    procedure Handler (Spin : access Gtk_Spin_Button_Record'Class);

297.        --    ???

298.        --

299.        --  - "value_changed"

300.        --    procedure Handler (Spin : access Gtk_Spin_Button_Record'Class);

301.        --    Emitted when the value of the spin button has changed.

302.        --

303.        --  </signals>

305.        Signal_Change_Value  : constant Glib.Signal_NameTo API docTo spec := "change_value";

306.        Signal_Input         : constant Glib.Signal_NameTo API docTo spec := "input";

307.        Signal_Output        : constant Glib.Signal_NameTo API docTo spec := "output";

308.        Signal_Value_Changed : constant Glib.Signal_NameTo API docTo spec := "value_changed";

310.     private

311.        type Gtk_Spin_Button_RecordTo API docTo spec is new Gtk.GEntry.Gtk_Entry_RecordTo API docTo specTo body

312.        with null record;

314.        Adjustment_PropertyTo API docTo spec : constant Glib.Properties.Property_ObjectTo API docTo spec :=

315.          Glib.Properties.BuildTo API docTo specTo body ("adjustment");

316.        Climb_Rate_PropertyTo API docTo spec : constant Glib.Properties.Property_DoubleTo API docTo spec :=

317.          Glib.Properties.BuildTo API docTo specTo body ("climb-rate");

318.        Digits_PropertyTo API docTo spec : constant Glib.Properties.Property_UintTo API docTo spec :=

319.          Glib.Properties.BuildTo API docTo specTo body ("digits");

320.        Numeric_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

321.          Glib.Properties.BuildTo API docTo specTo body ("numeric");

322.        Snap_To_Ticks_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

323.          Glib.Properties.BuildTo API docTo specTo body ("snap-to-ticks");

324.        Update_Policy_PropertyTo API docTo spec : constant Property_Spin_Button_Update_Policy_TypeTo API docTo spec :=

325.          BuildTo API docTo specTo body ("update-policy");

326.        Value_PropertyTo API docTo spec : constant Glib.Properties.Property_DoubleTo API docTo spec :=

327.          Glib.Properties.BuildTo API docTo specTo body ("value");

328.        Wrap_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

329.          Glib.Properties.BuildTo API docTo specTo body ("wrap");

331.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_spin_button_get_type");

332.     end Gtk.Spin_ButtonTo API docTo specTo body;

334.     --  The following function is for the sake of the C++ binding only:

335.     --  No binding: gtk_spin_button_configure