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