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