1. with Widgets.Buttons;                   use Widgets.Buttons; 
  2.  
  3. private with Widgets.Scrollbars; 
  4.  
  5. package Widgets.Containers.Scroll_Panes is 
  6.  
  7.     type Scroll_Pane is new Container and Button_Listener with private; 
  8.     type A_Scroll_Pane is access all Scroll_Pane'Class; 
  9.  
  10.     function Create_Scroll_Pane( view : not null access Game_Views.Game_View'Class; 
  11.                                  id   : String ) return A_Scroll_Pane; 
  12.     pragma Precondition( id'Length > 0 ); 
  13.     pragma Postcondition( Create_Scroll_Pane'Result /= null ); 
  14.  
  15.     procedure Draw_Hbar( this : access Scroll_Pane; draw : Boolean ); 
  16.  
  17.     procedure Draw_Vbar( this : access Scroll_Pane; draw : Boolean ); 
  18.  
  19.     -- Sets the single client widget of the scroll pane. 
  20.     procedure Set_Client( this   : access Scroll_Pane; 
  21.                           client : in out A_Widget ); 
  22.     pragma Postcondition( client = null ); 
  23.  
  24. private 
  25.  
  26.     use Widgets.Scrollbars; 
  27.  
  28.     type Scroll_Pane is new Container and Button_Listener with 
  29.         record 
  30.             client   : A_Widget := null; 
  31.             hscroll  : A_H_Scrollbar := null; 
  32.             vscroll  : A_V_Scrollbar := null; 
  33.             left, 
  34.             right, 
  35.             up, 
  36.             down     : A_Button := null; 
  37.             drawHbar, 
  38.             drawVbar : Boolean := True; 
  39.         end record; 
  40.  
  41.     procedure Adjust_Layout( this : access Scroll_Pane ); 
  42.  
  43.     procedure Construct( this : access Scroll_Pane; 
  44.                          view : not null access Game_Views.Game_View'Class; 
  45.                          id   : String ); 
  46.     pragma Precondition( id'Length > 0 ); 
  47.  
  48.     procedure Draw_Content( this : access Scroll_Pane; dc : Drawing_Context ); 
  49.  
  50.     function Get_Inc_X( this : access Scroll_Pane ) return Integer; 
  51.  
  52.     function Get_Inc_Y( this : access Scroll_Pane ) return Integer; 
  53.  
  54.     procedure Handle_Action( this   : access Scroll_Pane; 
  55.                              action : A_Button_Action ); 
  56.  
  57.     function Handle_Mouse_Scroll( this : access Scroll_Pane; 
  58.                                   evt  : not null A_Mouse_Scroll_Event ) return Boolean; 
  59.  
  60.     procedure Handle_Resize( this : access Scroll_Pane ); 
  61.  
  62. end Widgets.Containers.Scroll_Panes;