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-2013, 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. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  A Gtk_Button_Box is a special type of Gtk_Box specially tailored to 
  32. --  contain buttons. 
  33. -- 
  34. --  This is only a base class for Gtk_Hbutton_Box and Gtk_Vbutton_Box which 
  35. --  provide a way to arrange their children horizontally (resp. vertically). 
  36. --  You can not instantiate a Gtk_Button_Box directly, and have to use one the 
  37. --  above two instead. 
  38. -- 
  39. --  </description> 
  40. --  <screenshot>gtk-button_box</screenshot> 
  41. --  <group>Layout containers</group> 
  42. --  <testgtk>create_button_box.adb</testgtk> 
  43.  
  44. pragma Warnings (Off, "*is already use-visible*"); 
  45. with Glib;           use Glib; 
  46. with Glib.Types;     use Glib.Types; 
  47. with Gtk.Box;        use Gtk.Box; 
  48. with Gtk.Buildable;  use Gtk.Buildable; 
  49. with Gtk.Enums;      use Gtk.Enums; 
  50. with Gtk.Orientable; use Gtk.Orientable; 
  51. with Gtk.Widget;     use Gtk.Widget; 
  52.  
  53. package Gtk.Button_Box is 
  54.  
  55.    type Gtk_Button_Box_Record is new Gtk_Box_Record with null record; 
  56.    type Gtk_Button_Box is access all Gtk_Button_Box_Record'Class; 
  57.  
  58.    ------------------ 
  59.    -- Constructors -- 
  60.    ------------------ 
  61.  
  62.    function Get_Type return Glib.GType; 
  63.    pragma Import (C, Get_Type, "gtk_button_box_get_type"); 
  64.  
  65.    ------------- 
  66.    -- Methods -- 
  67.    ------------- 
  68.  
  69.    procedure Get_Child_Ipadding 
  70.       (Widget : access Gtk_Button_Box_Record; 
  71.        Ipad_X : out Gint; 
  72.        Ipad_Y : out Gint); 
  73.    procedure Set_Child_Ipadding 
  74.       (Widget : access Gtk_Button_Box_Record; 
  75.        Ipad_X : Gint; 
  76.        Ipad_Y : Gint); 
  77.    pragma Obsolescent (Set_Child_Ipadding); 
  78.    --  Deprecated 
  79.  
  80.    function Get_Child_Secondary 
  81.       (Widget : access Gtk_Button_Box_Record; 
  82.        Child  : access Gtk.Widget.Gtk_Widget_Record'Class) return Boolean; 
  83.    procedure Set_Child_Secondary 
  84.       (Widget       : access Gtk_Button_Box_Record; 
  85.        Child        : access Gtk.Widget.Gtk_Widget_Record'Class; 
  86.        Is_Secondary : Boolean); 
  87.    --  Set whether Child should appear in a secondary group of children. A 
  88.    --  typical use of a secondary child is the help button in a dialog. 
  89.    --  This group appears after the other children if the style is 
  90.    --  Buttonbox_Start, Buttonbox_Spread or Buttonbox_Edge, and before the 
  91.    --  other children if the style is Buttonbox_End. For horizontal button 
  92.    --  boxes, the definition of before/after depends on direction of the 
  93.    --  widget. (See Gtk.Widget.Set_Direction) If the style is Buttonbox_Start, 
  94.    --  or Buttonbox_End, then the secondary children are aligned at the other 
  95.    --  end of the button box from the main children. For the other styles, they 
  96.    --  appear immediately next to the main children. 
  97.    --  Is_Secondary: if True, the Child appears in a secondary group of the 
  98.    --  button box. 
  99.    --  "child": a child of Widget 
  100.    --  "is_secondary": if True, the Child appears in a secondary group of the 
  101.    --  button box. 
  102.  
  103.    procedure Get_Child_Size 
  104.       (Widget     : access Gtk_Button_Box_Record; 
  105.        Min_Width  : out Gint; 
  106.        Min_Height : out Gint); 
  107.    pragma Obsolescent (Get_Child_Size); 
  108.    procedure Set_Child_Size 
  109.       (Widget     : access Gtk_Button_Box_Record; 
  110.        Min_Width  : Gint; 
  111.        Min_Height : Gint); 
  112.    pragma Obsolescent (Set_Child_Size); 
  113.    --  Deprecated 
  114.  
  115.    function Get_Layout 
  116.       (Widget : access Gtk_Button_Box_Record) 
  117.        return Gtk.Enums.Gtk_Button_Box_Style; 
  118.    procedure Set_Layout 
  119.       (Widget       : access Gtk_Button_Box_Record; 
  120.        Layout_Style : Gtk.Enums.Gtk_Button_Box_Style); 
  121.  
  122.    --------------------- 
  123.    -- Interfaces_Impl -- 
  124.    --------------------- 
  125.  
  126.    function Get_Orientation 
  127.       (Self : access Gtk_Button_Box_Record) return Gtk.Enums.Gtk_Orientation; 
  128.    procedure Set_Orientation 
  129.       (Self        : access Gtk_Button_Box_Record; 
  130.        Orientation : Gtk.Enums.Gtk_Orientation); 
  131.  
  132.    ---------------- 
  133.    -- Interfaces -- 
  134.    ---------------- 
  135.    --  This class implements several interfaces. See Glib.Types 
  136.    -- 
  137.    --  - "Buildable" 
  138.    -- 
  139.    --  - "Orientable" 
  140.  
  141.    package Implements_Buildable is new Glib.Types.Implements 
  142.      (Gtk.Buildable.Gtk_Buildable, Gtk_Button_Box_Record, Gtk_Button_Box); 
  143.    function "+" 
  144.      (Widget : access Gtk_Button_Box_Record'Class) 
  145.    return Gtk.Buildable.Gtk_Buildable 
  146.    renames Implements_Buildable.To_Interface; 
  147.    function "-" 
  148.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  149.    return Gtk_Button_Box 
  150.    renames Implements_Buildable.To_Object; 
  151.  
  152.    package Implements_Orientable is new Glib.Types.Implements 
  153.      (Gtk.Orientable.Gtk_Orientable, Gtk_Button_Box_Record, Gtk_Button_Box); 
  154.    function "+" 
  155.      (Widget : access Gtk_Button_Box_Record'Class) 
  156.    return Gtk.Orientable.Gtk_Orientable 
  157.    renames Implements_Orientable.To_Interface; 
  158.    function "-" 
  159.      (Interf : Gtk.Orientable.Gtk_Orientable) 
  160.    return Gtk_Button_Box 
  161.    renames Implements_Orientable.To_Object; 
  162.  
  163.    ---------------- 
  164.    -- Properties -- 
  165.    ---------------- 
  166.    --  The following properties are defined for this widget. See 
  167.    --  Glib.Properties for more information on properties) 
  168.    -- 
  169.    --  Name: Layout_Style_Property 
  170.    --  Type: Gtk.Enums.Gtk_Button_Box_Style 
  171.    --  Flags: read-write 
  172.  
  173.    Layout_Style_Property : constant Gtk.Enums.Property_Gtk_Button_Box_Style; 
  174.  
  175. private 
  176.    Layout_Style_Property : constant Gtk.Enums.Property_Gtk_Button_Box_Style := 
  177.      Gtk.Enums.Build ("layout-style"); 
  178. end Gtk.Button_Box;