1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. private with Widgets.Buttons; 
  10. private with Widgets.Menu_Enumerations; 
  11.  
  12. package Widgets.Containers.Game_Screens.Menus is 
  13.  
  14.     -- Menu_Screen is an abstract base screen for all Keen menu screens with a 
  15.     -- list of options. Menu buttons are added and automatically layed out in 
  16.     -- the menu screen. It's mostly a mechanism for controlling what is in a 
  17.     -- menu screen and for uniformly organizing the contents. 
  18.     type Menu_Screen is abstract new Game_Screen with private; 
  19.  
  20. private 
  21.  
  22.     use Widgets.Buttons; 
  23.     use Widgets.Menu_Enumerations; 
  24.  
  25.     type Menu_Screen is abstract new Game_Screen with 
  26.         record 
  27.             lastItem    : A_Widget;        -- not owned, do not delete 
  28.             nextItemTop : Integer := 0;    -- top of next item to be added 
  29.         end record; 
  30.  
  31.     procedure Construct( this  : access Menu_Screen; 
  32.                          view  : not null access Game_Views.Game_View'Class; 
  33.                          id    : String; 
  34.                          popup : Boolean ); 
  35.  
  36.     -- Adds a button to the menu, placing it appropriately and connecting it to 
  37.     -- the other menu items for proper next/previous focus behavior. 
  38.     procedure Add_Item( this   : not null access Menu_Screen'Class; 
  39.                         button : not null A_Button ); 
  40.  
  41.     -- Adds an enum to the menu, placing it appropriately and connecting it to 
  42.     -- the other menu items for proper next/previous focus behavior. 
  43.     procedure Add_Item( this   : not null access Menu_Screen'Class; 
  44.                         enum : not null A_Menu_Enumeration ); 
  45.  
  46. end Widgets.Containers.Game_Screens.Menus;