File : menu_windows.ads
-----------------------------------------------------------------------
-- Win_IO --
-- A simple set of packages for graphical input and output --
-- --
-- Copyright (C) 2001-2010 --
-- Universidad de Cantabria, SPAIN --
-- --
-- Author: Michael Gonzalez mgh@unican.es --
-- --
-- This is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public --
-- License as published by the Free Software Foundation; either --
-- version 2 of the License, or (at your option) any later version. --
-- --
-- This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public --
-- License along with this program; if not, write to the --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-----------------------------------------------------------------------
-- --
-- The Menu_Windows package provides a simple window with --
-- several buttons that enable the user to select from a number --
-- of options. --
-- --
-- It is a generic package that must be instantiated with an --
-- enumeration type. One button will be created for each value in --
-- this type. --
-- --
-- This package requires Gtkada-2.2.0 or later --
-- --
-----------------------------------------------------------------------
with Menu_Window_Pkg;
generic
type Enum is (<>);
package Menu_Windows is
-----------------------------------------------------------------------
--
-- MENU_WINDOW
--
-- A MENU_Window is a window that provides the capability of choosing
-- among a set of options
--
-- It provides a button for each value of the generic enumeration type
-- parameter
--
-- It provides a Wait operation that waits until the user presses one of
-- those buttons. The operation returns the chosen option
--
-----------------------------------------------------------------------
type Menu_Window_Type is private;
-----------------------------------------------------------------------
-- MENU_WINDOW Operations
--
-- Menu_Window (Title) -- Create the window, with the
-- -- specified title
--
-- Wait (MW, -- Wait for a button to be pressed.
-- Selection) -- This will an indication that the
-- -- option has been chosen
-- -- The chosen option is returned in
-- -- Selection.
-- -- Before returning, it hides the window
-----------------------------------------------------------------------
function Menu_Window
(Title : String)
return Menu_Window_Type;
procedure Wait
(MW : in out Menu_Window_Type;
Selection : out Enum);
private
type Menu_Window_Type is record
Win : Menu_Window_Pkg.Menu_Window_Access;
Id : Natural;
end record;
end Menu_Windows;