1. package Widgets.Labels is 
  2.  
  3.     type Label is new Widget with private; 
  4.     type A_Label is access all Label'Class; 
  5.  
  6.     function Create_Label( view : not null access Game_Views.Game_View'Class; 
  7.                            id   : String; 
  8.                            text : String := ""; 
  9.                            icon : String := "" ) return A_Label; 
  10.     pragma Precondition( id'Length > 0 ); 
  11.     pragma Postcondition( Create_Label'Result /= null ); 
  12.  
  13.     function Get_Text( this : not null access Label'Class ) return String; 
  14.  
  15.     procedure Set_Align( this : not null access Label'Class; align : Align_Type ); 
  16.  
  17.     procedure Set_Color( this    : access Label; 
  18.                          purpose : Color_Purpose; 
  19.                          color   : Color_Type ); 
  20.  
  21.     procedure Set_Icon( this : not null access Label'Class; icon : String ); 
  22.  
  23.     procedure Set_Text( this : not null access Label'Class; text : String ); 
  24.  
  25. private 
  26.  
  27.     SPACING : constant Integer := 2; 
  28.  
  29.     ---------------------------------------------------------------------------- 
  30.  
  31.     type Label is new Widget with 
  32.         record 
  33.             align    : Align_Type := Align_Left; 
  34.             text     : Unbounded_String; 
  35.             icon     : Natural := 0; 
  36.         end record; 
  37.  
  38.     procedure Construct( this : access Label; 
  39.                          view : not null access Game_Views.Game_View'Class; 
  40.                          id   : String; 
  41.                          text : String; 
  42.                          icon : String ); 
  43.  
  44.     procedure Draw_Content( this : access Label; dc : Drawing_Context ); 
  45.  
  46.     function Get_Min_Height( this : access Label ) return Natural; 
  47.  
  48.     function Get_Min_Width( this : access Label ) return Natural; 
  49.  
  50. end Widgets.Labels;