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