1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-2010, AdaCore                   -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  This widget works like a normal menu_item, but you can insert a 
  26. --  arbitrary widget (most often a pixmap widget), which is displayed 
  27. --  at the left side. The advantage is that indentation is handled the 
  28. --  same way as GtkAda does (i.e if you create a menu with a 
  29. --  Gtk_Check_Menu_Item, all normal menu_items are automatically indented by 
  30. --  GtkAda - so if you use a normal menu_item to display pixmaps at the left 
  31. --  side, the pixmaps will be indented, which is not what you want. This widget 
  32. --  solves the problem). 
  33. --  </description> 
  34. --  <c_version>2.16.6</c_version> 
  35. --  <group>Menus and Toolbars</group> 
  36.  
  37. with Glib.Properties; 
  38. with Gtk.Accel_Group; 
  39. with Gtk.Menu_Item; 
  40. with Gtk.Widget; 
  41.  
  42. package Gtk.Image_Menu_Item is 
  43.  
  44.    type Gtk_Image_Menu_Item_Record is new 
  45.      Gtk.Menu_Item.Gtk_Menu_Item_Record with private; 
  46.    type Gtk_Image_Menu_Item is access all Gtk_Image_Menu_Item_Record'Class; 
  47.  
  48.    procedure Gtk_New 
  49.      (Widget : out Gtk_Image_Menu_Item; 
  50.       Label  : UTF8_String); 
  51.    --  Create a new Gtk_Image_Menu_Item. 
  52.    --  If label is non null, set the label of the menu item. 
  53.  
  54.    procedure Gtk_New_From_Stock 
  55.      (Widget   : out Gtk_Image_Menu_Item; 
  56.       Stock_Id : String); 
  57.    --  Create a new Gtk_Image_Menu_Item from a stock item. 
  58.  
  59.    procedure Gtk_New 
  60.      (Widget      : out Gtk_Image_Menu_Item; 
  61.       Stock_Id    : String; 
  62.       Accel_Group : Gtk.Accel_Group.Gtk_Accel_Group); 
  63.    --  Create a new Gtk_Image_Menu_Item with a label. 
  64.    --  If label contains an underscore, a mnemonic is created accordingly. 
  65.  
  66.    procedure Gtk_New_With_Mnemonic 
  67.      (Widget : out Gtk_Image_Menu_Item; 
  68.       Label  : UTF8_String); 
  69.    --  Create a new Gtk_Image_Menu_Item with a label. 
  70.    --  If label contains an underscore, a mnemonic is created accordingly. 
  71.  
  72.    procedure Initialize 
  73.      (Widget : access Gtk_Image_Menu_Item_Record'Class; 
  74.       Label  : UTF8_String); 
  75.    --  Internal initialization function. 
  76.    --  See the section "Creating your own widgets" in the documentation. 
  77.  
  78.    procedure Initialize 
  79.      (Widget      : access Gtk_Image_Menu_Item_Record'Class; 
  80.       Stock_Id    : String; 
  81.       Accel_Group : Gtk.Accel_Group.Gtk_Accel_Group); 
  82.    --  ditto. 
  83.  
  84.    procedure Initialize_With_Mnemonic 
  85.      (Widget : access Gtk_Image_Menu_Item_Record'Class; 
  86.       Label  : UTF8_String); 
  87.    --  ditto. 
  88.  
  89.    procedure Initialize_From_Stock 
  90.      (Widget   : access Gtk_Image_Menu_Item_Record'Class; 
  91.       Stock_Id : String); 
  92.    --  ditto. 
  93.  
  94.    function Get_Type return Gtk.Gtk_Type; 
  95.    --  Return the internal value associated with this widget. 
  96.  
  97.    procedure Set_Image 
  98.      (Menu_Item : access Gtk_Image_Menu_Item_Record; 
  99.       Image     : access Gtk.Widget.Gtk_Widget_Record'Class); 
  100.  
  101.    function Get_Image 
  102.      (Menu_Item : access Gtk_Image_Menu_Item_Record) 
  103.       return Gtk.Widget.Gtk_Widget; 
  104.  
  105.    procedure Set_Accel_Group 
  106.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class; 
  107.       Accel_Group     : access Gtk.Accel_Group.Gtk_Accel_Group_Record'Class); 
  108.    --  Specifies an Accel_Group to add the menu items accelerator to. 
  109.    --  This only applies to stock items, so a stock item must already 
  110.    --  be set.  Make sure to call Set_Use_Stock and Gtk.Menu_Item.Set_Label 
  111.    --  with a valid stock item first. 
  112.    -- 
  113.    --  If you want this menu item to have changeable accelerators then 
  114.    --  you shouldn't need this (see Gtk_New_From_Stock). 
  115.  
  116.    function Get_Always_Show_Image 
  117.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class) 
  118.       return Boolean; 
  119.    procedure Set_Always_Show_Image 
  120.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class; 
  121.       Always_Show     : Boolean); 
  122.    --  If True, the menu item will ignore the GtkSettings:gtk-menu-images 
  123.    --  setting and always show the image, if available. 
  124.    -- 
  125.    --  Use this property if the menuitem would be useless or hard to use 
  126.    --  without the image. 
  127.  
  128.    function Get_Use_Stock 
  129.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class) 
  130.       return Boolean; 
  131.    procedure Set_Use_Stock 
  132.      (Image_Menu_Item : access Gtk_Image_Menu_Item_Record'Class; 
  133.       Use_Stock       : Boolean); 
  134.    --  If True, the label set in the Image_Menu_Item is used as a 
  135.    --  stock id to select the stock item for the item. 
  136.  
  137.    ---------------- 
  138.    -- Properties -- 
  139.    ---------------- 
  140.  
  141.    --  <properties> 
  142.    --  The following properties are defined for this widget. See 
  143.    --  Glib.Properties for more information on properties. 
  144.    -- 
  145.    --  Name:  Accel_Group_Property 
  146.    --  Type:  Object 
  147.    --  Descr: The Accel Group to use for stock accelerator keys 
  148.    -- 
  149.    --  Name:  Always_Show_Image_Property 
  150.    --  Type:  Boolean 
  151.    --  Descr: Whether the image will always be shown 
  152.    -- 
  153.    --  Name:  Image_Property 
  154.    --  Type:  Object 
  155.    --  Descr: Child widget to appear next to the menu text 
  156.    -- 
  157.    --  Name:  Use_Stock_Property 
  158.    --  Type:  Boolean 
  159.    --  Descr: Whether to use the label text to create a stock menu item 
  160.    -- 
  161.    --  </properties> 
  162.  
  163.    Accel_Group_Property       : constant Glib.Properties.Property_Object; 
  164.    Always_Show_Image_Property : constant Glib.Properties.Property_Boolean; 
  165.    Image_Property             : constant Glib.Properties.Property_Object; 
  166.    Use_Stock_Property         : constant Glib.Properties.Property_Boolean; 
  167.  
  168.    ------------- 
  169.    -- Signals -- 
  170.    ------------- 
  171.  
  172.    --  <signals> 
  173.    --  The following new signals are defined for this widget: 
  174.    -- 
  175.    --  </signals> 
  176.  
  177. private 
  178.    type Gtk_Image_Menu_Item_Record is new 
  179.      Gtk.Menu_Item.Gtk_Menu_Item_Record with null record; 
  180.  
  181.    Accel_Group_Property : constant Glib.Properties.Property_Object := 
  182.      Glib.Properties.Build ("accel-group"); 
  183.    Always_Show_Image_Property : constant Glib.Properties.Property_Boolean := 
  184.      Glib.Properties.Build ("always-show-image"); 
  185.    Image_Property : constant Glib.Properties.Property_Object := 
  186.      Glib.Properties.Build ("image"); 
  187.    Use_Stock_Property : constant Glib.Properties.Property_Boolean := 
  188.      Glib.Properties.Build ("use-stock"); 
  189.  
  190.    pragma Import (C, Get_Type, "gtk_image_menu_item_get_type"); 
  191. end Gtk.Image_Menu_Item;