Class Documentation

Name:Menu
Version:1.0
ID:ID_MENU
Status:Beta
Category:GUI
Date:January 2004
Author:Rocklyte Systems
Copyright:  Rocklyte Systems (c) 2002-2004. All rights reserved.
Short:  The Menu class is used to construct menus from XML files.



Actions

The Menu class supports the following actions:

Activate  Displays the menu.
Focus  Sends the focus to the menu and activates keyboard monitoring.
Hide  Hides the menu and open sub-menus.
LostFocus  Removes the focus from the menu and deactivates keyboard monitoring.
Refresh  Refreshes a menu from its source file.
SetUnlistedField  Arguments can be passed to a menu configuration file as unlisted fields.
Show  Shows the menu.

Methods

The Menu class implements the following methods:

ExecuteItem  Executes the currently selected menu item.

Structure

The Menu object consists of the following public fields:

FontColour  Sets the default font colour for menu items.
FontHighlight  Sets the default font colour for highlighted menu items.
Location  Identifies the location of a menu configuration file to load.
MenuFile  ...
Node  The node that you wish to use for building a menu from its file source.
Relative  The drawable that the menu should be offset from on the display.
SelectionField  This field is used in conjunction with the SelectionObject field.
SelectionObject  If the menu object should send user selections to another object, set this field.
Width  A fixed menu width can be applied by setting this field.
XCoord  The horizontal position of the menu.
YCoord  The vertical position of the menu.
Field:FontColour
Short:Sets the default font colour for menu items.
Type:STRING
Status:Set

Field:FontHighlight
Short:Sets the default font colour for highlighted menu items.
Type:STRING
Status:Set

Field:Location
Synonyms:Src
Short:Identifies the location of a menu configuration file to load.
Type:STRING
Status:Get/Set

Field:MenuFile
Short:...
Type:STRING
Status:Set

Field:Node
Short:The node that you wish to use for building a menu from its file source.
Type:STRING
Status:Get/Set

Field:Relative
Short:The drawable that the menu should be offset from on the display.
Type:OBJECTID
Status:Read/Write

Field:SelectionField
Short:This field is used in conjunction with the SelectionObject field.
Type:STRING
Status:Set

This field needs to be set in conjunction with the SelectionObject field - please refer to it for more detail.


Field:SelectionObject
Short:If the menu object should send user selections to another object, set this field.
Type:OBJECTID
Status:Read/Write

When the user selects a menu item, you can send the entered data to the field of another object. In order to do this, you need to point to that object through the SelectionObject field and specify the destination field name by setting the SelectionField string. So long as both fields are set correctly, the destination object will always reflect the last item selected from the menu object.


Field:Width
Short:A fixed menu width can be applied by setting this field.
Type:LONG
Status:Set

To set a precalculated width against a menu, set this field. By default this field is normally set to zero, which results in the Menu class calculating the menu width automatically. You should only set this field under special circumstances. The ComboBox class is known to set the menu width so that drop-down menus match the width of ComboBox objects.


Field:XCoord
Short:The horizontal position of the menu.
Type:LONG
Status:Set

The horizontal position of the menu can be set through this field. If the Relative field is set, the coordinate will be used as an offset from the position of the Relative drawable.


Field:YCoord
Short:The vertical position of the menu.
Type:LONG
Status:Set

The vertical position of the menu can be set through this field. If the Relative field is set, the coordinate will be used as an offset from the position of the Relative drawable.