1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin renders text in a cell like 
  26. --  Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text from which it is derived. But 
  27. --  while Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text offers a simple entry 
  28. --  to edit the text, Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin offers a 
  29. --  Gtk.Spin_Button.Gtk_Spin_Button widget. Of course, that means that the text 
  30. --  has to be parseable as a floating point number. 
  31. -- 
  32. --  The range of the spinbutton is taken from the adjustment property of the 
  33. --  cell renderer, which can be set explicitly or mapped to a column in the 
  34. --  tree model, like all properties of cell renders. 
  35. --  Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin also has properties for the 
  36. --  Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin:climb-rate and the number of 
  37. --  Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin:digits to display. Other 
  38. --  Gtk.Spin_Button.Gtk_Spin_Button properties can be set in a handler for the 
  39. --  Gtk.Cell_Renderer.Gtk_Cell_Renderer::editing-started signal. 
  40. -- 
  41. --  The Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin cell renderer was added 
  42. --  in GTK+ 2.10. 
  43. -- 
  44. --  </description> 
  45. pragma Ada_2005; 
  46.  
  47. pragma Warnings (Off, "*is already use-visible*"); 
  48. with Glib;                   use Glib; 
  49. with Glib.Properties;        use Glib.Properties; 
  50. with Gtk.Cell_Renderer_Text; use Gtk.Cell_Renderer_Text; 
  51.  
  52. package Gtk.Cell_Renderer_Spin is 
  53.  
  54.    type Gtk_Cell_Renderer_Spin_Record is new Gtk_Cell_Renderer_Text_Record with null record; 
  55.    type Gtk_Cell_Renderer_Spin is access all Gtk_Cell_Renderer_Spin_Record'Class; 
  56.  
  57.    ------------------ 
  58.    -- Constructors -- 
  59.    ------------------ 
  60.  
  61.    procedure Gtk_New (Self : out Gtk_Cell_Renderer_Spin); 
  62.    procedure Initialize 
  63.       (Self : not null access Gtk_Cell_Renderer_Spin_Record'Class); 
  64.    --  Creates a new Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin. 
  65.    --  Since: gtk+ 2.10 
  66.  
  67.    function Gtk_Cell_Renderer_Spin_New return Gtk_Cell_Renderer_Spin; 
  68.    --  Creates a new Gtk.Cell_Renderer_Spin.Gtk_Cell_Renderer_Spin. 
  69.    --  Since: gtk+ 2.10 
  70.  
  71.    function Get_Type return Glib.GType; 
  72.    pragma Import (C, Get_Type, "gtk_cell_renderer_spin_get_type"); 
  73.  
  74.    ---------------- 
  75.    -- Properties -- 
  76.    ---------------- 
  77.    --  The following properties are defined for this widget. See 
  78.    --  Glib.Properties for more information on properties) 
  79.  
  80.    Adjustment_Property : constant Glib.Properties.Property_Object; 
  81.    --  Type: Gtk.Adjustment.Gtk_Adjustment 
  82.    --  The adjustment that holds the value of the spinbutton. This must be 
  83.    --  non-null for the cell renderer to be editable. 
  84.  
  85.    Climb_Rate_Property : constant Glib.Properties.Property_Double; 
  86.    --  Type: Gdouble 
  87.    --  The acceleration rate when you hold down a button. 
  88.  
  89.    The_Digits_Property : constant Glib.Properties.Property_Uint; 
  90.    --  The number of decimal places to display. 
  91.  
  92. private 
  93.    The_Digits_Property : constant Glib.Properties.Property_Uint := 
  94.      Glib.Properties.Build ("digits"); 
  95.    Climb_Rate_Property : constant Glib.Properties.Property_Double := 
  96.      Glib.Properties.Build ("climb-rate"); 
  97.    Adjustment_Property : constant Glib.Properties.Property_Object := 
  98.      Glib.Properties.Build ("adjustment"); 
  99. end Gtk.Cell_Renderer_Spin;