Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSSearchFieldMBS class.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacCocoa Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
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 |
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 |
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 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 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 |
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 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 |
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 |
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 |
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.