Index

Package: Menu_Items

Description

package Widgets.Menu_Items 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

Menu_Action

type Menu_Action is new Action with private;

Ancestors:

Primitive operations:

Adjust (Inherited)
Construct (Inherited)
Construct (Inherited)
Delete (Inherited)
Object_Read (Inherited)
Object_Write (Inherited)
To_String (Inherited)
Represents an action involving an item in a pulldown menu.

Menu_Item

type Menu_Item is new Widget with private;

Ancestors:

Primitive operations:

Activate_Popup (Inherited)
Bring_To_Front (Inherited)
Construct
Construct (Inherited)
Construct (Inherited)
Delete (Inherited)
Draw (Inherited)
Draw_Content (overriding Draw_Content)
Find_Widget_At (Inherited)
Get_Color (Inherited)
Get_Min_Height (overriding Get_Min_Height)
Get_Min_Width (overriding Get_Min_Width)
Get_Process_Name (Inherited)
Get_View (Inherited)
Get_Window (Inherited)
Handle_Blur (Inherited)
Handle_Click (Inherited)
Handle_Descendant_Shown (Inherited)
Handle_Disabled (Inherited)
Handle_Enabled (Inherited)
Handle_Enter (Inherited)
Handle_Exit (Inherited)
Handle_Focus (Inherited)
Handle_Key_Held (Inherited)
Handle_Key_Press (Inherited)
Handle_Key_Release (Inherited)
Handle_Mouse_Held (Inherited)
Handle_Mouse_Move (Inherited)
Handle_Mouse_Press (Inherited)
Handle_Mouse_Release (overriding Handle_Mouse_Release)
Handle_Mouse_Scroll (Inherited)
Handle_Resize (Inherited)
Handle_Rooted (Inherited)
Handle_Shown (Inherited)
Is_Rooted (Inherited)
Is_Showing (Inherited)
Pack (Inherited)
Set_Color (Inherited)
Set_Dirty (Inherited)
Set_Parent (Inherited)
Set_Zoom (Inherited)
To_String (overriding To_String)
Translate_To_Content (Inherited)
Translate_To_Window (Inherited)
A Menu_Item is a selection in a pulldown menu. Menu items can only be placed within a pulldown menu and they fire a Menu_Action when clicked.

Types

A_Menu_Action

type A_Menu_Action is access all Menu_Action'Class;

Menu_Listener (abstract)

type Menu_Listener is limited interface and Action_Listener;
This is the interface to implement in order to listen to menu actions. When a menu action occurs, the listener will be notified of the type of action performed and the menu item that performed the action.

A_Menu_Listener

type A_Menu_Listener is access all Menu_Listener'Class;

A_Menu_Item

type A_Menu_Item is access all Menu_Item'Class;

Constants & Global variables

Menu_Selected (Action_Id)

Menu_Selected   : constant Action_Id;

Menu_Unselected (Action_Id)

Menu_Unselected : constant Action_Id;
an item chosen/toggled on

Subprograms & Entries

Handle_Action (abstract)

procedure Handle_Action
( this: access Menu_Listener;
action: A_Menu_Action ) is abstract;
Handles 'action' from a menu item.

Create_Menu_Item

function Create_Menu_Item
( view: not null access Game_Views.Game_View'Class;
id: String;
text: String ) return A_Menu_Item;
Creates a new Menu_Item within 'view' with 'id'. 'text' is the text of the item in the menu.

Add_Listener

procedure Add_Listener
( this: not null access Menu_Item'Class;
listener: not null A_Menu_Listener );
Registers 'listener' as a receiver of menu actions originating from this menu item.

Remove_Listener

procedure Remove_Listener
( this: not null access Menu_Item'Class;
listener: not null A_Menu_Listener );
Removes 'listener' as a receiver of menu actions originating from this menu item.