Platforms to show: All Mac Windows Linux Cross-Platform

NSSegmentedControlMBS class

Super class: NSControlMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa Controls MBS MacCocoa Plugin 12.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The plugin class for a Cocoa NSSegmentedControl.

An NSSegmentedControl object implements a horizontal button made of multiple segments.

The NSSegmentedControl class uses an NSSegmentedCell class to implement much of the control's functionality. Most methods in NSSegmentedControl are simply "cover methods" that call the corresponding method in NSSegmentedCell. The methods of NSSegmentedCell that do not have covers relate to accessing and setting values for tags and tool tips; programatically setting the key segment; and establishing the mode of the control.

The features of a segmented control include:

  • Each segment can have an image, text (label), menu, tooltip, and tag
  • Either the whole control or individual segments can be enabled or disabled
  • There are three tracking modes for segments: select one mode (also known as radio button mode and illustrated by Finder's view mode selection control), momentary mode (as illustrated by Safari's toolbar buttons), or select any mode (where any combination of buttons may be on or off)
  • Each segment can be either a fixed width or autosized to fit the contents
  • If a segment has text and is marked as autosizing, then the text may be truncated so that the control completely fits
  • If an image is too large to fit in a segment, it is clipped
  • Full keyboard control of the user interface
Subclass of the NSControlMBS class.

Scaling Modes

Constant Value Description
NSImageScaleAxesIndependently 1 Scale each dimension to exactly fit destination.
This setting does not preserve the aspect ratio of the image.
Available in Mac OS X v10.5 and later.
NSImageScaleNone 2 Do not scale the image.
Available in Mac OS X v10.5 and later.
NSImageScaleProportionallyDown 0 If it is too large for the destination, scale the image down while preserving the aspect ratio.
Available in Mac OS X v10.5 and later.
NSImageScaleProportionallyUpOrDown 3 Scale the image to its maximum possible dimensions while both staying within the destination area and preserving its aspect ratio.
Available in Mac OS X v10.5 and later.

Style Constants

Constant Value Description
NSSegmentStyleAutomatic 0 The appearance of the segmented control is automatically determined based on the type of window in which the control is displayed and the position within the window. more
NSSegmentStyleRounded 1 The control is displayed using the rounded style.
Available in Mac OS X v10.5 and later.
NSSegmentStyleRoundRect 2 The control is displayed using the round rect style.
Available in Mac OS X v10.5 and later.
NSSegmentStyleSmallSquare 6 The control is displayed using the small square style.
Available in Mac OS X v10.5 and later.
NSSegmentStyleTexturedSquare 4 The control is displayed using the textured square style.
Available in Mac OS X v10.5 and later.

Constants for the Switch Tracking

Constant Value Description
NSSegmentSwitchTrackingMomentary 2 A segment is selected only when tracking.
NSSegmentSwitchTrackingMomentaryAccelerator 3 accelerator behavior, only selected while tracking.
NSSegmentSwitchTrackingSelectAny 1 Any segment can be selected.
NSSegmentSwitchTrackingSelectOne 0 Only one segment may be selected.

Super class NSControlMBS

Constants

Constant Value Description
ControlSizeLarge 3 One of the constants to specify a cell’s size. A size larger than the default control size.
ControlSizeMini 2 One of the constants to specify a cell’s size. The smallest control size.
ControlSizeRegular 0 One of the constants to specify a cell’s size. The default control size.
ControlSizeSmall 1 One of the constants to specify a cell’s size. A size smaller than the default control size. more

Super class NSViewMBS

Constants

Constant Value Description
NSBezelBorder 2 One of the constants to specify the type of a view's border. A concave border that makes the view look sunken.
NSFocusRingTypeDefault 0 One of the constants for the focusringtype property. The default focus ring type for NSView or NSCell.
NSFocusRingTypeExterior 2 One of the constants for the focusringtype property. The standard Aqua focus ring.
NSFocusRingTypeNone 1 One of the constants for the focusringtype property. No focus ring. If you set the focus ring type to this value, NSView and NSCell will not draw any focus ring.
NSGrooveBorder 3 One of the constants to specify the type of a view's border. A thin border that looks etched around the image.
NSLineBorder 1 One of the constants to specify the type of a view's border. A black line border around the view.
NSNoBorder 0 One of the constants to specify the type of a view's border. No border.
NSViewHeightSizable 16 One of the constants for the autoresizingMask property. The receiver's height is flexible.
NSViewLayerContentsRedrawBeforeViewResize 3 One of the view layer content redraw policy constants.
NSViewLayerContentsRedrawDuringViewResize 2 One of the view layer content redraw policy constants.
NSViewLayerContentsRedrawNever 0 One of the view layer content redraw policy constants.
NSViewLayerContentsRedrawOnSetNeedsDisplay 1 One of the view layer content redraw policy constants.
NSViewMaxXMargin 4 One of the constants for the autoresizingMask property. The right margin between the receiver and its superview is flexible.
NSViewMaxYMargin 32 One of the constants for the autoresizingMask property. The top margin between the receiver and its superview is flexible.
NSViewMinXMargin 1 One of the constants for the autoresizingMask property. The left margin between the receiver and its superview is flexible.
NSViewMinYMargin 8 One of the constants for the autoresizingMask property. The bottom margin between the receiver and its superview is flexible.
NSViewNotSizable 0 One of the constants for the autoresizingMask property. The receiver cannot be resized.
NSViewWidthSizable 2 One of the constants for the autoresizingMask property. The receiver's width is flexible.

Window Order Constants

Constant Value Description
NSWindowAbove 1 Moves the window above the indicated window.
NSWindowBelow -1 Moves the window below the indicated window.
NSWindowOut 0 Moves the window off the screen.

Super class NSResponderMBS

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Release notes


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


NSSecureTextFieldMBS   -   NSServiceProviderMBS


The biggest plugin in space...