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. --  The Gtk_Cell_Editable interface must be implemented for widgets to be 
  27. --  usable when editing the contents of a Gtk_Tree_View cell 
  28. -- 
  29. --  </description> 
  30. --  <group>Trees and Lists</group> 
  31.  
  32. pragma Warnings (Off, "*is already use-visible*"); 
  33. with Gdk.Event;       use Gdk.Event; 
  34. with Glib;            use Glib; 
  35. with Glib.Properties; use Glib.Properties; 
  36. with Glib.Types;      use Glib.Types; 
  37.  
  38. package Gtk.Cell_Editable is 
  39.  
  40.    type Gtk_Cell_Editable is new Glib.Types.GType_Interface; 
  41.  
  42.    ------------------ 
  43.    -- Constructors -- 
  44.    ------------------ 
  45.  
  46.    function Get_Type return Glib.GType; 
  47.    pragma Import (C, Get_Type, "gtk_cell_editable_get_type"); 
  48.  
  49.    ------------- 
  50.    -- Methods -- 
  51.    ------------- 
  52.  
  53.    procedure Editing_Done (Cell_Editable : Gtk_Cell_Editable); 
  54.    pragma Import (C, Editing_Done, "gtk_cell_editable_editing_done"); 
  55.    --  Emits the Gtk.Cell_Editable.Gtk_Cell_Editable::editing-done signal. 
  56.  
  57.    procedure Remove_Widget (Cell_Editable : Gtk_Cell_Editable); 
  58.    pragma Import (C, Remove_Widget, "gtk_cell_editable_remove_widget"); 
  59.    --  Emits the Gtk.Cell_Editable.Gtk_Cell_Editable::remove-widget signal. 
  60.  
  61.    procedure Start_Editing 
  62.       (Cell_Editable : Gtk_Cell_Editable; 
  63.        Event         : Gdk.Event.Gdk_Event); 
  64.    pragma Import (C, Start_Editing, "gtk_cell_editable_start_editing"); 
  65.    --  Begins editing on a Cell_Editable. Event is the GdkEvent that began the 
  66.    --  editing process. It may be null, in the instance that editing was 
  67.    --  initiated through programatic means. 
  68.    --  "event": A GdkEvent, or null 
  69.  
  70.    ---------------- 
  71.    -- Properties -- 
  72.    ---------------- 
  73.    --  The following properties are defined for this widget. See 
  74.    --  Glib.Properties for more information on properties) 
  75.    -- 
  76.    --  Name: Editing_Canceled_Property 
  77.    --  Type: Boolean 
  78.    --  Flags: read-write 
  79.    --  Indicates whether editing on the cell has been canceled. 
  80.  
  81.    Editing_Canceled_Property : constant Glib.Properties.Property_Boolean; 
  82.  
  83.    ------------- 
  84.    -- Signals -- 
  85.    ------------- 
  86.    --  The following new signals are defined for this widget: 
  87.    -- 
  88.    --  "editing-done" 
  89.    --     procedure Handler (Self : access Gtk_Cell_Editable); 
  90.    --  This signal is a sign for the cell renderer to update its value from 
  91.    --  the Cell_Editable. Implementations of 
  92.    --  Gtk.Cell_Editable.Gtk_Cell_Editable are responsible for emitting this 
  93.    --  signal when they are done editing, e.g. Gtk.GEntry.Gtk_Entry is emitting 
  94.    --  it when the user presses Enter. Gtk.Cell_Editable.Editing_Done is a 
  95.    --  convenience method for emitting GtkCellEditable::editing-done. 
  96.    -- 
  97.    --  "remove-widget" 
  98.    --     procedure Handler (Self : access Gtk_Cell_Editable); 
  99.    --  This signal is meant to indicate that the cell is finished editing, and 
  100.    --  the widget may now be destroyed. Implementations of 
  101.    --  Gtk.Cell_Editable.Gtk_Cell_Editable are responsible for emitting this 
  102.    --  signal when they are done editing. It must be emitted after the 
  103.    --  Gtk.Cell_Editable.Gtk_Cell_Editable::editing-done signal, to give the 
  104.    --  cell renderer a chance to update the cell's value before the widget is 
  105.    --  removed. Gtk.Cell_Editable.Remove_Widget is a convenience method for 
  106.    --  emitting GtkCellEditable::remove-widget. 
  107.  
  108.    Signal_Editing_Done : constant Glib.Signal_Name := "editing-done"; 
  109.    Signal_Remove_Widget : constant Glib.Signal_Name := "remove-widget"; 
  110.  
  111. private 
  112.    Editing_Canceled_Property : constant Glib.Properties.Property_Boolean := 
  113.      Glib.Properties.Build ("editing-canceled"); 
  114. end Gtk.Cell_Editable;