package Widgets.Labels is
type Label is new Widget with private;
type A_Label is access all Label'Class;
function Create_Label( view : not null access Game_Views.Game_View'Class;
id : String;
text : String := "";
icon : String := "" ) return A_Label;
pragma Precondition( id'Length > 0 );
pragma Postcondition( Create_Label'Result /= null );
function Get_Text( this : not null access Label'Class ) return String;
procedure Set_Align( this : not null access Label'Class; align : Align_Type );
procedure Set_Color( this : access Label;
purpose : Color_Purpose;
color : Color_Type );
procedure Set_Icon( this : not null access Label'Class; icon : String );
procedure Set_Text( this : not null access Label'Class; text : String );
private
SPACING : constant Integer := 2;
type Label is new Widget with
record
align : Align_Type := Align_Left;
text : Unbounded_String;
icon : Natural := 0;
end record;
procedure Construct( this : access Label;
view : not null access Game_Views.Game_View'Class;
id : String;
text : String;
icon : String );
procedure Draw_Content( this : access Label; dc : Drawing_Context );
function Get_Min_Height( this : access Label ) return Natural;
function Get_Min_Width( this : access Label ) return Natural;
end Widgets.Labels;