1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                    Copyright (C) 2010-2013, AdaCore               -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  Gtk_Cell_Renderer_Spin renders text in a cell like Gtk_Cell_Renderer_Text 
  31. --  from which it is derived. But while Gtk_Cell_Renderer_Text offers a simple 
  32. --  entry to edit the text, Gtk_Cell_Renderer_Spin offers a Gtk_Spin_Button 
  33. --  widget. Of course, that means that the text has to be parseable as a 
  34. --  floating point number. 
  35. -- 
  36. --  The range of the spinbutton is taken from the adjustment property of the 
  37. --  cell renderer, which can be set explicitly or mapped to a column in the 
  38. --  tree model, like all properties of cell renders. Gtk_Cell_Renderer_Spin 
  39. --  also has properties for the climb rate and the number of digits to display. 
  40. --  Other Gtk_Spin_Button properties can be set in a handler for the 
  41. --  start-editing signal. 
  42. -- 
  43. --  The Gtk_Cell_Renderer_Spin cell renderer was added in GTK+ 2.10. 
  44. --  </description> 
  45. --  <c_version>2.16.6</c_version> 
  46.  
  47. with Glib.Properties; 
  48. with Gtk.Cell_Renderer_Text; 
  49.  
  50. package Gtk.Cell_Renderer_Spin is 
  51.  
  52.    type Gtk_Cell_Renderer_Spin_Record is 
  53.      new Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text_Record with private; 
  54.    type Gtk_Cell_Renderer_Spin is 
  55.      access all Gtk_Cell_Renderer_Spin_Record'Class; 
  56.  
  57.    procedure Gtk_New (Widget : out Gtk_Cell_Renderer_Spin); 
  58.    --  Creates a new Gtk_Cell_Renderer_Spin. 
  59.  
  60.    procedure Initialize (Widget : access Gtk_Cell_Renderer_Spin_Record'Class); 
  61.    --  Creates a new Gtk_Cell_Renderer_Spin. 
  62.  
  63.    function Get_Type return GType; 
  64.    --  Return the internal value associated with this widget. 
  65.  
  66.    ---------------- 
  67.    -- Properties -- 
  68.    ---------------- 
  69.  
  70.    --  <properties> 
  71.    --  Name:  Adjustment_Property 
  72.    --  Type:  Object 
  73.    --  Descr: The adjustment that holds the value of the spinbutton. 
  74.    -- 
  75.    --  Name:  Climb_Rate_Property 
  76.    --  Type:  Double 
  77.    --  Descr: The acceleration rate when you hold down a button 
  78.    -- 
  79.    --  Name:  Digits_Property 
  80.    --  Type:  Uint 
  81.    --  Descr: The number of decimal places to display 
  82.    -- 
  83.    --  </properties> 
  84.  
  85.    Adjustment_Property : constant Glib.Properties.Property_Object; 
  86.    Climb_Rate_Property : constant Glib.Properties.Property_Double; 
  87.    Digits_Property     : constant Glib.Properties.Property_Uint; 
  88.  
  89. private 
  90.    type Gtk_Cell_Renderer_Spin_Record is 
  91.      new Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text_Record with null record; 
  92.  
  93.    Adjustment_Property : constant Glib.Properties.Property_Object := 
  94.      Glib.Properties.Build ("adjustment"); 
  95.    Climb_Rate_Property : constant Glib.Properties.Property_Double := 
  96.      Glib.Properties.Build ("climb-rate"); 
  97.    Digits_Property : constant Glib.Properties.Property_Uint := 
  98.      Glib.Properties.Build ("digits"); 
  99.  
  100.    pragma Import (C, Get_Type, "gtk_cell_renderer_spin_get_type"); 
  101. end Gtk.Cell_Renderer_Spin;