1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --      Copyright (C) 2000 E. Briot, J. Brobecker and A. Charlet     -- 
  5. --                Copyright (C) 2000-2008, 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 Gtk_Combo_Button is a general form for a combo box (ie a button 
  27. --  associated with a popup window to select its value). 
  28. --  This widget should be used only if you intend to write your own kind 
  29. --  of combo box. You should look at the following widgets for specific 
  30. --  implementation: Gtk_Combo, Gtk_Color_Combo, Gtk_Border_Combo. 
  31. --  </description> 
  32. --  <c_version>gtkextra 2.1.1</c_version> 
  33. --  <group>Menus and Toolbars</group> 
  34.  
  35. with Gtk.Box; 
  36. with Gtk.Button; 
  37. with Gtk.Toggle_Button; 
  38. with Gtk.Frame; 
  39.  
  40. package Gtk.Extra.Combo_Button is 
  41.  
  42.    type Gtk_Combo_Button_Record is new Gtk.Box.Gtk_Box_Record with private; 
  43.    type Gtk_Combo_Button is access all Gtk_Combo_Button_Record'Class; 
  44.  
  45.    procedure Gtk_New (Widget : out Gtk_Combo_Button); 
  46.    --  Create a new combo box. 
  47.    --  This creates all the internal subwidgets (the popup window,...) but 
  48.    --  this is your responsibility to put something inside the button or 
  49.    --  the popup window. 
  50.  
  51.    procedure Initialize (Widget : access Gtk_Combo_Button_Record'Class); 
  52.    --  Internal initialization function. 
  53.    --  See the section "Creating your own widgets" in the documentation. 
  54.  
  55.    function Get_Type return Gtk.Gtk_Type; 
  56.    --  Return the internal value associated with a Gtk_Combo_Box. 
  57.  
  58.    procedure Hide_Popdown_Window (Combo : access Gtk_Combo_Button_Record); 
  59.    --  Hide the popup window, release the mouse grabs, and restore the 
  60.    --  default aspect for the arrow. 
  61.  
  62.    function Get_Button 
  63.      (Combo : access Gtk_Combo_Button_Record) return Gtk.Button.Gtk_Button; 
  64.    --  Return the button that shows the value of the combo. 
  65.  
  66.    function Get_Toggle_Button 
  67.      (Combo : access Gtk_Combo_Button_Record) 
  68.       return Gtk.Toggle_Button.Gtk_Toggle_Button; 
  69.    --  Return the arrow button. 
  70.    --  The user has to click on it to open the popup window. 
  71.  
  72.    function Get_Frame 
  73.      (Combo : access Gtk_Combo_Button_Record) return Gtk.Frame.Gtk_Frame; 
  74.    --  The frame displayed in the popup window. 
  75.    --  You should add whatever value the popup window should display in it. 
  76.  
  77.    ------------- 
  78.    -- Signals -- 
  79.    ------------- 
  80.  
  81.    --  <signals> 
  82.    --  The following new signals are defined for this widget: 
  83.    --  </signals> 
  84.  
  85. private 
  86.    type Gtk_Combo_Button_Record is new Gtk.Box.Gtk_Box_Record with null record; 
  87.    pragma Import (C, Get_Type, "gtk_combo_button_get_type"); 
  88. end Gtk.Extra.Combo_Button;