MenuObject class | menusys.t[141]

A basic menu object. This is an abstract base class that encapsulates some behavior common to different menu classes, and allows the use of the + syntax (like "+ MenuItem") to define containment.

`class MenuObject : object`

Superclass Tree (in declaration order)

`MenuObject`
`object`

Subclass Tree

`MenuObject`
`MenuItem`
`HintMenu`
`TopHintMenu`
`MenuLongTopicItem`
`HintLongTopicItem`
`MenuTopicItem`
`Goal`

Global Objects

(none)

Summary of Properties

`contents menuOrder`

Summary of Methods

`addToContents compareForMenuSort execute initializeContents initializeLocation`

Properties

`contents` | `menusys.t[143]`

our contents list

`menuOrder` | `menusys.t[204]`

The menu order. When we're about to show a list of menu items, we'll sort the list in ascending order of this property, then in ascending order of title. By default, we set this order value to be equal to the menu item's sourceTextOrder. This makes the menu order default to the order of objects as defined in the source. If some other basis is desired, override topicOrder.

Methods

`addToContents (obj)` | `menusys.t[156]`

add a menu item

`compareForMenuSort (other)` | `menusys.t[215]`

Compare this menu object to another, for the purposes of sorting a list of menu items. Returns a positive number if this menu item sorts after the other one, a negative number if this menu item sorts before the other one, 0 if the relative order is arbitrary.

By default, we'll sort by menuOrder if the menuOrder values are different, otherwise arbitrarily.

`execute ( )` | `menusys.t[255]`

This preinit object makes sure the MenuObjects all have their contents initialized properly.

`initializeContents ( )` | `menusys.t[242]`

Finish initializing our contents list. This will be called on each MenuObject *after* we've called initializeLocation() on every object. In other words, every menu will already have been added to its parent's contents; this can do anything else that's needed to initialize the contents list. For example, some subclasses might want to sort their contents here, so that they list their menus in a defined order. By default, we sort the menu items by menuOrder; subclasses can override this as needed.

`initializeLocation ( )` | `menusys.t[149]`

Since we're inheriting from object, but need to use the "+" syntax, we need to set up the contents appropriately

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3