Index

Package: Groups

Description

package Widgets.Buttons.Groups is

Classes

Button_Group_Action

type Button_Group_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 a Button_Group.

Button_Group

type Button_Group is new Object and Button_Listener with private;

Ancestors:

Primitive operations:

Add_Listener
Delete (overriding Objects.Delete)
Dispatch_Action
Handle_Action (overriding Widgets.Buttons.Handle_Action)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
Remove_Listener
Set_Keep_Selected
To_String (overriding Objects.To_String)
A Button_Group is a logical control object that allows buttons to be linked. A button group is used to create a radio-button-like behavior with two or more toggleable buttons. Button_Group is not actually a widget and an instance must be explicitly owned by another object, like the Game_View, to prevent leaks. The Button_Group object doesn't maintain ownership of any of the buttons added to its membership.

Types

A_Button_Group_Action

type A_Button_Group_Action is access all Button_Group_Action'Class;

A_Button_Group_Listener

type A_Button_Group_Listener is
        access procedure( action : A_Button_Group_Action );
A procedure to handle a button group action.

A_Button_Group

type A_Button_Group is access all Button_Group'Class;

Constants & Global variables

Group_Cleared (Actions.Action_Id)

Group_Cleared : constant Action_Id;

Group_Set (Actions.Action_Id)

Group_Set     : constant Action_Id;
all buttons are off in the group

Subprograms & Entries

Create_Button_Group

function Create_Button_Group return A_Button_Group;
Creates a new, empty button group.

Add

procedure Add
( this: access Button_Group;
button: not null A_Button );
Adds a button to the group's membership.

Add_Listener

procedure Add_Listener
( this: access Button_Group;
listener: not null A_Button_Group_Listener );
Adds a button group listener to be notified of actions. Listeners can be added multiple times.

Clear

procedure Clear
( this: access Button_Group );
Removes all buttons from the group's membership.

Remove_Listener

procedure Remove_Listener
( this: access Button_Group;
listener: not null A_Button_Group_Listener );
Removes a button group listener from the listener list. If 'listener' isn't already listening then nothing happens.

Set_Keep_Selected

procedure Set_Keep_Selected
( this: access Button_Group;
keep: Boolean );
Changes whether or not the active button in the group is allowed to be unselected. If 'keep' is set True then the active button on a tool group, once pressed, can't be unpressed.

Unset

procedure Unset
( this: access Button_Group;
force: Boolean := False );
Unpresses the active button in the group, if there is one. This will have no effect if the 'keep selected' option has been set unless 'force' is set True.

Delete

procedure Delete
( this: in out A_Button_Group );
Deletes the Button_Group.