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. private with Tiles.Libraries; 
  10.  
  11. package Widgets.Containers.Keen_Panels is 
  12.  
  13.     type Keen_Panel is new Container with private; 
  14.     type A_Keen_Panel is access all Keen_Panel'Class; 
  15.  
  16.     function Create_Panel( view    : not null access Game_Views.Game_View'Class; 
  17.                            id      : String; 
  18.                            libName : String ) return A_Keen_Panel; 
  19.     pragma Precondition( id'Length > 0 ); 
  20.     pragma Precondition( libName'Length > 0 ); 
  21.     pragma Postcondition( Create_Panel'Result /= null ); 
  22.  
  23.     -- Adds a child widget to the Keen panel. 'child' will be consumed. 
  24.     procedure Add_Widget( this : access Keen_Panel; child : in out A_Widget ); 
  25.     pragma Precondition( child /= null ); 
  26.     pragma Postcondition( child = null ); 
  27.  
  28. private 
  29.  
  30.     use Tiles.Libraries; 
  31.  
  32.     type Keen_Panel is new Container with 
  33.         record 
  34.             borderWidth   : Natural := 7; 
  35.             lib           : A_Tile_Library := null; 
  36.             topId         : Natural := 0; 
  37.             bottomId      : Natural := 0; 
  38.             leftId        : Natural := 0; 
  39.             rightId       : Natural := 0; 
  40.             topLeftId     : Natural := 0; 
  41.             topRightId    : Natural := 0; 
  42.             bottomLeftId  : Natural := 0; 
  43.             bottomRightId : Natural := 0; 
  44.         end record; 
  45.  
  46.     procedure Construct( this    : access Keen_Panel; 
  47.                          view    : not null access Game_Views.Game_View'Class; 
  48.                          id      : String; 
  49.                          libName : String ); 
  50.     pragma Precondition( id'Length > 0 ); 
  51.     pragma Precondition( libName'Length > 0 ); 
  52.  
  53.     procedure Delete( this : in out Keen_Panel ); 
  54.  
  55.     procedure Draw_Content( this : access Keen_Panel ); 
  56.  
  57.     function Get_Min_Height( this : access Keen_Panel ) return Natural; 
  58.  
  59.     function Get_Min_Width( this : access Keen_Panel ) return Natural; 
  60.  
  61. end Widgets.Containers.Keen_Panels;