1. with Widgets.Menu_Items;                use Widgets.Menu_Items; 
  2.  
  3. package Widgets.Containers.Pulldown_Menus is 
  4.  
  5.     type Pulldown_Menu is new Container and Menu_Listener with private; 
  6.     type A_Pulldown_Menu is access all Pulldown_Menu'Class; 
  7.  
  8.     function Create_Pulldown_Menu( view : not null access Game_Views.Game_View'Class; 
  9.                                    id   : String; 
  10.                                    text : String ) return A_Pulldown_Menu; 
  11.     pragma Precondition( id'Length > 0 ); 
  12.     pragma Postcondition( Create_Pulldown_Menu'Result /= null ); 
  13.  
  14.     procedure Add( this    : access Pulldown_Menu; 
  15.                    child   : in out A_Widget; 
  16.                    consume : Boolean := True ); 
  17.     pragma Precondition( child /= null ); 
  18.     pragma Postcondition( consume xor child /= null ); 
  19.  
  20.     function Get_Text( this : access Pulldown_Menu ) return String; 
  21.  
  22. private 
  23.  
  24.     type Pulldown_Menu is new Container and Menu_Listener with 
  25.         record 
  26.             text : Unbounded_String; 
  27.         end record; 
  28.  
  29.     procedure Construct( this    : access Pulldown_Menu; 
  30.                          view    : not null access Game_Views.Game_View'Class; 
  31.                          id      : String; 
  32.                          text    : String ); 
  33.     pragma Precondition( id'Length > 0 ); 
  34.  
  35.     procedure Draw_Content( this : access Pulldown_Menu; dc : Drawing_Context ); 
  36.  
  37.     function Get_Min_Height( this : access Pulldown_Menu ) return Natural; 
  38.  
  39.     function Get_Min_Width( this : access Pulldown_Menu ) return Natural; 
  40.  
  41.     procedure Handle_Action( this   : access Pulldown_Menu; 
  42.                              action : A_Menu_Action ); 
  43.  
  44.     procedure Pack( this : access Pulldown_Menu ); 
  45.  
  46.     procedure Remove( this : access Pulldown_Menu; child : not null A_Widget ); 
  47.  
  48.     function To_String( this : access Pulldown_Menu ) return String; 
  49.  
  50. end Widgets.Containers.Pulldown_Menus;