--
-- Copyright (c) 2012 Kevin Wellwood
-- All rights reserved.
--
-- This source code is distributed under the Modified BSD License. For terms and
-- conditions, see license.txt.
--
private with Widgets.Buttons;
private with Widgets.Menu_Enumerations;
package Widgets.Containers.Game_Screens.Menus is
-- Menu_Screen is an abstract base screen for all Keen menu screens with a
-- list of options. Menu buttons are added and automatically layed out in
-- the menu screen. It's mostly a mechanism for controlling what is in a
-- menu screen and for uniformly organizing the contents.
type Menu_Screen is abstract new Game_Screen with private;
private
use Widgets.Buttons;
use Widgets.Menu_Enumerations;
type Menu_Screen is abstract new Game_Screen with
record
lastItem : A_Widget; -- not owned, do not delete
nextItemTop : Integer := 0; -- top of next item to be added
end record;
procedure Construct( this : access Menu_Screen;
view : not null access Game_Views.Game_View'Class;
id : String;
popup : Boolean );
-- Adds a button to the menu, placing it appropriately and connecting it to
-- the other menu items for proper next/previous focus behavior.
procedure Add_Item( this : not null access Menu_Screen'Class;
button : not null A_Button );
-- Adds an enum to the menu, placing it appropriately and connecting it to
-- the other menu items for proper next/previous focus behavior.
procedure Add_Item( this : not null access Menu_Screen'Class;
enum : not null A_Menu_Enumeration );
end Widgets.Containers.Game_Screens.Menus;