Index

Package: Labels

Description

package Widgets.Labels is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Label

type Label is new Widget and Animated with private;

Ancestors:

Primitive operations:

Construct
Draw_Content (overriding Widgets.Draw_Content)
Get_Min_Height (overriding Widgets.Get_Min_Height)
Get_Min_Width (overriding Widgets.Get_Min_Width)
Objects.Construct (Inherited)
Processes.Get_Process_Name (Inherited)
Set_Color (overriding Widgets.Set_Color)
Tick (overriding Processes.Tick)
Widgets.Activate_Popup (Inherited)
Widgets.Bring_To_Front (Inherited)
Widgets.Construct (Inherited)
Widgets.Delete (Inherited)
Widgets.Draw (Inherited)
Widgets.Find_Widget_At (Inherited)
Widgets.Get_Color (Inherited)
Widgets.Get_Process_Name (Inherited)
Widgets.Get_View (Inherited)
Widgets.Get_Window (Inherited)
Widgets.Handle_Rooted (Inherited)
Widgets.Handle_Shown (Inherited)
Widgets.Is_Rooted (Inherited)
Widgets.Is_Showing (Inherited)
Widgets.On_Blur (Inherited)
Widgets.On_Click (Inherited)
Widgets.On_Descendant_Shown (Inherited)
Widgets.On_Disabled (Inherited)
Widgets.On_Enabled (Inherited)
Widgets.On_Enter (Inherited)
Widgets.On_Exit (Inherited)
Widgets.On_Focus (Inherited)
Widgets.On_Key_Press (Inherited)
Widgets.On_Key_Release (Inherited)
Widgets.On_Key_Typed (Inherited)
Widgets.On_Mouse_Held (Inherited)
Widgets.On_Mouse_Move (Inherited)
Widgets.On_Mouse_Press (Inherited)
Widgets.On_Mouse_Release (Inherited)
Widgets.On_Mouse_Scroll (Inherited)
Widgets.On_Resize (Inherited)
Widgets.On_Rooted (Inherited)
Widgets.On_Shown (Inherited)
Widgets.Pack (Inherited)
Widgets.Set_Border (Inherited)
Widgets.Set_Parent (Inherited)
Widgets.Set_Zoom (Inherited)
Widgets.To_String (Inherited)
Widgets.Translate_To_Content (Inherited)
Widgets.Translate_To_Window (Inherited)
A Label widget is a simple text string with an optional icon to the left of the text. A label is intended for displaying static strings and isn't editable by the interface user.

Types

A_Label

type A_Label is access all Label'Class;

Subprograms & Entries

Create_Label

function Create_Label
( view: not null access Game_Views.Game_View'Class;
id: String;
text: String := "";
icon: String := "" ) return A_Label;
Creates a new Label within 'view' with id 'id'. Both 'text' and 'icon' are optional. 'icon' is the name of a frame in the Theme's tile library. The icon image can have an alpha channel for transparency.

Get_Text

function Get_Text
( this: not null access Label'Class ) return String;
Returns the label's text.

Set_Align

procedure Set_Align
( this: not null access Label'Class;
align: Align_Type );
Sets the label's text alignment. Both the text and icon will be aligned according to 'align'.

Set_Color

procedure Set_Color
( this: access Label;
purpose: Color_Purpose;
color: Allegro_Color );
Sets the color for a particular purpose when drawing the label. To remove the color behind the icon text, set the Foreground color to transparent.

Set_Icon

procedure Set_Icon
( this: not null access Label'Class;
icon: String );
Sets the label's icon. Pass an empty string to remove it.

Set_Text

procedure Set_Text
( this: not null access Label'Class;
text: String );
Sets the label's text.