1. limited with Game_Views; 
  2.  
  3. private with Ada.Real_Time; 
  4.  
  5. package Widgets.Buttons.Pushes.Menu_Buttons is 
  6.  
  7.     type Menu_Button is new Push_Button and Animated with private; 
  8.     type A_Menu_Button is access all Menu_Button'Class; 
  9.  
  10.     function Create_Menu_Button( view : not null access Game_Views.Game_View'Class; 
  11.                                  id   : String; 
  12.                                  text : String := ""; 
  13.                                  icon : String := "" ) return A_Button; 
  14.     pragma Precondition( id'Length > 0 ); 
  15.     pragma Postcondition( Create_Menu_Button'Result /= null ); 
  16.  
  17. private 
  18.  
  19.     use Ada.Real_Time; 
  20.  
  21.     type Menu_Button is new Push_Button and Animated with 
  22.         record 
  23.             focusTime : Time_Span;      -- last Tick upTime before getting focus 
  24.         end record; 
  25.  
  26.     procedure Construct( this : access Menu_Button; 
  27.                          view : not null access Game_Views.Game_View'Class; 
  28.                          id   : String; 
  29.                          text : String; 
  30.                          icon : String ); 
  31.     pragma Precondition( id'Length > 0 ); 
  32.  
  33.     procedure Handle_Blur( this : access Menu_Button ); 
  34.  
  35.     procedure Handle_Disabled( this : access Menu_Button ); 
  36.  
  37.     procedure Handle_Enabled( this : access Menu_Button ); 
  38.  
  39.     procedure Handle_Focus( this : access Menu_Button ); 
  40.  
  41.     function Handle_Key_Press( this : access Menu_Button; 
  42.                                evt  : not null A_Key_Event ) return Boolean; 
  43.  
  44.     procedure Tick( this : access Menu_Button; time : Tick_Time ); 
  45.  
  46. end Widgets.Buttons.Pushes.Menu_Buttons;