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:

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 an action involving an item in a pulldown menu.

Menu_Item

type Menu_Item is new Widget 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)
On_Mouse_Release (overriding Widgets.On_Mouse_Release)
To_String (overriding Widgets.To_String)
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_Scroll (Inherited)
Widgets.On_Resize (Inherited)
Widgets.On_Rooted (Inherited)
Widgets.On_Shown (Inherited)
Widgets.Pack (Inherited)
Widgets.Set_Border (Inherited)
Widgets.Set_Color (Inherited)
Widgets.Set_Parent (Inherited)
Widgets.Set_Zoom (Inherited)
Widgets.Translate_To_Content (Inherited)
Widgets.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 (Actions.Action_Id)

Menu_Selected   : constant Action_Id;

Menu_Unselected (Actions.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.

Prepend_Listener

procedure Prepend_Listener
( this: not null access Menu_Item'Class;
listener: not null A_Menu_Listener );
Adds 'listener' to the front of the Menu_Action listener list.

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.