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. --  A Gtk_Button_Box is a special type of Gtk_Box specially tailored to 
  26. --  contain buttons. 
  27. -- 
  28. --  This is only a base class for Gtk_Hbutton_Box and Gtk_Vbutton_Box which 
  29. --  provide a way to arrange their children horizontally (resp. vertically). 
  30. --  You can not instantiate a Gtk_Button_Box directly, and have to use one the 
  31. --  above two instead. 
  32. -- 
  33. --  </description> 
  34. --  <screenshot>gtk-button_box</screenshot> 
  35. --  <group>Layout containers</group> 
  36. --  <testgtk>create_button_box.adb</testgtk> 
  37. pragma Ada_2005; 
  38.  
  39. pragma Warnings (Off, "*is already use-visible*"); 
  40. with Glib;           use Glib; 
  41. with Glib.Types;     use Glib.Types; 
  42. with Gtk.Box;        use Gtk.Box; 
  43. with Gtk.Buildable;  use Gtk.Buildable; 
  44. with Gtk.Enums;      use Gtk.Enums; 
  45. with Gtk.Orientable; use Gtk.Orientable; 
  46. with Gtk.Widget;     use Gtk.Widget; 
  47.  
  48. package Gtk.Button_Box is 
  49.  
  50.    type Gtk_Button_Box_Record is new Gtk_Box_Record with null record; 
  51.    type Gtk_Button_Box is access all Gtk_Button_Box_Record'Class; 
  52.  
  53.    ------------------ 
  54.    -- Constructors -- 
  55.    ------------------ 
  56.  
  57.    procedure Gtk_New 
  58.       (Widget      : out Gtk_Button_Box; 
  59.        Orientation : Gtk.Enums.Gtk_Orientation); 
  60.    procedure Initialize 
  61.       (Widget      : not null access Gtk_Button_Box_Record'Class; 
  62.        Orientation : Gtk.Enums.Gtk_Orientation); 
  63.    --  Creates a new Gtk.Button_Box.Gtk_Button_Box. 
  64.    --  Since: gtk+ 3.0 
  65.    --  "orientation": the box' orientation. 
  66.  
  67.    function Gtk_Button_Box_New 
  68.       (Orientation : Gtk.Enums.Gtk_Orientation) return Gtk_Button_Box; 
  69.    --  Creates a new Gtk.Button_Box.Gtk_Button_Box. 
  70.    --  Since: gtk+ 3.0 
  71.    --  "orientation": the box' orientation. 
  72.  
  73.    function Get_Type return Glib.GType; 
  74.    pragma Import (C, Get_Type, "gtk_button_box_get_type"); 
  75.  
  76.    ------------- 
  77.    -- Methods -- 
  78.    ------------- 
  79.  
  80.    function Get_Child_Non_Homogeneous 
  81.       (Widget : not null access Gtk_Button_Box_Record; 
  82.        Child  : not null access Gtk.Widget.Gtk_Widget_Record'Class) 
  83.        return Boolean; 
  84.    --  Returns whether the child is exempted from homogenous sizing. 
  85.    --  Since: gtk+ 3.2 
  86.    --  "child": a child of Widget 
  87.  
  88.    procedure Set_Child_Non_Homogeneous 
  89.       (Widget          : not null access Gtk_Button_Box_Record; 
  90.        Child           : not null access Gtk.Widget.Gtk_Widget_Record'Class; 
  91.        Non_Homogeneous : Boolean); 
  92.    --  Sets whether the child is exempted from homogeous sizing. 
  93.    --  Since: gtk+ 3.2 
  94.    --  "child": a child of Widget 
  95.    --  "non_homogeneous": the new value 
  96.  
  97.    function Get_Child_Secondary 
  98.       (Widget : not null access Gtk_Button_Box_Record; 
  99.        Child  : not null access Gtk.Widget.Gtk_Widget_Record'Class) 
  100.        return Boolean; 
  101.    --  Returns whether Child should appear in a secondary group of children. 
  102.    --  Since: gtk+ 2.4 
  103.    --  "child": a child of Widget 
  104.  
  105.    procedure Set_Child_Secondary 
  106.       (Widget       : not null access Gtk_Button_Box_Record; 
  107.        Child        : not null access Gtk.Widget.Gtk_Widget_Record'Class; 
  108.        Is_Secondary : Boolean); 
  109.    --  Sets whether Child should appear in a secondary group of children. A 
  110.    --  typical use of a secondary child is the help button in a dialog. 
  111.    --  This group appears after the other children if the style is 
  112.    --  Gtk.Enums.Buttonbox_Start, Gtk.Enums.Buttonbox_Spread or 
  113.    --  Gtk.Enums.Buttonbox_Edge, and before the other children if the style is 
  114.    --  Gtk.Enums.Buttonbox_End. For horizontal button boxes, the definition of 
  115.    --  before/after depends on direction of the widget (see 
  116.    --  Gtk.Widget.Set_Direction). If the style is Gtk.Enums.Buttonbox_Start or 
  117.    --  Gtk.Enums.Buttonbox_End, then the secondary children are aligned at the 
  118.    --  other end of the button box from the main children. For the other 
  119.    --  styles, they appear immediately next to the main children. 
  120.    --  "child": a child of Widget 
  121.    --  "is_secondary": if True, the Child appears in a secondary group of the 
  122.    --  button box. 
  123.  
  124.    function Get_Layout 
  125.       (Widget : not null access Gtk_Button_Box_Record) 
  126.        return Gtk.Enums.Gtk_Button_Box_Style; 
  127.    --  Retrieves the method being used to arrange the buttons in a button box. 
  128.  
  129.    procedure Set_Layout 
  130.       (Widget       : not null access Gtk_Button_Box_Record; 
  131.        Layout_Style : Gtk.Enums.Gtk_Button_Box_Style); 
  132.    --  Changes the way buttons are arranged in their container. 
  133.    --  "layout_style": the new layout style 
  134.  
  135.    --------------------------------------------- 
  136.    -- Inherited subprograms (from interfaces) -- 
  137.    --------------------------------------------- 
  138.    --  Methods inherited from the Buildable interface are not duplicated here 
  139.    --  since they are meant to be used by tools, mostly. If you need to call 
  140.    --  them, use an explicit cast through the "-" operator below. 
  141.  
  142.    function Get_Orientation 
  143.       (Self : not null access Gtk_Button_Box_Record) 
  144.        return Gtk.Enums.Gtk_Orientation; 
  145.  
  146.    procedure Set_Orientation 
  147.       (Self        : not null access Gtk_Button_Box_Record; 
  148.        Orientation : Gtk.Enums.Gtk_Orientation); 
  149.  
  150.    ---------------- 
  151.    -- Properties -- 
  152.    ---------------- 
  153.    --  The following properties are defined for this widget. See 
  154.    --  Glib.Properties for more information on properties) 
  155.  
  156.    Layout_Style_Property : constant Gtk.Enums.Property_Gtk_Button_Box_Style; 
  157.  
  158.    ---------------- 
  159.    -- Interfaces -- 
  160.    ---------------- 
  161.    --  This class implements several interfaces. See Glib.Types 
  162.    -- 
  163.    --  - "Buildable" 
  164.    -- 
  165.    --  - "Orientable" 
  166.  
  167.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  168.      (Gtk.Buildable.Gtk_Buildable, Gtk_Button_Box_Record, Gtk_Button_Box); 
  169.    function "+" 
  170.      (Widget : access Gtk_Button_Box_Record'Class) 
  171.    return Gtk.Buildable.Gtk_Buildable 
  172.    renames Implements_Gtk_Buildable.To_Interface; 
  173.    function "-" 
  174.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  175.    return Gtk_Button_Box 
  176.    renames Implements_Gtk_Buildable.To_Object; 
  177.  
  178.    package Implements_Gtk_Orientable is new Glib.Types.Implements 
  179.      (Gtk.Orientable.Gtk_Orientable, Gtk_Button_Box_Record, Gtk_Button_Box); 
  180.    function "+" 
  181.      (Widget : access Gtk_Button_Box_Record'Class) 
  182.    return Gtk.Orientable.Gtk_Orientable 
  183.    renames Implements_Gtk_Orientable.To_Interface; 
  184.    function "-" 
  185.      (Interf : Gtk.Orientable.Gtk_Orientable) 
  186.    return Gtk_Button_Box 
  187.    renames Implements_Gtk_Orientable.To_Object; 
  188.  
  189. private 
  190.    Layout_Style_Property : constant Gtk.Enums.Property_Gtk_Button_Box_Style := 
  191.      Gtk.Enums.Build ("layout-style"); 
  192. end Gtk.Button_Box;