enum { kMenuAttrExcludesMarkColumn = (1 << 0), kMenuAttrAutoDisable = (1 << 2) };
attributes
Name Description kMenuAttrExcludesMarkColumn No column space is allocated for the mark character when this menu is drawn. kMenuAttrAutoDisable The menu title is automatically disabled when all items are disabled.
enum { kMenuItemAttrDisabled = (1 << 0), kMenuItemAttrIconDisabled = (1 << 1), kMenuItemAttrSubmenuParentChoosable = (1 << 2), kMenuItemAttrDynamic = (1 << 3), kMenuItemAttrNotPreviousAlternate = (1 << 4), kMenuItemAttrHidden = (1 << 5), kMenuItemAttrSeparator = (1 << 6), kMenuItemAttrSectionHeader = (1 << 7), kMenuItemAttrIgnoreMeta = (1 << 8), kMenuItemAttrAutoRepeat = (1 << 9) };
item attributes
Name Description kMenuItemAttrDisabled This item is disabled. kMenuItemAttrIconDisabled This item's icon is disabled. kMenuItemAttrSubmenuParentChoosable Allows the parent item of a submenu to be selectable. kMenuItemAttrDynamic This item changes dynamically based on modifier key state. kMenuItemAttrNotPreviousAlternate This item is not part of the same dynamic group as the previous item. kMenuItemAttrHidden This item is not drawn when the menu is displayed. kMenuItemAttrSeparator This item is a separator; the text of the item is ignored kMenuItemAttrSectionHeader This item is a menu section header; it is disabled and unselectable kMenuItemAttrIgnoreMeta Metacharacters in the text of this item (such as the dash) are ignored kMenuItemAttrAutoRepeat This item is recognized by MenuEvent and IsMenuKeyEvent when they are passed an auto-repeat keyboard event.
typedef UInt32 MenuTrackingMode; enum { kMenuTrackingModeMouse = 1, kMenuTrackingModeKeyboard = 2 };
tracking modes
Name Description kMenuTrackingModeMouse Menus are being tracked using the mouse. kMenuTrackingModeKeyboard Menus are being tracked using the keyboard.
enum { kMenuEventIncludeDisabledItems = 0x0001, kMenuEventQueryOnly = 0x0002, kMenuEventDontCheckSubmenus = 0x0004 };
event options
Name Description kMenuEventIncludeDisabledItems Disabled items are examined for a match. kMenuEventQueryOnly Don't hilite the menu title if a match is found. kMenuEventDontCheckSubmenus Don't look for a match in submenus of the starting menu.
enum { kMenuItemDataText = (1 << 0), kMenuItemDataMark = (1 << 1), kMenuItemDataCmdKey = (1 << 2), kMenuItemDataCmdKeyGlyph = (1 << 3), kMenuItemDataCmdKeyModifiers = (1 << 4), kMenuItemDataStyle = (1 << 5), kMenuItemDataEnabled = (1 << 6), kMenuItemDataIconEnabled = (1 << 7), kMenuItemDataIconID = (1 << 8), kMenuItemDataIconHandle = (1 << 9), kMenuItemDataCommandID = (1 << 10), kMenuItemDataTextEncoding = (1 << 11), kMenuItemDataSubmenuID = (1 << 12), kMenuItemDataSubmenuHandle = (1 << 13), kMenuItemDataFontID = (1 << 14), kMenuItemDataRefcon = (1 << 15), kMenuItemDataAttributes = (1 << 16), kMenuItemDataCFString = (1 << 17), kMenuItemDataProperties = (1 << 18), kMenuItemDataIndent = (1 << 19), kMenuItemDataAllDataVersionOne = 0x000FFFFF };
item data flags
Name Description kMenuItemDataText Set or return the Str255 text of a menu using the MenuItemDataRec.text field. If getting the text, the text field must be initialized with a pointer to a Str255 variable before calling CopyMenuItemData. If both kMenuItemDataText and kMenuItemCFString are set on entry to CopyMenuItemData, the API will determine whether the menu text was most recently set using a Str255 or CFString, and return only that text format; the flags value for the other format will be cleared. Valid for both menu items and the menu title (if item number is 0). kMenuItemDataMark Set or return the mark character of a menu item using the MenuItemDataRec.mark field. Valid only for menu items. kMenuItemDataCmdKey Set or return the command key of a menu item using the MenuItemDataRec.cmdKey field. Valid only for menu items. kMenuItemDataCmdKeyGlyph Set or return the command key glyph of a menu item using the MenuItemDataRec.cmdKeyGlyph field. Valid only for menu items. kMenuItemDataCmdKeyModifiers Set or return the command key modifiers of a menu item using the MenuItemDataRec.cmdKeyModifiers field. Valid only for menu items. kMenuItemDataStyle Set or return the QuickDraw text style of a menu item using the MenuItemDataRec.style field. Valid only for menu items. kMenuItemDataEnabled Set or return the enable state of a menu using the MenuItemDataRec.enabled field. Valid for both menu items and the menu itself (if item number is 0). kMenuItemDataIconEnabled Set or return the enable state of a menu item icon using the MenuItemDataRec.iconEnabled field. Valid only for menu items. kMenuItemDataIconID Set or return the icon resource ID of a menu item using the MenuItemDataRec.iconID field. Valid only for menu items. kMenuItemDataIconHandle Set or return the icon handle of a menu item using the MenuItemDataRec.iconType and MenuItemDataRec.iconHandle fields. Both fields must be initialized if setting the icon handle; both fields will be returned when getting the handle. The iconType field should contain one of the constants kMenuIconType, kMenuShrinkIconType, kMenuSmallIconType, kMenuColorIconType, kMenuIconSuiteType, or kMenuIconRefType. An icon handle may be a handle to an ICON resource, a SICN resource, a cicn resource, an IconSuite, or an IconRef. Valid only for menu items. kMenuItemDataCommandID Set or return the command ID of a menu item using the MenuItemDataRec.cmdID field. Valid only for menu items. kMenuItemDataTextEncoding Set or return the text encoding of a menu item using the MenuItemDataRec.encoding field. Valid only for menu items. kMenuItemSubmenuID Set or return the menu ID of a item's submenu using the MenuItemDataRec.submenuID field. Valid only for menu items. kMenuItemSubmenuHandle Set or return the menu handle of an item's submenu using the MenuItemDataRec.submenuHandle field. Valid only for menu items. kMenuItemFontID Set or return the QuickDraw font ID of a menu item using the MenuItemDataRec.fontID field. Valid only for menu items. kMenuItemRefcon Set or return the refcon of a menu using the MenuItemDataRec.refcon field. Valid for both menu items and the menu itself (if item number is 0). kMenuItemAttributes Set or return the attributes of a menu using the MenuItemDataRec.attr field. Valid for both menu items, in which case the attr field should contain values from the MenuItemAttributes enumeration, and for the menu itself (if item number is 0), in which case the attr field should contain values from the MenuAttributes enumeration. kMenuItemCFString Set or return the CFString text of a menu using the MenuItemDataRec.cfText field. If setting the CFString text, the Menu Manager increments the refcount of the text; the caller may safely release the text after setting it. If getting the CFString text, the caller receives a copy of the text owned by the Menu Manager; modifications on the text by the caller will have no effect on the text of the menu, and the caller should release the text when finished with it. If both kMenuItemDataText and kMenuItemCFString are set on entry to CopyMenuItemData, the API will determine whether the menu text was most recently set using a Str255 or CFString, and return only that text format; the flags value for the other format will be cleared. Valid for both menu items and the menu title (if item number is 0). kMenuItemDataProperties Set or return the properties of a menu using the MenuItemDataRec.properties field. If setting the properties, the properties field should contain a collection with the new properties; existing menu properties with the same collection creator and tag will be replaced by the new properties. If getting the properties, the properties field should either be set to NULL or to a valid Collection. If NULL, a new collection is allocated by the CopyMenuItemData and returned in the properties field. If not NULL, the entire contents of the collection are replaced by the properties of the menu. Valid for both menu items and the menu itself (if item number is 0). kMenuItemDataIndent Set or return the item indent level of a menu item using the MenuItemDataRec.indent field. Valid only for menu items.
© 2000 Apple Computer, Inc. (Last Updated 7/21/2000)