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. package Widgets.Buttons.Pushes.Retry_Buttons is 
  10.  
  11.     -- Retry_Button widgets are used on the retry level dialog of the 
  12.     -- Retry_Screen. They are animated and have a specific look to match the 
  13.     -- dialog box. 
  14.     type Retry_Button is new Push_Button and Animated with private; 
  15.     type A_Retry_Button is access all Retry_Button'Class; 
  16.  
  17.     -- Creates a new button specifically for use in the retry level dialog box. 
  18.     function Create_Retry_Button( view : not null access Game_Views.Game_View'Class; 
  19.                                   id   : String; 
  20.                                   text : String := ""; 
  21.                                   icon : String := "" ) return A_Button; 
  22.     pragma Precondition( id'Length > 0 ); 
  23.     pragma Postcondition( Create_Retry_Button'Result /= null ); 
  24.  
  25. private 
  26.  
  27.     type Retry_Button is new Push_Button and Animated with null record; 
  28.  
  29.     procedure Construct( this : access Retry_Button; 
  30.                          view : not null access Game_Views.Game_View'Class; 
  31.                          id   : String; 
  32.                          text : String; 
  33.                          icon : String ); 
  34.     pragma Precondition( id'Length > 0 ); 
  35.  
  36.     procedure Draw_Content( this : access Retry_Button ); 
  37.  
  38.     procedure On_Key_Press( this    : access Retry_Button; 
  39.                             evt     : not null A_Key_Event; 
  40.                             handled : in out Boolean ); 
  41.  
  42.     procedure Tick( this : access Retry_Button; time : Tick_Time ); 
  43.  
  44. end Widgets.Buttons.Pushes.Retry_Buttons;