with Window_Io;
with Set_Generic;
with New_Keys;
generic
    type Element is private;
    with function Line_Image (E : Element) return String;

    Quit_Key : New_Keys.Key_Type := New_Keys.Enter;

    with function Is_Applicative_Key
                     (Command : New_Keys.Key_Type) return Boolean;
    with procedure Apply (Command : New_Keys.Key_Type; E : in out Element);

    with function Is_Executable_Key
                     (Command : New_Keys.Key_Type) return Boolean;
    with procedure Execute (Command : New_Keys.Key_Type;
                            Redisplay : out Boolean);

package Multiple_Selection_Menu is

    subtype Menu_Window is Window_Io.File_Type;

    type Menu_Definition is private;

    function Make return Menu_Definition;

    procedure Add (E : Element; To : in out Menu_Definition);

    procedure Create (Menu : Menu_Window;
                      Font : Window_Io.Font := Window_Io.Normal;
                      Definition : Menu_Definition);

    Redisplay_Required : exception;

private
    type Menu_Node;
    type Menu_Definition is access Menu_Node;

    type Menu_Node is
        record
            Elem : Element;
            Line_Number : Positive;
            Next : Menu_Definition;
            Previous : Menu_Definition;
        end record;

end Multiple_Selection_Menu;


