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-2006 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. -- 
  32. --  A Gtk_Button_Box is a special type of Gtk_Box specially tailored to contain 
  33. --  buttons. 
  34. -- 
  35. --  This is only a base class for Gtk_Hbutton_Box and Gtk_Vbutton_Box which 
  36. --  provide a way to arrange their children horizontally (resp. vertically). 
  37. --  You can not instantiate a Gtk_Button_Box directly, and have to use one the 
  38. --  above two instead. 
  39. -- 
  40. --  </description> 
  41. --  <c_version>2.8.17</c_version> 
  42. --  <group>Layout containers</group> 
  43. --  <testgtk>create_button_box.adb</testgtk> 
  44. --  <screenshot>gtk-button_box</screenshot> 
  45.  
  46. with Glib.Properties; 
  47. with Gtk.Box; 
  48. with Gtk.Enums; 
  49. with Gtk.Widget; 
  50.  
  51. package Gtk.Button_Box is 
  52.  
  53.    type Gtk_Button_Box_Record is new Gtk.Box.Gtk_Box_Record with private; 
  54.    type Gtk_Button_Box is access all Gtk_Button_Box_Record'Class; 
  55.  
  56.    function Get_Type return Gtk.Gtk_Type; 
  57.    --  Return the internal value associated with a Gtk_Button_Box. 
  58.  
  59.    procedure Set_Layout 
  60.      (Button_Box   : access Gtk_Button_Box_Record; 
  61.       Layout_Style : Enums.Gtk_Button_Box_Style); 
  62.    function Get_Layout 
  63.      (Button_Box : access Gtk_Button_Box_Record) 
  64.       return Enums.Gtk_Button_Box_Style; 
  65.    --  Set the layout to use for the box. 
  66.    --  There are four such styles: 
  67.    -- 
  68.    --  - Buttonbox_Spread: The children are spread regularly across the box 
  69.    -- 
  70.    --  - Buttonbox_Edge  : Same as Spread, except that the first and last 
  71.    --                      children are aligned on the border of the box. 
  72.    -- 
  73.    --  - Buttonbox_Start : The children are put as much to the left (resp. top) 
  74.    --                      as possible in the box. 
  75.    -- 
  76.    --  - Buttonbox_End   : The children are put as much to the right 
  77.    --                      (resp. bottom) as possible in the box. 
  78.  
  79.    procedure Set_Child_Secondary 
  80.      (Button_Box   : access Gtk_Button_Box_Record; 
  81.       Child        : access Gtk.Widget.Gtk_Widget_Record'Class; 
  82.       Is_Secondary : Boolean); 
  83.    function Get_Child_Secondary 
  84.      (Widget : access Gtk_Button_Box_Record; 
  85.       Child  : access Gtk.Widget.Gtk_Widget_Record'Class) 
  86.       return Boolean; 
  87.    --  Set whether Child should appear in a secondary group of children. 
  88.    --  A typical use of a secondary child is the help button in a dialog. 
  89.    -- 
  90.    --  This group appears after the other children if the style is 
  91.    --  Buttonbox_Start, Buttonbox_Spread or Buttonbox_Edge, and before the 
  92.    --  other children if the style is Buttonbox_End. For horizontal button 
  93.    --  boxes, the definition of before/after depends on direction of the 
  94.    --  widget. (See Gtk.Widget.Set_Direction) If the style is Buttonbox_Start, 
  95.    --  or Buttonbox_End, then the secondary children are aligned at 
  96.    --  the other end of the button box from the main children. For the 
  97.    --  other styles, they appear immediately next to the main children. 
  98.    -- 
  99.    --  Is_Secondary: if True, the Child appears in a secondary group of the 
  100.    --                button box. 
  101.  
  102.    ----------------- 
  103.    -- Obsolescent -- 
  104.    ----------------- 
  105.    --  All subprograms below are now obsolescent in gtk+. They might be removed 
  106.    --  from future versions of gtk+ (and therefore GtkAda). 
  107.    --  To find out whether your code uses any of these, we recommend compiling 
  108.    --  with the -gnatwj switch 
  109.    --  <doc_ignore> 
  110.  
  111.    procedure Set_Child_Size 
  112.      (Button_Box : access Gtk_Button_Box_Record; 
  113.       Min_Width  : Gint; 
  114.       Min_Height : Gint); 
  115.    pragma Obsolescent;  --  Set_Child_Size 
  116.    --  Set the size to use for children of this specific box. 
  117.    --  You can modify the size for all the boxes at once by using 
  118.    --  Set_Child_Size_Default. 
  119.  
  120.    procedure Get_Child_Size 
  121.      (Button_Box : access Gtk_Button_Box_Record; 
  122.       Min_Width  : out Gint; 
  123.       Min_Height : out Gint); 
  124.    pragma Obsolescent;  --  Get_Child_Size 
  125.    --  Return the size to use for children of this specific box. 
  126.    --  Min_Width and Min_Height are set to -1 if this widget uses the default 
  127.    --  sizes that are set by Set_Child_Size_Default. 
  128.  
  129.    procedure Set_Child_Ipadding 
  130.      (Button_Box : access Gtk_Button_Box_Record; 
  131.       Ipad_X     : Gint; 
  132.       Ipad_Y     : Gint); 
  133.    pragma Obsolescent; --  Set_Child_Ipadding 
  134.    --  no-op procedure. 
  135.  
  136.    --  </doc_ignore> 
  137.  
  138.    ---------------- 
  139.    -- Properties -- 
  140.    ---------------- 
  141.    --  The following properties are defined for this widget. See 
  142.    --  Glib.Properties for more information on properties. 
  143.  
  144.    --  <properties> 
  145.    --  - Name:  Layout_Style_Property 
  146.    --    Type:  Gtk_Button_Box_Style 
  147.    --    Flags: read-write 
  148.    --    Descr: How to layout the buttons in the box. 
  149.    --    See also: Same as calling Set_Layout. 
  150.    -- 
  151.    --  - Name:  Child_Secondary_Property 
  152.    --    Type:  Boolean 
  153.    --    Flags: read-write 
  154.    --    Descr: If True, the child appears in a secondary group of children, 
  155.    --           suitable for, e.g., help buttons. 
  156.    --    See also: Same as calling Set_Child_Secondary. 
  157.    --  </properties> 
  158.  
  159.    Layout_Style_Property    : constant Gtk.Enums.Property_Gtk_Button_Box_Style; 
  160.    Child_Secondary_Property : constant Glib.Properties.Property_Boolean; 
  161.  
  162.    ---------------------- 
  163.    -- Child Properties -- 
  164.    ---------------------- 
  165.    --  The following properties can be set on children of this widget. See 
  166.    --  in particular Gtk.Containers.Child_Set_Property. 
  167.  
  168.    --  <child_properties> 
  169.    --  Name:  Secondary_Property 
  170.    --  Type:  Boolean 
  171.    --  Descr: If TRUE, the child appears in a secondary group of children, 
  172.    --         suitable for, e.g., help buttons 
  173.    --  </child_properties> 
  174.  
  175.    Secondary_Property : constant Glib.Properties.Property_Boolean; 
  176.  
  177.    ---------------------- 
  178.    -- Style Properties -- 
  179.    ---------------------- 
  180.    --  The following properties can be changed through the gtk theme and 
  181.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  182.  
  183.    --  <style_properties> 
  184.    --  Name:  Child_Internal_Pad_X_Property 
  185.    --  Type:  Int 
  186.    --  Descr: Amount to increase child's size on either side 
  187.    -- 
  188.    --  Name:  Child_Internal_Pad_Y_Property 
  189.    --  Type:  Int 
  190.    --  Descr: Amount to increase child's size on the top and bottom 
  191.    -- 
  192.    --  Name:  Child_Min_Height_Property 
  193.    --  Type:  Int 
  194.    --  Descr: Minimum height of buttons inside the box 
  195.    -- 
  196.    --  Name:  Child_Min_Width_Property 
  197.    --  Type:  Int 
  198.    --  Descr: Minimum width of buttons inside the box 
  199.    --  </style_properties> 
  200.  
  201.    Child_Internal_Pad_X_Property : constant Glib.Properties.Property_Int; 
  202.    Child_Internal_Pad_Y_Property : constant Glib.Properties.Property_Int; 
  203.    Child_Min_Height_Property     : constant Glib.Properties.Property_Int; 
  204.    Child_Min_Width_Property      : constant Glib.Properties.Property_Int; 
  205.  
  206.    ------------- 
  207.    -- Signals -- 
  208.    ------------- 
  209.  
  210.    --  <signals> 
  211.    --  The following new signals are defined for this widget: 
  212.    --  </signals> 
  213.  
  214. private 
  215.    type Gtk_Button_Box_Record is new Gtk.Box.Gtk_Box_Record with null record; 
  216.    pragma Import (C, Get_Type, "gtk_button_box_get_type"); 
  217.  
  218.    Layout_Style_Property : constant Gtk.Enums.Property_Gtk_Button_Box_Style := 
  219.       Gtk.Enums.Build ("layout_style"); 
  220.    Child_Secondary_Property : constant Glib.Properties.Property_Boolean := 
  221.       Glib.Properties.Build ("secondary"); 
  222.  
  223.    Secondary_Property : constant Glib.Properties.Property_Boolean := 
  224.      Glib.Properties.Build ("secondary"); 
  225.  
  226.    Child_Internal_Pad_X_Property : constant Glib.Properties.Property_Int := 
  227.      Glib.Properties.Build ("child-internal-pad-x"); 
  228.    Child_Internal_Pad_Y_Property : constant Glib.Properties.Property_Int := 
  229.      Glib.Properties.Build ("child-internal-pad-y"); 
  230.    Child_Min_Height_Property : constant Glib.Properties.Property_Int := 
  231.      Glib.Properties.Build ("child-min-height"); 
  232.    Child_Min_Width_Property : constant Glib.Properties.Property_Int := 
  233.      Glib.Properties.Build ("child-min-width"); 
  234.  
  235. end Gtk.Button_Box; 
  236.  
  237. --  The following functions never had a binding, are now obsolescent 
  238. --  No binding: gtk_button_box_get_child_ipadding