Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

NSMenuItemMBS.ActionSelector as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Returns the name of the objective-c method called for this menu event.
Notes:
You can use this to find menu items by their selector. Which is often more save than by index or title.
(Read only property)

Feedback, Comments & Corrections

NSMenuItemMBS.Alternate as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: Whether this menu item is an alternate to the previous menu item.
Notes:
Available in Mac OS X v10.3 and later.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.attributedTitle as NSAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: Specifies a custom string for a menu item.
Notes:
You can use this method to add styled text and embedded images to menu item strings. If you do not set a text color for the attributed string, it is black when not selected, white when selected, and gray when disabled. Colored text remains unchanged when selected.

When you call this method to set the menu title to an attributed string, the setTitle: method is also called to set the menu title with a plain string. If you clear the attributed title, the plain title remains unchanged.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.Enabled as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: Whether this menuitem is enabled.
Notes: (Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.Handle as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The reference to the NSMenuItem object used internally.
Notes: (Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.hasSubmenu as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: Returns true if the menuitem has a submenu, false if it doesn't.
Notes: (Read only property)

Feedback, Comments & Corrections

NSMenuItemMBS.image as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The image displayed by the menuitem, or nil if it displays no image.
Notes: (Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.indentationLevel as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The menu item indentation level for the menu item.
Notes:
The value will be from 0 to 15. The default indentation level is 0.
Available in Mac OS X v10.3 and later.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.isHidden as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.7 Yes No No Yes, macOS only No
Function: Returns a Boolean value that indicates whether the menuitem is hidden.
Notes:
Mac OS X 10.5 only.
Returns true if the receiver is hidden, otherwise false.
This value can be set to hide or show a menuitem.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.isHiddenOrHasHiddenAncestor as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.7 Yes No No Yes, macOS only No
Function: Returns a Boolean value that indicates whether the menuitem or any of its superitems is hidden.
Notes:
Mac OS X 10.5 only.
Returns true if the receiver or any of its superitems is hidden, otherwise false.
(Read only property)

Feedback, Comments & Corrections

NSMenuItemMBS.isHighlighted as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.7 Yes No No Yes, macOS only No
Function: Returns a Boolean value that indicates whether the receiver should be drawn highlighted.
Notes:
Returns true if the receiver should be drawn highlighted, otherwise false.
Mac OS X 10.5 only.
(Read only property)

Feedback, Comments & Corrections

NSMenuItemMBS.isSeparatorItem as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: Returns whether the receiver is a separator item (that is, a menu item used to visually segregate related menu items).
Notes: (Read only property)

Feedback, Comments & Corrections

NSMenuItemMBS.keyEquivalent as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The receiver's unmodified keyboard equivalent, or the empty string if one hasn't been defined.
Example:
dim m as new NSMenuItemMBS
m.CreateMenuItem "Hello"
m.keyEquivalent = "a" // A
m.keyEquivalent = "A" // shift-A
Notes:
Use keyEquivalentModifierMask to determine the modifier mask for the key equivalent. In the current implementation "A" can be interpreted as Shift-A by the system even without the shift in the mask.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.keyEquivalentModifierMask as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: the menu item's keyboard equivalent modifier mask.
Example:
const NSShiftKeyMask=131072
const NSControlKeyMask=262144
const NSAlternateKeyMask=524288
const NSCommandKeyMask=1048576

dim d as new NSMenuItemMBS
d.CreateMenuItem "Last menu entry",""
d.Enabled=true
d.KeyEquivalent="A"
d.KeyEquivalentModifierMask=NSShiftKeyMask+NSCommandKeyMask+NSAlternateKeyMask // command-option-shift
Notes:
Constants for the mask:

NSAlphaShiftKeyMask = 65536
Set if Caps Lock key is pressed.
Available in Mac OS X v10.0 and later.

NSShiftKeyMask = 131072
Set if Shift key is pressed.
Available in Mac OS X v10.0 and later.

NSControlKeyMask = 262144
Set if Control key is pressed.
Available in Mac OS X v10.0 and later.

NSAlternateKeyMask = 524288
Set if Option or Alternate key is pressed.
Available in Mac OS X v10.0 and later.

NSCommandKeyMask = 1048576
Set if Command key is pressed.
Available in Mac OS X v10.0 and later.

NSNumericPadKeyMask = 2097152
Set if any key in the numeric keypad is pressed. The numeric keypad is generally on the right side of the keyboard. This is also set if any of the arrow keys are pressed (NSUpArrowFunctionKey, NSDownArrowFunctionKey, NSLeftArrowFunctionKey, and NSRightArrowFunctionKey).
Available in Mac OS X v10.0 and later.

NSHelpKeyMask = 4194304
Set if the Help key is pressed.
Available in Mac OS X v10.0 and later.

NSFunctionKeyMask = 8388608
Set if any function key is pressed. The function keys include the F keys at the top of most keyboards (F1, F2, and so on) and the navigation keys in the center of most keyboards (Help, Forward Delete, Home, End, Page Up, Page Down, and the arrow keys).
Available in Mac OS X v10.0 and later.

NSDeviceIndependentModifierFlagsMask = 16777216
Used to retrieve only the device-independent modifier flags, allowing applications to mask off the device-dependent modifier flags, including event coalescing information.
Available in Mac OS X v10.4.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.menu as NSMenuMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The menu where this menu item is inside.
Notes:
nil if no menu belongs to this menuitem.
(Read only property)

Feedback, Comments & Corrections

NSMenuItemMBS.mixedStateImage as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The image used to depict a "mixed state."
Notes:
A mixed state is useful for indicating "off" and "on" attribute values in a group of selected objects, such as a selection of text containing bold and plain (nonbolded) words.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.offStateImage as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The image used to depict the receiver's "off" state, or nil if the image has not been set.
Notes:
By default, there is no off state image.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.onStateImage as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The image of the receiver that indicates an "on" state.
Notes:
The Image object to use for the "on" state of the menu item. If itemImage is nil, any current on-state image is removed.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.parentItem as NSMenuItemMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Returns the menu item whose submenu contains the receiver.
Notes:
Returns the parent menu item, or nil if the receiver does not have a parent item.
Available in Mac OS X v10.6 and later.
(Read only property)

Feedback, Comments & Corrections

NSMenuItemMBS.state as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The state of the menuitem.
Notes:
An integer constant representing a state; it should be one of NSOffState, NSOnState, or NSMixedState.
Same as Checked property on Real Studio's menu items.

Constants:
NSMixedState = -1The corresponding feature is in effect somewhere.
NSOffState = 0The corresponding feature is in effect nowhere.
NSOnState = 1The corresponding feature is in effect everywhere.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.submenu as NSMenuMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The submenu attached to this menuitem.
Notes:
nil if there is no submenu.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.tag as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The menu item tag value.
Notes:
You can use this value as you like.

If you need to store more custom data than just an integer, you should subclass the NSMenuItemMBS class and add properties as needed.
(Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.Title as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The title of the menu item.
Notes: (Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.toolTip as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The help tag for a menu item.
Notes: (Read and Write property)

Feedback, Comments & Corrections

NSMenuItemMBS.userKeyEquivalent as String
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 7.2 Yes No No Yes, macOS only No
Function: The user-assigned key equivalent for the menu item.
Notes: (Read only property)

Feedback, Comments & Corrections

NSMenuItemMBS.view as NSViewMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Cocoa Menus MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: The view to be used for this menuitem.
Notes:
Using a view you can draw whatever you like in the menu item.
You can set it to nil to remove the view.
Requires Mac OS X 10.5.
(Read and Write property)

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacBase Plugin.




Links
MBS Xojo PDF Plugins