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( this : access Pulldown_Menu;
child : in out A_Widget;
consume : Boolean := True );
pragma Precondition( child /= null );
pragma Postcondition( consume xor child /= 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; dc : Drawing_Context );
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( this : access Pulldown_Menu; child : not null A_Widget );
function To_String( this : access Pulldown_Menu ) return String;
end Widgets.Containers.Pulldown_Menus;