Enumerations



Menu

enum  {
  kMenuAttrExcludesMarkColumn  =  (1  <<  0),
  kMenuAttrAutoDisable  =  (1  <<  2)
};

attributes

Constants

NameDescription
kMenuAttrExcludesMarkColumnNo column space is allocated for the mark character when this menu is drawn.
kMenuAttrAutoDisableThe menu title is automatically disabled when all items are disabled.

Menu

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

Constants

NameDescription
kMenuItemAttrDisabledThis item is disabled.
kMenuItemAttrIconDisabledThis item's icon is disabled.
kMenuItemAttrSubmenuParentChoosableAllows the parent item of a submenu to be selectable.
kMenuItemAttrDynamicThis item changes dynamically based on modifier key state.
kMenuItemAttrNotPreviousAlternateThis item is not part of the same dynamic group as the previous item.
kMenuItemAttrHiddenThis item is not drawn when the menu is displayed.
kMenuItemAttrSeparatorThis item is a separator; the text of the item is ignored
kMenuItemAttrSectionHeaderThis item is a menu section header; it is disabled and unselectable
kMenuItemAttrIgnoreMetaMetacharacters in the text of this item (such as the dash) are ignored
kMenuItemAttrAutoRepeatThis item is recognized by MenuEvent and IsMenuKeyEvent when they are passed an auto-repeat keyboard event.

Menu

typedef  UInt32  MenuTrackingMode;
enum  {
  kMenuTrackingModeMouse  =  1,
  kMenuTrackingModeKeyboard  =  2
};

tracking modes

Constants

NameDescription
kMenuTrackingModeMouseMenus are being tracked using the mouse.
kMenuTrackingModeKeyboardMenus are being tracked using the keyboard.

Menu

enum  {
  kMenuEventIncludeDisabledItems  =  0x0001,
  kMenuEventQueryOnly  =  0x0002,
  kMenuEventDontCheckSubmenus  =  0x0004
};

event options

Constants

NameDescription
kMenuEventIncludeDisabledItemsDisabled items are examined for a match.
kMenuEventQueryOnlyDon't hilite the menu title if a match is found.
kMenuEventDontCheckSubmenusDon't look for a match in submenus of the starting menu.

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

Constants

NameDescription
kMenuItemDataTextSet 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).
kMenuItemDataMarkSet or return the mark character of a menu item using the MenuItemDataRec.mark field. Valid only for menu items.
kMenuItemDataCmdKeySet or return the command key of a menu item using the MenuItemDataRec.cmdKey field. Valid only for menu items.
kMenuItemDataCmdKeyGlyphSet or return the command key glyph of a menu item using the MenuItemDataRec.cmdKeyGlyph field. Valid only for menu items.
kMenuItemDataCmdKeyModifiersSet or return the command key modifiers of a menu item using the MenuItemDataRec.cmdKeyModifiers field. Valid only for menu items.
kMenuItemDataStyleSet or return the QuickDraw text style of a menu item using the MenuItemDataRec.style field. Valid only for menu items.
kMenuItemDataEnabledSet 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).
kMenuItemDataIconEnabledSet or return the enable state of a menu item icon using the MenuItemDataRec.iconEnabled field. Valid only for menu items.
kMenuItemDataIconIDSet or return the icon resource ID of a menu item using the MenuItemDataRec.iconID field. Valid only for menu items.
kMenuItemDataIconHandleSet 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.
kMenuItemDataCommandIDSet or return the command ID of a menu item using the MenuItemDataRec.cmdID field. Valid only for menu items.
kMenuItemDataTextEncodingSet or return the text encoding of a menu item using the MenuItemDataRec.encoding field. Valid only for menu items.
kMenuItemSubmenuIDSet or return the menu ID of a item's submenu using the MenuItemDataRec.submenuID field. Valid only for menu items.
kMenuItemSubmenuHandleSet or return the menu handle of an item's submenu using the MenuItemDataRec.submenuHandle field. Valid only for menu items.
kMenuItemFontIDSet or return the QuickDraw font ID of a menu item using the MenuItemDataRec.fontID field. Valid only for menu items.
kMenuItemRefconSet 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).
kMenuItemAttributesSet 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.
kMenuItemCFStringSet 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).
kMenuItemDataPropertiesSet 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).
kMenuItemDataIndentSet 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)