1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. with Associations;                      use Associations; 
  10. with Entities;                          use Entities; 
  11.  
  12. private with Widgets.Buttons; 
  13.  
  14. pragma Warnings( Off, Associations ); 
  15.  
  16. package Widgets.Containers.Panels.Dialogs.Entity_Attributes is 
  17.  
  18.     function Create_Entity_Attributes_Dialog( view       : not null access Game_Views.Game_View'Class; 
  19.                                               id         : String; 
  20.                                               eid        : Entity_Id; 
  21.                                               class      : String; 
  22.                                               attributes : not null A_Association ) return A_Dialog; 
  23.     pragma Precondition( id'Length > 0 ); 
  24.     pragma Precondition( class'Length > 0 ); 
  25.     pragma Postcondition( Create_Entity_Attributes_Dialog'Result /= null ); 
  26.  
  27. private 
  28.  
  29.     use Widgets.Buttons; 
  30.  
  31.     type Entity_Attributes_Dialog is new Dialog and Button_Listener with 
  32.         record 
  33.             eid         : Entity_Id; 
  34.             eAttributes : A_Association := null; 
  35.         end record; 
  36.  
  37.     procedure Construct( this       : access Entity_Attributes_Dialog; 
  38.                          view       : not null access Game_Views.Game_View'Class; 
  39.                          id         : String; 
  40.                          eid        : Entity_Id; 
  41.                          class      : String; 
  42.                          attributes : not null A_Association ); 
  43.     pragma Precondition( id'Length > 0 ); 
  44.     pragma Precondition( class'Length > 0 ); 
  45.  
  46.     procedure Handle_Action( this   : access Entity_Attributes_Dialog; 
  47.                              action : A_Button_Action ); 
  48.  
  49.     procedure Handle_Action( this    : access Entity_Attributes_Dialog; 
  50.                              action  : A_Key_Action; 
  51.                              handled : out Boolean ); 
  52.  
  53.     procedure Show( this : access Entity_Attributes_Dialog ); 
  54.  
  55. end Widgets.Containers.Panels.Dialogs.Entity_Attributes;