Platforms to show: All Mac Windows Linux Cross-Platform
NSButtonCellMBS class
Super class: NSActionCellMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa Controls | MBS MacCocoa Plugin | 14.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
It can also be used for any other region of a view that's designed to send a message to a target when clicked. The NSButtonMBS subclass of NSControlMBS uses a single NSButtonCellMBS.
The NSButtonCell class implements the user interface of NSButton.
Setting the integer, float, double, or object value of an NSButtonCell object results in a call to setState with the value converted to integer. In the case of setObjectValue, nil is equivalent to 0, and a non-nil object that doesn't respond to intValue sets the state to 1. Otherwise, the state is set to the object's intValue. Similarly, querying the integer, float, double, or object value of an NSButtonCell returns the current state in the requested representation. In the case of objectValue, this is an NSNumber containing true for on, false for off, and integer value -1 for the mixed state.
For more information on the behavior of NSButtonCell, see the NSButton and NSMatrix class specifications, and Button Programming Topics.
Subclass of the NSActionCellMBS class.
- 10 properties
- property alternateImage as NSImageMBS
- property alternateTitle as String
- property attributedAlternateTitle as NSAttributedStringMBS
- property attributedTitle as NSAttributedStringMBS
- property backgroundColor as NSColorMBS
- property imageDimsWhenDisabled as Boolean
- property imagePosition as Integer
- property imageScaling as Integer
- property showsBorderOnlyWhileMouseInside as Boolean
- property sound as Variant
- 2 methods
- method Constructor(image as NSImageMBS)
- method Constructor(text as string)
- 13 constants
Bezel Styles
Constant | Value | Description |
---|---|---|
BezelStyleAccessoryBar | 13 |
A bezel style that is suitable for accessory and scope bars. This style is typically used for buttons with togglable state. |
BezelStyleAccessoryBarAction | 12 |
A bezel style that is suitable for accessory and scope bars. This style is typically used for buttons that perform an action or for pop-up buttons. |
BezelStyleAutomatic | 0 |
The appearance of this bezel style is automatically determined based on the button's contents and position within the window. This bezel style is the default for all button initializers. |
BezelStyleBadge | 15 |
A bezel style that is typically used in table rows to display information about the row, such as a count. |
BezelStyleCircular | 7 |
A button with a circular bezel suitable for a small icon or single character. |
BezelStyleDisclosure | 5 |
An unbezeled button with a disclosure triangle. |
BezelStyleFlexiblePush | 2 |
A flexible-height variant of NSBezelStylePush. |
BezelStyleGlass | 16 |
A bezel style with a glass effect. For macOS 26 or newer. Example |
BezelStyleHelpButton | 9 |
A circular button with a question mark providing the standard Help button appearance. |
BezelStylePush | 1 |
The standard system push button style. |
BezelStylePushDisclosure | 14 |
A bezeled variant of NSBezelStyleDisclosure. |
BezelStyleSmallSquare | 10 |
A button with squared edges and flexible height. |
BezelStyleToolbar | 11 |
A button style that is appropriate for use in a toolbar item. |
Super class NSActionCellMBS
- 2 methods
- method Constructor(image as NSImageMBS)
- method Constructor(text as string)
Super class NSCellMBS
- 49 properties
- property alignment as Integer
- property allowsEditingTextAttributes as boolean
- property allowsMixedState as boolean
- property allowsUndo as boolean
- property attributedStringValue as NSAttributedStringMBS
- property backgroundStyle as Integer
- property baseWritingDirection as Integer
- property Bezeled as boolean
- property Bordered as boolean
- property className as string
- property classPath as string
- property Continuous as boolean
- property controlSize as Integer
- property controlTint as Integer
- property controlView as NSViewMBS
- property doubleValue as Double
- property Editable as boolean
- property Enabled as boolean
- property floatValue as Double
- property font as NSFontMBS
- property Handle as Integer
- property hasValidObjectValue as boolean
- property Highlighted as boolean
- property Identifier as String
- property image as NSImageMBS
- property importsGraphics as boolean
- property interiorBackgroundStyle as Integer
- property intValue as Integer
- property isOpaque as boolean
- property keyEquivalent as string
- property lineBreakMode as Integer
- property menu as NSMenuMBS
- property mnemonicLocation as Integer
- property refusesFirstResponder as boolean
- property Scrollable as boolean
- property Selectable as boolean
- property sendsActionOnEndEditing as boolean
- property showsFirstResponder as boolean
- property state as Integer
- property stringValue as string
- property tag as Integer
- property title as string
- property truncatesLastVisibleLine as boolean
- property type as Integer
- property userInterfaceLayoutDirection as Integer
- property usesSingleLineMode as boolean
- property wraps as boolean
- property cellAttribute(aParameter as Integer) as Integer
- property focusRingType as Integer
- 19 methods
- method acceptsFirstResponder as boolean
- method calcDrawInfo(theRect as NSRectMBS)
- method cellSize as NSSizeMBS
- method cellSizeForBounds(theRect as NSRectMBS) as NSSizeMBS
- method compare(otherCell as NSCellMBS) as Integer
- method Constructor(image as NSImageMBS)
- method Constructor(text as string)
- method drawingRectForBounds(theRect as NSRectMBS) as NSRectMBS
- method highlightColorWithFrame(theRect as NSRectMBS, controlView as NSViewMBS) as NSColorMBS
- method imageRectForBounds(theRect as NSRectMBS) as NSRectMBS
- method isEntryAcceptable(aString as string) as boolean
- method mnemonic as string
- method nextState as Integer
- method performClick
- method sendActionOn(mask as Integer) as Integer
- method setNextState
- method setTitleWithMnemonic(stringWithAmpersand as string)
- method titleRectForBounds(theRect as NSRectMBS) as NSRectMBS
- method wantsNotificationForMarkedText as boolean
- 3 shared methods
- shared method defaultFocusRingType as Integer
- shared method defaultMenu as NSMenuMBS
- shared method prefersTrackingUntilMouseUp as boolean
- 61 constants
Sub classes:
Blog Entries
- MBS Xojo Plugins, version 25.3pr3
- MBS Xojo / Real Studio Plugins, version 14.2pr8
- MonkeyBread Software Releases the MBS Xojo / Real Studio plug-ins in version 14.0
- MBS Xojo / Real Studio Plugins, version 14.0pr6
Xojo Developer Magazine
Release notes
- Version 25.3
- Added constants to NSButtonCellMBS class.
Some properties using for this class:
- NSSearchFieldCellMBS.cancelButtonCell as NSButtonCellMBS
- NSSearchFieldCellMBS.searchButtonCell as NSButtonCellMBS
Some examples using this class:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
Some related classes:
- class Database
- class NSAttributedStringMBS
- class NSButtonMBS
- class NSCellMBS
- class NSColorMBS
- class NSControlMBS
- class NSImageMBS
- class NSMenuItemCellMBS
- class NSPopUpButtonCellMBS
- class NSViewMBS
The items on this page are in the following plugins: MBS MacCocoa Plugin.
