with Widgets.Menu_Items; use Widgets.Menu_Items;
package Widgets.Containers.Pulldown_Menus is
type Pulldown_Menu is new Container and Menu_Listener with private;
type A_Pulldown_Menu is access all Pulldown_Menu'Class;
function Create_Pulldown_Menu( view : not null access Game_Views.Game_View'Class;
id : String;
text : String ) return A_Pulldown_Menu;
pragma Precondition( id'Length > 0 );
pragma Postcondition( Create_Pulldown_Menu'Result /= null );
procedure Add_Menu_Item( this : access Pulldown_Menu;
item : in out A_Menu_Item );
pragma Precondition( item /= null );
pragma Postcondition( item = null );
function Get_Text( this : access Pulldown_Menu ) return String;
private
type Pulldown_Menu is new Container and Menu_Listener with
record
text : Unbounded_String;
end record;
procedure Construct( this : access Pulldown_Menu;
view : not null access Game_Views.Game_View'Class;
id : String;
text : String );
pragma Precondition( id'Length > 0 );
procedure Draw_Content( this : access Pulldown_Menu );
function Get_Min_Height( this : access Pulldown_Menu ) return Natural;
function Get_Min_Width( this : access Pulldown_Menu ) return Natural;
procedure Handle_Action( this : access Pulldown_Menu;
action : A_Menu_Action );
procedure Pack( this : access Pulldown_Menu );
procedure Remove_Menu_Item( this : access Pulldown_Menu;
item : not null A_Menu_Item );
function To_String( this : access Pulldown_Menu ) return String;
end Widgets.Containers.Pulldown_Menus;