1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                    Copyright (C) 2010, 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. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  Gtk_Scale_Button provides a button which pops up a scale widget. This kind 
  26. --  of widget is commonly used for volume controls in multimedia applications, 
  27. --  and GTK+ provides a Gtk_Volume_Button subclass that is tailored for this 
  28. --  use case. 
  29. --  </description> 
  30. --  <c_version>2.16.6</c_version> 
  31. --  <group>Numeric/Text Data Entry</group> 
  32.  
  33. with Glib.Properties; 
  34. with Gtk.Adjustment; 
  35. with Gtk.Button; 
  36. with Gtk.Enums; 
  37. with Gtk.Widget; 
  38. with Gtkada.Types; 
  39.  
  40. package Gtk.Scale_Button is 
  41.  
  42.    type Gtk_Scale_Button_Record is 
  43.      new Gtk.Button.Gtk_Button_Record with private; 
  44.    type Gtk_Scale_Button is access all Gtk_Scale_Button_Record'Class; 
  45.  
  46.    function Gtk_New 
  47.      (Size  : Gtk.Enums.Gtk_Icon_Size; 
  48.       Min   : Gdouble; 
  49.       Max   : Gdouble; 
  50.       Step  : Gdouble; 
  51.       Icons : Gtkada.Types.Chars_Ptr_Array) 
  52.       return Gtk_Scale_Button; 
  53.    --  Creates a Gtk_Scale_Button, with a range between Min and Max (usually 
  54.    --  0 .. 100), with a stepping of Step (usually 2).  Invoke with a list of 
  55.    --  icon names, or Null_Array if you want to set the list later with 
  56.    --  Set_Icons. 
  57.  
  58.    function Get_Type return GType; 
  59.  
  60.    function Get_Adjustment 
  61.      (Button : access Gtk_Scale_Button_Record) 
  62.       return Gtk.Adjustment.Gtk_Adjustment; 
  63.    --  Gets the Gtk_Adjustment associated with the Gtk_Scale_Button's scale. 
  64.    --  See Gtk.Range.Get_Adjustment for details. 
  65.  
  66.    function Get_Minus_Button 
  67.      (Button : access Gtk_Scale_Button_Record) return Gtk.Widget.Gtk_Widget; 
  68.    function Get_Plus_Button 
  69.      (Button : access Gtk_Scale_Button_Record) return Gtk.Widget.Gtk_Widget; 
  70.    --  Retrieves the minus/plus button of the Gtk_Scale_Button. 
  71.  
  72.    function Get_Popup 
  73.      (Button : access Gtk_Scale_Button_Record) return Gtk.Widget.Gtk_Widget; 
  74.    --  Retrieves the popup of the Gtk_Scale_Button. 
  75.  
  76.    function Get_Value (Button : access Gtk_Scale_Button_Record) return Gdouble; 
  77.    procedure Set_Value 
  78.      (Button : access Gtk_Scale_Button_Record; 
  79.       Value  : Gdouble); 
  80.    --  Gets/Sets the current value of the scale; if the value is outside 
  81.    --  the minimum or maximum range values, it will be clamped to fit 
  82.    --  inside them. The scale button emits the GtkScaleButton::value-changed 
  83.    --  signal if the value changes. 
  84.  
  85.    procedure Set_Adjustment 
  86.      (Button     : access Gtk_Scale_Button_Record; 
  87.       Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  88.    --  Sets the Gtk_Adjustment to be used as a model for the Gtk_Scale_Button's 
  89.    --  scale.  See Gtk.Range.Set_Adjustment for details. 
  90.  
  91.    procedure Set_Icons 
  92.      (Button : access Gtk_Scale_Button_Record; 
  93.       Icons  : Gtkada.Types.Chars_Ptr_Array); 
  94.    --  Sets the icons to be used by the scale button. 
  95.    --  For details, see the icons property. 
  96.  
  97.    ----------------- 
  98.    -- Obsolescent -- 
  99.    ----------------- 
  100.  
  101.    function Get_Orientation 
  102.      (Button : access Gtk_Scale_Button_Record) 
  103.       return Gtk.Enums.Gtk_Orientation; 
  104.    pragma Obsolescent; --  Get_Orientation 
  105.    procedure Set_Orientation 
  106.      (Button      : access Gtk_Scale_Button_Record; 
  107.       Orientation : Gtk.Enums.Gtk_Orientation); 
  108.    pragma Obsolescent; --  Set_Orientation 
  109.    --  Gets/Sets the orientation of the Gtk_Scale_Button's popup window. 
  110.    -- 
  111.    --  Deprecated: 2.16: Use Gtk.Orientable.Get_Orientation and 
  112.    --  Gtk.Orientable.Set_Orientation instead. 
  113.  
  114.    ---------------- 
  115.    -- Properties -- 
  116.    ---------------- 
  117.  
  118.    --  <properties> 
  119.    --  Name:  Adjustment_Property 
  120.    --  Type:  Object 
  121.    --  Descr: The Gtk_Adjustment that contains the current value of this scale 
  122.    --         button object 
  123.    -- 
  124.    --  Name:  Icons_Property 
  125.    --  Type:  Boxed 
  126.    --  Descr: List of icon names 
  127.    -- 
  128.    --  Name:  Size_Property 
  129.    --  Type:  Enum 
  130.    --  Descr: The icon size 
  131.    -- 
  132.    --  Name:  Value_Property 
  133.    --  Type:  Double 
  134.    --  Descr: The value of the scale 
  135.    -- 
  136.    --  </properties> 
  137.  
  138.    Adjustment_Property : constant Glib.Properties.Property_Object; 
  139.    Icons_Property      : constant Glib.Properties.Property_Boxed; 
  140.    Size_Property       : constant Glib.Properties.Property_Enum; 
  141.    Value_Property      : constant Glib.Properties.Property_Double; 
  142.  
  143. private 
  144.  
  145.    type Gtk_Scale_Button_Record is 
  146.      new Gtk.Button.Gtk_Button_Record with null record; 
  147.  
  148.    Adjustment_Property : constant Glib.Properties.Property_Object := 
  149.      Glib.Properties.Build ("adjustment"); 
  150.    Icons_Property : constant Glib.Properties.Property_Boxed := 
  151.      Glib.Properties.Build ("icons"); 
  152.    Size_Property : constant Glib.Properties.Property_Enum := 
  153.      Glib.Properties.Build ("size"); 
  154.    Value_Property : constant Glib.Properties.Property_Double := 
  155.      Glib.Properties.Build ("value"); 
  156.  
  157.    pragma Import (C, Get_Type, "gtk_scale_button_get_type"); 
  158.  
  159. end Gtk.Scale_Button;