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