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-2011, 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. --  A container that can hide its child. 
  27. -- 
  28. --  </description> 
  29. --  <screenshot>gtk-expanded</screenshot> 
  30. --  <group>Layout containers</group> 
  31.  
  32. pragma Warnings (Off, "*is already use-visible*"); 
  33. with Glib;            use Glib; 
  34. with Glib.Properties; use Glib.Properties; 
  35. with Glib.Types;      use Glib.Types; 
  36. with Gtk.Bin;         use Gtk.Bin; 
  37. with Gtk.Buildable;   use Gtk.Buildable; 
  38. with Gtk.Widget;      use Gtk.Widget; 
  39.  
  40. package Gtk.Expander is 
  41.  
  42.    type Gtk_Expander_Record is new Gtk_Bin_Record with null record; 
  43.    type Gtk_Expander is access all Gtk_Expander_Record'Class; 
  44.  
  45.    ------------------ 
  46.    -- Constructors -- 
  47.    ------------------ 
  48.  
  49.    procedure Gtk_New (Expander : out Gtk_Expander; Label : UTF8_String); 
  50.    procedure Initialize 
  51.       (Expander : access Gtk_Expander_Record'Class; 
  52.        Label    : UTF8_String); 
  53.    --  Creates a new expander using Label as the text of the label. 
  54.    --  Since: gtk+ 2.4 
  55.    --  "label": the text of the label 
  56.  
  57.    procedure Gtk_New_With_Mnemonic 
  58.       (Expander : out Gtk_Expander; 
  59.        Label    : UTF8_String); 
  60.    procedure Initialize_With_Mnemonic 
  61.       (Expander : access Gtk_Expander_Record'Class; 
  62.        Label    : UTF8_String); 
  63.    --  Creates a new expander using Label as the text of the label. If 
  64.    --  characters in Label are preceded by an underscore, they are underlined. 
  65.    --  If you need a literal underscore character in a label, use '__' (two 
  66.    --  underscores). The first underlined character represents a keyboard 
  67.    --  accelerator called a mnemonic. Pressing Alt and that key activates the 
  68.    --  button. 
  69.    --  Since: gtk+ 2.4 
  70.    --  "label": the text of the label with an underscore in front of the 
  71.    --  mnemonic character 
  72.  
  73.    function Get_Type return Glib.GType; 
  74.    pragma Import (C, Get_Type, "gtk_expander_get_type"); 
  75.  
  76.    ------------- 
  77.    -- Methods -- 
  78.    ------------- 
  79.  
  80.    function Get_Expanded 
  81.       (Expander : access Gtk_Expander_Record) return Boolean; 
  82.    procedure Set_Expanded 
  83.       (Expander : access Gtk_Expander_Record; 
  84.        Expanded : Boolean); 
  85.    --  Sets the state of the expander. Set to True, if you want the child 
  86.    --  widget to be revealed, and False if you want the child widget to be 
  87.    --  hidden. 
  88.    --  Since: gtk+ 2.4 
  89.    --  "expanded": whether the child widget is revealed 
  90.  
  91.    function Get_Label 
  92.       (Expander : access Gtk_Expander_Record) return UTF8_String; 
  93.    procedure Set_Label 
  94.       (Expander : access Gtk_Expander_Record; 
  95.        Label    : UTF8_String); 
  96.    --  Sets the text of the label of the expander to Label. This will also 
  97.    --  clear any previously set labels. 
  98.    --  Since: gtk+ 2.4 
  99.    --  "label": a string 
  100.  
  101.    function Get_Label_Fill 
  102.       (Expander : access Gtk_Expander_Record) return Boolean; 
  103.    procedure Set_Label_Fill 
  104.       (Expander   : access Gtk_Expander_Record; 
  105.        Label_Fill : Boolean); 
  106.    --  Sets whether the label widget should fill all available horizontal 
  107.    --  space allocated to Expander. 
  108.    --  Since: gtk+ 2.22 
  109.    --  "label_fill": True if the label should should fill all available 
  110.    --  horizontal space 
  111.  
  112.    function Get_Label_Widget 
  113.       (Expander : access Gtk_Expander_Record) return Gtk.Widget.Gtk_Widget; 
  114.    procedure Set_Label_Widget 
  115.       (Expander     : access Gtk_Expander_Record; 
  116.        Label_Widget : access Gtk.Widget.Gtk_Widget_Record'Class); 
  117.    --  Set the label widget for the expander. This is the widget that will 
  118.    --  appear embedded alongside the expander arrow. 
  119.    --  Since: gtk+ 2.4 
  120.    --  "label_widget": the new label widget 
  121.  
  122.    function Get_Spacing (Expander : access Gtk_Expander_Record) return Gint; 
  123.    procedure Set_Spacing 
  124.       (Expander : access Gtk_Expander_Record; 
  125.        Spacing  : Gint); 
  126.    --  Sets the spacing field of Expander, which is the number of pixels to 
  127.    --  place between expander and the child. 
  128.    --  Since: gtk+ 2.4 
  129.    --  "spacing": distance between the expander and child in pixels. 
  130.  
  131.    function Get_Use_Markup 
  132.       (Expander : access Gtk_Expander_Record) return Boolean; 
  133.    procedure Set_Use_Markup 
  134.       (Expander   : access Gtk_Expander_Record; 
  135.        Use_Markup : Boolean); 
  136.    --  Sets whether the text of the label contains markup in <link 
  137.    --  linkend="PangoMarkupFormat">Pango's text markup language</link>. See 
  138.    --  Gtk.Label.Set_Markup. 
  139.    --  Since: gtk+ 2.4 
  140.    --  "use_markup": True if the label's text should be parsed for markup 
  141.  
  142.    function Get_Use_Underline 
  143.       (Expander : access Gtk_Expander_Record) return Boolean; 
  144.    procedure Set_Use_Underline 
  145.       (Expander      : access Gtk_Expander_Record; 
  146.        Use_Underline : Boolean); 
  147.    --  If true, an underline in the text of the expander label indicates the 
  148.    --  next character should be used for the mnemonic accelerator key. 
  149.    --  Since: gtk+ 2.4 
  150.    --  "use_underline": True if underlines in the text indicate mnemonics 
  151.  
  152.    ---------------- 
  153.    -- Interfaces -- 
  154.    ---------------- 
  155.    --  This class implements several interfaces. See Glib.Types 
  156.    -- 
  157.    --  - "Buildable" 
  158.  
  159.    package Implements_Buildable is new Glib.Types.Implements 
  160.      (Gtk.Buildable.Gtk_Buildable, Gtk_Expander_Record, Gtk_Expander); 
  161.    function "+" 
  162.      (Widget : access Gtk_Expander_Record'Class) 
  163.    return Gtk.Buildable.Gtk_Buildable 
  164.    renames Implements_Buildable.To_Interface; 
  165.    function "-" 
  166.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  167.    return Gtk_Expander 
  168.    renames Implements_Buildable.To_Object; 
  169.  
  170.    ---------------- 
  171.    -- Properties -- 
  172.    ---------------- 
  173.    --  The following properties are defined for this widget. See 
  174.    --  Glib.Properties for more information on properties) 
  175.    -- 
  176.    --  Name: Expanded_Property 
  177.    --  Type: Boolean 
  178.    --  Flags: read-write 
  179.    -- 
  180.    --  Name: Label_Property 
  181.    --  Type: UTF8_String 
  182.    --  Flags: read-write 
  183.    -- 
  184.    --  Name: Label_Fill_Property 
  185.    --  Type: Boolean 
  186.    --  Flags: read-write 
  187.    -- 
  188.    --  Name: Label_Widget_Property 
  189.    --  Type: Gtk.Widget.Gtk_Widget 
  190.    --  Flags: read-write 
  191.    -- 
  192.    --  Name: Spacing_Property 
  193.    --  Type: Gint 
  194.    --  Flags: read-write 
  195.    -- 
  196.    --  Name: Use_Markup_Property 
  197.    --  Type: Boolean 
  198.    --  Flags: read-write 
  199.    -- 
  200.    --  Name: Use_Underline_Property 
  201.    --  Type: Boolean 
  202.    --  Flags: read-write 
  203.  
  204.    Expanded_Property : constant Glib.Properties.Property_Boolean; 
  205.    Label_Property : constant Glib.Properties.Property_String; 
  206.    Label_Fill_Property : constant Glib.Properties.Property_Boolean; 
  207.    Label_Widget_Property : constant Glib.Properties.Property_Object; 
  208.    Spacing_Property : constant Glib.Properties.Property_Int; 
  209.    Use_Markup_Property : constant Glib.Properties.Property_Boolean; 
  210.    Use_Underline_Property : constant Glib.Properties.Property_Boolean; 
  211.  
  212.    ------------- 
  213.    -- Signals -- 
  214.    ------------- 
  215.    --  The following new signals are defined for this widget: 
  216.    -- 
  217.    --  "activate" 
  218.    --     procedure Handler (Self : access Gtk_Expander_Record'Class); 
  219.  
  220.    Signal_Activate : constant Glib.Signal_Name := "activate"; 
  221.  
  222. private 
  223.    Expanded_Property : constant Glib.Properties.Property_Boolean := 
  224.      Glib.Properties.Build ("expanded"); 
  225.    Label_Property : constant Glib.Properties.Property_String := 
  226.      Glib.Properties.Build ("label"); 
  227.    Label_Fill_Property : constant Glib.Properties.Property_Boolean := 
  228.      Glib.Properties.Build ("label-fill"); 
  229.    Label_Widget_Property : constant Glib.Properties.Property_Object := 
  230.      Glib.Properties.Build ("label-widget"); 
  231.    Spacing_Property : constant Glib.Properties.Property_Int := 
  232.      Glib.Properties.Build ("spacing"); 
  233.    Use_Markup_Property : constant Glib.Properties.Property_Boolean := 
  234.      Glib.Properties.Build ("use-markup"); 
  235.    Use_Underline_Property : constant Glib.Properties.Property_Boolean := 
  236.      Glib.Properties.Build ("use-underline"); 
  237. end Gtk.Expander;