Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSTokenFieldMBS class.
NSTokenFieldMBS.completionsForSubstring(substring as string, tokenIndex as Integer, byref selectedIndex as Integer) as Variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
substring: The partial string that is to be completed.
tokenIndex: The index of the token being edited.
selectedIndex: Optionally, you can return by-reference an index into the returned array that specifies which of the completions should be initially selected. If none are to be selected, return by reference -1.
Returns an array of strings that are possible completions.
If the delegate does not implement this method, no completions are provided.
NSTokenFieldMBS.displayStringForRepresentedObject(representedObject as Variant) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
representedObject: A represented object of the token field.
Returns the string to be used as a proxy for representedObject. If you return nil or do not implement this method, then representedObject is displayed as the string.
NSTokenFieldMBS.editingStringForRepresentedObject(representedObject as Variant) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
representedObject: A represented object of the token field.
Returns a string that's an editable proxy of the represented object, or nil if the token should not be editable.
NSTokenFieldMBS.hasMenuForRepresentedObject(representedObject as Variant) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
representedObject: A represented object of the token field.
Returns true if the represented object has a menu, false otherwise.
By default tokens in a token field have no menus.
NSTokenFieldMBS.menuForRepresentedObject(representedObject as Variant) as NSMenuMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
representedObject: A represented object of the token field.
Returns the menu associated with the represented object.
By default tokens in a token field do not return menus.
NSTokenFieldMBS.readFromPasteboard(pboard as NSPasteboardMBS) as Variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
pboard: The pasteboard from which to read the represented objects.
Returns an array of represented objects created from the pasteboard data.
NSTokenFieldMBS.representedObjectForEditingString(editingString as string) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
editingString: The edited string representation of a represented object.
Returns a represented object that is displayed rather than the editing string.
Note: In OS X v10.4, NSTokenField trims whitespace around tokens but it does not trim whitespace in OS X versions 10.5.0 and 10.5.1. In OS X v10.5.2, you get whitespace-trimming behavior by either linking against the v10.4 binary or linking against the v10.5 binary and not implementing the this method. If you do not want the whitespace-trimming behavior, link against the v10.5 binary and implement this method, returning the editing string if you have no represented object.
NSTokenFieldMBS.shouldAddObjects(tokens() as Variant, index as Integer) as Variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
tokens: An array of tokens to be inserted in the receiver at index.
index: The index of the receiver in which the array of tokens to be validated (tokens) will be inserted.
Returns an array of validated tokens.
The event can return the array unchanged or return a modified array of tokens. To reject the add completely, return an empty array. Returning nil causes an error.
NSTokenFieldMBS.styleForRepresentedObject(representedObject as Variant) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
representedObject: A represented object of the token field.
Returns the style that should be used to display the representedObject. Possible values are shown in NSTokenStyle Values.
If the event implements this method and returns an NSTokenStyle that differs from the style set by setTokenStyle:, the value the event returns is preferred.
If you don't implement this method, the token field's tokenStyle is used.
NSTokenFieldMBS.tokenFieldAction
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
For a button if it was pressed.
NSTokenFieldMBS.tokenFieldTextShouldBeginEditing(fieldEditor as NSTextMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Return true to allow text editing.
NSTokenFieldMBS.tokenFieldTextShouldEndEditing(fieldEditor as NSTextMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Return true to allow text editing.
NSTokenFieldMBS.writeRepresentedObjects(objects() as Variant, pboard as NSPasteboardMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa | MBS MacControls Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
objects: An array of represented objects associated with the token field.
pboard: The pasteboard to which to write the represented objects.
Return true if you writes the represented objects to the pasteboard, false otherwise. If false, the token field writes the display strings to the NSStringPboardType pasteboard.
The items on this page are in the following plugins: MBS MacControls Plugin.