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 Entities;                          use Entities; 
  10.  
  11. private with Widgets.Buttons; 
  12.  
  13. package Widgets.Containers.Panels.Dialogs.Entity_Attributes is 
  14.  
  15.     function Create_Entity_Attributes_Dialog( view       : not null access Game_Views.Game_View'Class; 
  16.                                               id         : String; 
  17.                                               eid        : Entity_Id; 
  18.                                               class      : String; 
  19.                                               attributes : Assoc_Ptr ) return A_Dialog; 
  20.     pragma Precondition( id'Length > 0 ); 
  21.     pragma Precondition( class'Length > 0 ); 
  22.     pragma Precondition( attributes /= Associations.Nul ); 
  23.     pragma Postcondition( Create_Entity_Attributes_Dialog'Result /= null ); 
  24.  
  25. private 
  26.  
  27.     use Widgets.Buttons; 
  28.  
  29.     type Entity_Attributes_Dialog is new Dialog and Button_Listener with 
  30.         record 
  31.             eid         : Entity_Id; 
  32.             eAttributes : Assoc_Ptr; 
  33.         end record; 
  34.  
  35.     procedure Construct( this       : access Entity_Attributes_Dialog; 
  36.                          view       : not null access Game_Views.Game_View'Class; 
  37.                          id         : String; 
  38.                          eid        : Entity_Id; 
  39.                          class      : String; 
  40.                          attributes : Assoc_Ptr ); 
  41.     pragma Precondition( id'Length > 0 ); 
  42.     pragma Precondition( class'Length > 0 ); 
  43.     pragma Precondition( attributes /= Associations.Nul ); 
  44.  
  45.     procedure Handle_Action( this   : access Entity_Attributes_Dialog; 
  46.                              action : A_Button_Action ); 
  47.  
  48.     procedure Handle_Action( this    : access Entity_Attributes_Dialog; 
  49.                              action  : A_Key_Action; 
  50.                              handled : out Boolean ); 
  51.  
  52.     procedure Show( this : access Entity_Attributes_Dialog ); 
  53.  
  54. end Widgets.Containers.Panels.Dialogs.Entity_Attributes;