--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../../aros.css' --->
Menu.mui
MUIA_Menu_Enabled
Function
Store whether this object's generated menu entry is enabled. Default
TRUE. MUIA_Menu_Enabled and MUIA_Menuitem_Enabled address the same flag
in the shared implementation.
Inputs
BOOL; initialize, set, get.
Notes
The getter returns TRUE or FALSE. A disabled generated title receives
NM_MENUDISABLED; other generated entries receive NM_ITEMDISABLED. The
flag is not recursively copied to descendants. The setter requests an
application update when connected.
Bugs
OM_SET changes the supplied enabled tag's identifier to TAG_IGNORE
before forwarding the tag list to Notify. Consequently this tag does not
trigger normal Notify delivery, and the caller's tag list is modified.
MUIA_Menu_Title
Function
Store a borrowed title pointer, initially NULL. Menu_Title and
Menuitem_Title address the same field. The pointer becomes nm_Label when
this object is emitted into a NewMenu array.
Inputs
STRPTR; initialize, set, get.
Notes
Use a readable NUL-terminated label for an ordinary menu entry.
NM_BARLABEL denotes a separator at an item position. The class does not
copy or free the label. Keep its storage alive while the object or a
generated menu refers to it. Setting the title requests an application
update when connected.
Bugs
OM_SET rewrites the supplied title tag to TAG_IGNORE before Notify
processes the list. A title change therefore does not produce normal
Notify delivery for that tag, and the caller's tag list is changed.
MUIC_Menu
Superclass
Family.mui
Description
Represent a menu title with owned Menuitem children. This is a sibling
of Menuitem in the class hierarchy, not a subclass of it.
All three menu classes use the same attribute and method handlers and
derive directly from Family.mui. They differ by an internal type flag.
Family owns attached children and disposes of them; title and shortcut
strings remain borrowed. Enabled defaults to TRUE; Checked, Checkit,
CommandString, Toggle, and Exclude default to zero; title, shortcut,
trigger, and generated-menu pointers default to NULL.
A recognized menu-attribute set requests MUIM_Application_UpdateMenus
when the object has global info with an application pointer. That
request is synchronous and its result is ignored. Changes made before
connection are stored without requesting an application update. String
storage must remain valid while the object or any generated menu still
refers to it.
Methods
ConnectParent first obtains the parent's global info through Notify,
stores the parent pointer, and recursively connects every child to this
object. It returns TRUE. DisconnectParent recursively forwards the
message to children, clears this object's parent pointer, then calls the
superclass and returns TRUE. Global info remains borrowed and is not
cleared by Notify.
AddHead, AddTail, Insert, Remove, OM_ADDMEMBER, and OM_REMMEMBER forward
to Family and then request an application menu update when connected,
even if the operation returned failure. Their original return value is
preserved. Sort is inherited without an update request; Transfer invokes
the normal Remove and AddTail methods for its children. Serialize all
tree operations and do not mutate the traversal from callbacks.
Other methods and attributes follow Family and Notify. These classes add
no new public method identifiers.
Bugs
The three constructors do not check whether common superclass
construction returned NULL before writing their type flag. Allocation
failure or a NULL child that makes Family construction fail can
therefore cause invalid memory access instead of a clean NULL return. Do
not rely on the normal constructor-failure contract for these
implementations.