Index

Package: Input_Boxes

Description

package Widgets.Input_Boxes is

Classes

Input_Action

type Input_Action is new Action with private;

Ancestors:

Primitive operations:

Actions.Construct (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
Objects.To_String (Inherited)
Represents a widget action involving an Input_Box, such as a input event.

Input_Box

type Input_Box is new Widget with private;

Ancestors:

Primitive operations:

Add_Listener
Add_Listener
Construct (overriding Widgets.Construct)
Dispatch_Action
Draw_Content (overriding Widgets.Draw_Content)
Handle_Key_Held (overriding Widgets.Handle_Key_Held)
Handle_Key_Press (overriding Widgets.Handle_Key_Press)
Handle_Key_Release (overriding Widgets.Handle_Key_Release)
Handle_Mouse_Press (overriding Widgets.Handle_Mouse_Press)
Objects.Construct (Inherited)
Pack (overriding Widgets.Pack)
Remove_Listener
Set_Constraint
Set_Max_Length
Widgets.Activate_Popup (Inherited)
Widgets.Bring_To_Front (Inherited)
Widgets.Delete (Inherited)
Widgets.Draw (Inherited)
Widgets.Find_Widget (Inherited)
Widgets.Get_Color (Inherited)
Widgets.Get_Min_Height (Inherited)
Widgets.Get_Min_Width (Inherited)
Widgets.Get_Process_Name (Inherited)
Widgets.Get_View (Inherited)
Widgets.Get_Window (Inherited)
Widgets.Handle_Ancestor_Hidden (Inherited)
Widgets.Handle_Ancestor_Unhidden (Inherited)
Widgets.Handle_Blur (Inherited)
Widgets.Handle_Click (Inherited)
Widgets.Handle_Descendant_Hidden (Inherited)
Widgets.Handle_Descendant_Unhidden (Inherited)
Widgets.Handle_Disabled (Inherited)
Widgets.Handle_Enabled (Inherited)
Widgets.Handle_Enter (Inherited)
Widgets.Handle_Exit (Inherited)
Widgets.Handle_Focus (Inherited)
Widgets.Handle_Hidden (Inherited)
Widgets.Handle_Mouse_Held (Inherited)
Widgets.Handle_Mouse_Move (Inherited)
Widgets.Handle_Mouse_Release (Inherited)
Widgets.Handle_Mouse_Scroll (Inherited)
Widgets.Handle_Resize (Inherited)
Widgets.Handle_Unhidden (Inherited)
Widgets.Set_Color (Inherited)
Widgets.Set_Dirty (Inherited)
Widgets.Set_Parent (Inherited)
Widgets.Set_Zoom (Inherited)
Widgets.To_String (Inherited)
Widgets.Translate_To_Content (Inherited)
Widgets.Translate_To_Window (Inherited)
An Input_Box widget allows a single line of text to be edited with the keyboard. The text of the input box can be larger than the width of the width; the portion of the text near the cursor will be displayed.

Types

A_Input_Action

type A_Input_Action is access all Input_Action'Class;

Input_Listener (abstract)

type Input_Listener is limited interface and Action_Listener;
This is the interface to implement in order to listen to input actions. When an input action occurs, the listener will be notified of the type of action performed and the input box that performed the action.

A_Input_Listener

type A_Input_Listener is access all Input_Listener'Class;

A_Input_Handler

type A_Input_Handler is
        access procedure( action : A_Input_Action );
A simple procedure to handle an input action, used by Simple_Input_Listener.

A_Constrain_Func

type A_Constrain_Func is
        access function( curstr, newstr : String ) return String;
An access to a string constraint function. A constraint function returns 'newstr' if it meets the constraint, otherwise 'curstr' will be returned.

A_Input_Box

type A_Input_Box is access all Input_Box'Class;

Constants & Global variables

Subprograms & Entries

Handle_Action (abstract)

procedure Handle_Action
( this: access Input_Listener;
action: A_Input_Action ) is abstract;
Handles the input action 'action'.

Create_Input_Box

function Create_Input_Box
( view: not null access Game_Views.Game_View'Class;
id: String ) return A_Input_Box;
Creates a new Input_Box within 'view' with id 'id'.

Add_Listener

procedure Add_Listener
( this: access Input_Box;
listener: not null A_Input_Listener );
Registers 'listener' as an Input_Action listener.

Add_Listener

procedure Add_Listener
( this: access Input_Box;
handler: not null A_Input_Handler );
Registers 'handler' to be invoked when an Input_Action occurs.

Get_Text

function Get_Text
( this: access Input_Box ) return String;
Returns the input box's text.

Remove_Listener

procedure Remove_Listener
( this: access Input_Box;
listener: not null A_Input_Listener );
Unregisters 'listener' as an Input_Action listener.

Set_Constraint

procedure Set_Constraint
( this: access Input_Box;
constraint: A_Constrain_Func );
Sets a constraint function to validate the input box's text. If 'constraint' is null, any text can be added. No text can be entered into the input box that is not validated by the constraint function.

Set_Max_Length

procedure Set_Max_Length
( this: access Input_Box;
maxlen: Positive );
Sets the maximum length of the input box's text in characters.

Set_Text

procedure Set_Text
( this: access Input_Box;
text: String );
Sets the input box's text value. The value will remain unchanged if 'text' is not accepted by the current constraint function.