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-2006 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. --  This widget represents a widget that can be dragged by the user to change 
  32. --  the visible area of another widget. It is typically only used through a 
  33. --  Gtk.Scrolled_Window, although you might need, from time to time, to use it 
  34. --  directly if the widget you want to scroll isn't entirely suitable for a 
  35. --  scrolled window. 
  36. --  For instance, if you are creating your own drawing area, unlimited in size, 
  37. --  you do not want to create a Gtk_Drawing_Area 100_000 pixels large, since 
  38. --  that would use too much memory. Instead, you create one with just the 
  39. --  size of the visible area on the screen, then connect it with a scrollbar so 
  40. --  that when the user moves the scrollbar, you change what should be displayed 
  41. --  in the drawing area. 
  42. --  </description> 
  43. --  <c_version>2.8.17</c_version> 
  44. --  <group>Scrolling</group> 
  45.  
  46. with Glib.Properties; 
  47. with Gtk.GRange; 
  48. with Gtk.Adjustment; 
  49.  
  50. package Gtk.Scrollbar is 
  51.  
  52.    type Gtk_Scrollbar_Record is new Gtk.GRange.Gtk_Range_Record with private; 
  53.    subtype Gtk_Hscrollbar_Record is Gtk_Scrollbar_Record; 
  54.    subtype Gtk_Vscrollbar_Record is Gtk_Scrollbar_Record; 
  55.  
  56.    type Gtk_Scrollbar is access all Gtk_Scrollbar_Record'Class; 
  57.    subtype Gtk_Hscrollbar is Gtk_Scrollbar; 
  58.    subtype Gtk_Vscrollbar is Gtk_Scrollbar; 
  59.  
  60.    procedure Gtk_New_Hscrollbar 
  61.      (Widget     : out Gtk_Scrollbar; 
  62.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  63.    procedure Initialize_Hscrollbar 
  64.      (Widget     : access Gtk_Scrollbar_Record'Class; 
  65.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  66.    --  Creates or initializes a new horizontal scrollbar 
  67.  
  68.    procedure Gtk_New_Vscrollbar 
  69.      (Widget     : out Gtk_Scrollbar; 
  70.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  71.    procedure Initialize_Vscrollbar 
  72.      (Widget     : access Gtk_Scrollbar_Record'Class; 
  73.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  74.    --  Creates or initializes a new vertical scrollbar 
  75.  
  76.    function Get_Type return Gtk.Gtk_Type; 
  77.    function Hscrollbar_Get_Type return Gtk.Gtk_Type; 
  78.    function Vscrollbar_Get_Type return Gtk.Gtk_Type; 
  79.    --  Return the internal value associated with a Gtk_Scrollbar. 
  80.  
  81.    ---------------------- 
  82.    -- Style Properties -- 
  83.    ---------------------- 
  84.    --  The following properties can be changed through the gtk theme and 
  85.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  86.  
  87.    --  <style_properties> 
  88.    --  Name:  Fixed_Slider_Length_Property 
  89.    --  Type:  Boolean 
  90.    --  Descr: Don't change slider size, just lock it to the minimum length 
  91.    -- 
  92.    --  Name:  Has_Backward_Stepper_Property 
  93.    --  Type:  Boolean 
  94.    --  Descr: Display the standard backward arrow button 
  95.    -- 
  96.    --  Name:  Has_Forward_Stepper_Property 
  97.    --  Type:  Boolean 
  98.    --  Descr: Display the standard forward arrow button 
  99.    -- 
  100.    --  Name:  Has_Secondary_Backward_Stepper_Property 
  101.    --  Type:  Boolean 
  102.    --  Descr: Display a second backward arrow button on the opposite end of the 
  103.    --         scrollbar 
  104.    -- 
  105.    --  Name:  Has_Secondary_Forward_Stepper_Property 
  106.    --  Type:  Boolean 
  107.    --  Descr: Display a secondary forward arrow button on the opposite end of 
  108.    --         the scrollbar 
  109.    -- 
  110.    --  Name:  Min_Slider_Length_Property 
  111.    --  Type:  Int 
  112.    --  Descr: Minimum length of scrollbar slider 
  113.    --  </style_properties> 
  114.  
  115.    Fixed_Slider_Length_Property  : constant Glib.Properties.Property_Boolean; 
  116.    Has_Backward_Stepper_Property : constant Glib.Properties.Property_Boolean; 
  117.    Has_Forward_Stepper_Property  : constant Glib.Properties.Property_Boolean; 
  118.    Has_Secondary_Backward_Stepper_Property : constant 
  119.      Glib.Properties.Property_Boolean; 
  120.    Has_Secondary_Forward_Stepper_Property : constant 
  121.      Glib.Properties.Property_Boolean; 
  122.    Min_Slider_Length_Property    : constant Glib.Properties.Property_Int; 
  123.  
  124. private 
  125.    type Gtk_Scrollbar_Record is new Gtk.GRange.Gtk_Range_Record 
  126.      with null record; 
  127.  
  128.    Fixed_Slider_Length_Property : constant Glib.Properties.Property_Boolean := 
  129.      Glib.Properties.Build ("fixed-slider-length"); 
  130.    Has_Backward_Stepper_Property : constant Glib.Properties.Property_Boolean := 
  131.      Glib.Properties.Build ("has-backward-stepper"); 
  132.    Has_Forward_Stepper_Property : constant Glib.Properties.Property_Boolean := 
  133.      Glib.Properties.Build ("has-forward-stepper"); 
  134.    Has_Secondary_Backward_Stepper_Property : constant 
  135.      Glib.Properties.Property_Boolean := 
  136.      Glib.Properties.Build ("has-secondary-backward-stepper"); 
  137.    Has_Secondary_Forward_Stepper_Property : constant 
  138.      Glib.Properties.Property_Boolean := 
  139.      Glib.Properties.Build ("has-secondary-forward-stepper"); 
  140.    Min_Slider_Length_Property : constant Glib.Properties.Property_Int := 
  141.      Glib.Properties.Build ("min-slider-length"); 
  142.  
  143.    pragma Import (C, Get_Type, "gtk_scrollbar_get_type"); 
  144.    pragma Import (C, Hscrollbar_Get_Type, "gtk_hscrollbar_get_type"); 
  145.    pragma Import (C, Vscrollbar_Get_Type, "gtk_vscrollbar_get_type"); 
  146. end Gtk.Scrollbar;