Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSBoxMBS class.

NSBoxMBS.borderColor as NSColorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the color of the receiver's border when the receiver is a custom box with a simple line border.

The receiver's border color. It must be a custom box—that is, it has a type of NSBoxCustom—and it must have a border style of NSLineBorder.

Available in Mac OS X v10.5 and later.
(Read and Write computed property)

NSBoxMBS.borderRect as NSRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the rectangle in which the receiver's border is drawn.

The rectangle in which the border of the NSBox is drawn.

NSBoxMBS.borderType as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The border type to aType, which must be a valid border type.

A constant describing the type of border. Border types are defined in NSView.h. Currently, the following border types are defined: NSNoBorder, NSLineBorder, NSBezelBorder, NSGrooveBorder.

If the size of the new border is different from that of the old border, the content view is resized to absorb the difference, and the box is marked for redisplay.
(Read and Write computed property)

NSBoxMBS.borderWidth as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The border width.

Functional only when the receiver's box type (boxType) is NSBoxCustom and its border type (borderType) is NSLineBorder.

Available in Mac OS X v10.5 and later.
(Read and Write computed property)

NSBoxMBS.boxType as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The box type.

Use the NSBox* constants.
(Read and Write computed property)

NSBoxMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new box view with size 100/100 and position 0/0
Example
dim x as new NSBoxMBS

On success the handle property is not zero.

See also:

NSBoxMBS.Constructor(Handle as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates an object based on the given NSView handle.
Example
dim t as new NSBoxMBS(0, 0, 100, 100)
dim v as new NSBoxMBS(t.handle)

MsgBox str(v.Bounds.Width)+" x "+str(v.Bounds.Height)

The handle is casted to a NSBox and the plugin retains this handle.

See also:

NSBoxMBS.Constructor(left as Double, top as Double, width as Double, height as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new control with the given size and position.
Example
dim left,top,width,height as Integer
// define rectangle
dim x as new NSBoxMBS(left, top, width, height)

On success the handle property is not zero.

See also:

NSBoxMBS.contentView as NSViewMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The receiver's content view.

On settings the NSView object is resized to fit within the box's current content area and the box is marked for redisplay.
(Read and Write computed property)

NSBoxMBS.contentViewMargins as NSSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The horizontal and vertical distance between the border of the receiver and its content view.

Value: The width and height of the offset between the box's border and content view. The horizontal value is applied (reckoned in the box's coordinate system) fully and equally to the left and right sides of the box. The vertical value is similarly applied to the top and bottom.

Unlike changing a box's other attributes, such as its title position or border type, changing the offsets doesn't automatically resize the content view. In general, you should send a sizeToFit message to the box after changing the size of its offsets. This message causes the content view to remain unchanged while the box is sized to fit around it.
(Read and Write computed property)

NSBoxMBS.cornerRadius as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The corner radius for the box.

Functional only when the receiver's box type (boxType) is NSBoxCustom and its border type (borderType) is NSLineBorder.
(Read and Write computed property)

NSBoxMBS.fillColor as NSColorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The color of the receiver's background when the receiver is a custom box with a simple line border.

The receiver's fill color. It must be a custom box—that is, it has a type of NSBoxCustom—and it must have a border style of NSLineBorder.
Available in Mac OS X v10.5 and later.
(Read and Write computed property)

NSBoxMBS.setFrameFromContentFrame(contentFrame as NSRectMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Places the receiver so its content view lies on the specified frame.

contentFrame: The rectangle specifying the frame of the box's content view, reckoned in the coordinate system of the box's superview. The box is marked for redisplay.

NSBoxMBS.setTitleWithMnemonic(stringWithAmpersand as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the title of the receiver with a character denoted as an access key.

Mnemonics are not supported in Mac OS X.

By default, a box's title is "Title." The content view is not automatically resized, and the box is not marked for redisplay.

NSBoxMBS.sizeToFit

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Resizes and moves the receiver's content view so it just encloses its subviews.
Example
dim n as new NSProgressIndicatorMBS
n.sizeToFit

MsgBox n.frame.String

The receiver is then moved and resized to wrap around the content view. The receiver's width is constrained so its title will be fully displayed.

You should invoke this method after:

  • Adding a subview (to the content view)
  • Altering the size or location of such a subview
  • Setting the margins around the content view

The mechanism by which the content view is moved and resized depends on whether the object responds to its own sizeToFit message: If it does respond, then that message is sent, and the content view is expected to be so modified. If the content view doesn't respond, the box moves and resizes the content view itself.

NSBoxMBS.title as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The title for the box.

By default, a box's title is "Title."
(Read and Write computed property)

NSBoxMBS.titleCell as NSCellMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the cell used to display the receiver's title.

NSBoxMBS.titleFont as NSFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The font object used to draw the receiver's title.

By default, the title is drawn using the small system font (obtained using (smallSystemFontSize as the parameter of systemFontOfSize:, both NSFont class methods). If the size of the new font is different from that of the old font, the content view is resized to absorb the difference.
(Read and Write computed property)

NSBoxMBS.titlePosition as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The position of the box's title.

If the new title position changes the size of the box's border area, the content view is resized to absorb the difference, and the box is marked as needing redisplay.

Use this constants: NSNoTitle, NSAboveTop, NSAtTop, NSBelowTop, NSAboveBottom, NSAtBottom and NSBelowBottom.
(Read and Write computed property)

NSBoxMBS.titleRect as NSRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the rectangle in which the receiver's title is drawn.

The rectangle in which the title is drawn.

NSBoxMBS.Transparent as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether the receiver is transparent.

True makes the receiver transparent.
False makes the receiver opaque.
(Read and Write computed property)

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


The biggest plugin in space...