Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSSearchFieldMBS class.

NSSearchFieldMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new search field with size 100/100 and position 0/0
Example
dim t as new NSSearchFieldMBS

On success the handle property is not zero.

See also:

NSSearchFieldMBS.Constructor(Handle as Integer)

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

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

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

See also:

NSSearchFieldMBS.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 MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new search field with the given size and position.
Example
dim x as new NSSearchFieldMBS(0, 0, 100, 100)

On success the handle property is not zero.

See also:

NSSearchFieldMBS.maximumRecents as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The maximum number of search strings that can appear in the search menu.

The maximum number of search strings that can appear in the menu. This value can be between 0 and 254. Specifying a value less than 0 sets the value to the default, which is 10. Specifying a value greater than 254 sets the maximum to 254.

When the limit is exceeded, the oldest search string on the menu is dropped.
(Read and Write computed property)

NSSearchFieldMBS.recentsAutosaveName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The key under which the prior list of recent search strings has been archived.

The autosave name, which is used as a key in the standard user defaults to save the recent searches. The default value is "", which causes searches not to be autosaved.
(Read and Write computed property)

NSSearchFieldMBS.recentSearches as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the list of recent search strings for the control.

An array of strings, each of which contains a search string either displayed in the search menu or from a recent autosave archive. If there have been no recent searches and no prior searches saved under an autosave name, this array may be empty.

NSSearchFieldMBS.searchMenuTemplate as NSMenuMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The menu template object used to dynamically construct the search pop-up icon menu.

The receiver looks for the tag constants described in Menu tags to determine how to populate the menu with items related to recent searches. (See constants)

To modify the actual menu shown, please use NSMenuItemMBS.validateMenuItem event. There you can for example set the state of the menu item shown. The SearchField makes a copy of the NSMenuItem, so the menuitem where the event is called, is not the one shown. It's the one passes as parameter.
(Read and Write computed property)

NSSearchFieldMBS.sendsSearchStringImmediately as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether the cell sends its action message to the target immediately upon notification of any changes to the search field text or after a brief pause.

True to send the cell's action immediately upon notification of any changes to the search field; otherwise, false if you want the cell to pause briefly before sending its action message. Pausing gives the user the opportunity to type more text into the search field before initiating the search.
(Read and Write computed property)

NSSearchFieldMBS.sendsWholeSearchString as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether the receiver sends the search action message when the user clicks the search button (or presses return) or after each keystroke.

True to send the action message all at once when the user clicks the search button or presses return; otherwise, False to send the search string after each keystroke.
(Read and Write computed property)

NSSearchFieldMBS.setRecentSearches(values() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the list of recent search strings to list in the pop-up icon menu of the receiver.

You might use this method to set the recent list of searches from an archived copy.

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


The biggest plugin in space...