Platforms to show: All Mac Windows Linux Cross-Platform

NSSearchFieldMBS class

Super class: NSTextFieldMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa Controls MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
An NSSearchField object implements a text field control that is optimized for performing text-based searches.
Example
// create searchfield
dim n as new NSSearchFieldMBS(0,0,100,20)

// set placeholder
dim x as NSTextFieldCellMBS = n.cell
x.placeholderString = "Test"

The control provides a customized text field for entering search data, a search button, a cancel button, and a pop-up icon menu for listing recent search strings and custom search categories.

An NSSearchField object wraps an NSSearchFieldCell object. Access to most search field attributes occurs through the cell, which provides a more comprehensive programmatic interface for manipulating the search field. You can use an NSSearchField object though to manipulate some aspects of the search field. For additional information about search fields and how to manipulate them, see the NSSearchFieldCell class.

You can embed this view in a CustomNSViewMBS to get more events for mouse and keyboard.
Subclass of the NSTextFieldMBS class.

Search menu template constants

Constant Value Description
NSSearchFieldClearRecentsMenuItemTag 1002 Identifies the menu item for clearing the current set of recent string searches in the menu.
This item is hidden if there are no recent strings.
NSSearchFieldNoRecentsMenuItemTag 1003 Identifies the menu item that describes a lack of recent search strings (for example, "No recent searches").
This item is hidden if there have been recent searches.
NSSearchFieldRecentsMenuItemTag 1001 Identifies where recent search strings should appear in the "recents" menu group.
NSSearchFieldRecentsTitleMenuItemTag 1000 Identifies the menu item that is the title of the menu group for recent search strings. more

Super class NSTextFieldMBS

Constants

Constant Value Description
NSTextFieldRoundedBezel 1 One of the constants for the bezelStyle property. Corners are rounded.
NSTextFieldSquareBezel 0 One of the constants for the bezelStyle property. Corners are square.

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

Sub classes:

Some methods using this class:

Some properties using for this class:

Some examples using this class:

Blog Entries

Release notes


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


NSSearchFieldCellMBS   -   NSSecureTextFieldMBS


The biggest plugin in space...