Platforms to show: All Mac Windows Linux Cross-Platform
Back to DesktopNSTokenFieldControlMBS control.
DesktopNSTokenFieldControlMBS.BoundsChanged
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
DesktopNSTokenFieldControlMBS.Closing
Type | Topic | Version |
event | Cocoa Controls | 21.5 |
The control is about to close.
In older Xojo versions, this event is named Close.
DesktopNSTokenFieldControlMBS.completionsForSubstring(substring as string, tokenIndex as Integer, byref selectedIndex as Integer) as Variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
Available in OS X v10.4 and later.
DesktopNSTokenFieldControlMBS.ConstructContextualMenu(base as DesktopMenuItem, x as Integer, y as Integer) As Boolean
Type | Topic | Version |
event | Cocoa Controls | 22.1 |
DesktopNSTokenFieldControlMBS.ContextualMenuItemSelected(selectedItem As DesktopMenuItem) As Boolean
Type | Topic | Version |
event | Cocoa Controls | 21.5 |
This allows the control to react on its relevant menu items. Please return true if you handled it or false to give others a chance.
DesktopNSTokenFieldControlMBS.didCloseContextualMenu(menu as NSMenuMBS, NSEvent as NSEventMBS) New in 24.1
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 24.1 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Allows you to restart any animation you may have stopped in the willShowContextualMenu event.
DesktopNSTokenFieldControlMBS.displayStringForRepresentedObject(representedObject as Variant) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
DesktopNSTokenFieldControlMBS.editingStringForRepresentedObject(representedObject as Variant) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
DesktopNSTokenFieldControlMBS.FocusLost
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The control lost focus.
In older Xojo versions, this event is named LostFocus.
This only fires if the control itself lost focus and not a sub control.
DesktopNSTokenFieldControlMBS.FocusReceived
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The control itself got focus.
In older Xojo versions, this event is named GotFocus.
This only fires if the control itself got focus and not a sub control.
DesktopNSTokenFieldControlMBS.FrameChanged
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
This event notifies you, that the control changed it's bounding frame, which is position and/or size.
DesktopNSTokenFieldControlMBS.hasMenuForRepresentedObject(representedObject as Variant) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
DesktopNSTokenFieldControlMBS.MenuBarSelected
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The event where you can enable menu items.
In older Xojo versions, this event is named EnableMenuItems.
DesktopNSTokenFieldControlMBS.menuForRepresentedObject(representedObject as Variant) as NSMenuMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
DesktopNSTokenFieldControlMBS.MouseDown(x as Integer, y as Integer, Modifiers as Integer) As Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
The coordinates x and y are local to the control, i.e. they represent the position of the mouse click relative to the upper-left corner or the Control.
Return True if you are going to handle the MouseDown. In such a case:
- The Action event, if any, will not execute and the state of the object will not change.
- You will receive the MouseDrag and MouseUp events.
DesktopNSTokenFieldControlMBS.MouseDrag(x as Integer, y as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Mouse location is local to the control passed in to x, y.
As this event is fired continuously (hundreds of time per second), it is your responsibility to determine if the mouse has really moved.
DesktopNSTokenFieldControlMBS.MouseUp(x as Integer, y as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Use the x and y parameters to determine if the mouse button was released within the control's boundaries.
DesktopNSTokenFieldControlMBS.Opening
Type | Topic | Version |
event | Cocoa Controls | 21.5 |
The control is about to was created and you can initialize it.
In older Xojo versions, this event is named Open.
DesktopNSTokenFieldControlMBS.readFromPasteboard(pboard as NSPasteboardMBS) as Variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
DesktopNSTokenFieldControlMBS.representedObjectForEditingString(editingString as string) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
DesktopNSTokenFieldControlMBS.ScaleFactorChanged(NewFactor as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Please invalidate any cached bitmaps or other relevant state.
DesktopNSTokenFieldControlMBS.shouldAddObjects(tokens() as Variant, index as Integer) as Variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
DesktopNSTokenFieldControlMBS.styleForRepresentedObject(representedObject as Variant) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.
DesktopNSTokenFieldControlMBS.TextDidBeginEditing(fieldEditor as NSTextMBS, notification as NSNotificationMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notification: The notification object. The name of the notification is always NSControlTextDidBeginEditingNotification.
This event is invoked when the user begins editing text in a control such as a text field or a form field. The control posts a NSControlTextDidBeginEditingNotification notification, and if the control's subclass implements this event, it is automatically registered to receive the notification. The field editor is also delivered for inspection.
See TextDidEndEditing for an explanation of why you may not always get one invocation of TextDidBeginEditing for each invocation of TextDidEndEditing.
DesktopNSTokenFieldControlMBS.TextDidChange(fieldEditor as NSTextMBS, notification as NSNotificationMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notification: The notification object. The name of the notification is always NSControlTextDidChangeNotification.
This event is invoked when text in a control such as a text field or form changes. The control posts a NSControlTextDidChangeNotification notification, and if the control's subclass implements this event, it is automatically registered to receive the notification. The field editor is provided as parameter for inspection.
DesktopNSTokenFieldControlMBS.TextDidEndEditing(fieldEditor as NSTextMBS, notification as NSNotificationMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Notification: The notification object. The name of the notification is always NSControlTextDidEndEditingNotification.
This event is invoked when the user stops editing text in a control such as a text field or form. The control posts a NSControlTextDidEndEditingNotification notification, and if the control' subclass implements this event, it is automatically registered to receive the notification. The field editor is also provided for inspection.
Warning: In some cases, such as when editing within an instance of NSOutlineView, this method may be invoked without a previous invocation of TextDidBeginEditing. You will only get the TextDidBeginEditing: notification if the user actually types something, but you can get the TextDidEndEditing notification if the user just double-clicks the field and then clicks outside the field, without typing.
DesktopNSTokenFieldControlMBS.textShouldBeginEditing(fieldEditor as NSTextMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Return true to allow text editing or false to deny.
Be aware that an event in Xojo without return will cause false to be returned.
DesktopNSTokenFieldControlMBS.textShouldEndEditing(fieldEditor as NSTextMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Return true to allow end of text editing or false to deny.
Be aware that an event in Xojo without return will cause false to be returned.
DesktopNSTokenFieldControlMBS.tokenFieldAction
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
For a button if it was pressed.
DesktopNSTokenFieldControlMBS.tokenFieldTextShouldBeginEditing(fieldEditor as NSTextMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Return true to allow text editing.
DesktopNSTokenFieldControlMBS.tokenFieldTextShouldEndEditing(fieldEditor as NSTextMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.5 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Return true to allow text editing.
DesktopNSTokenFieldControlMBS.willShowContextualMenu(menu as NSMenuMBS, NSEvent as NSEventMBS) New in 24.1
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 24.1 | ✅ Yes | ❌ No | ❌ No | ❌ No |
Your chance to modify the menu before it is shown, e.g. to add menu entries.
DesktopNSTokenFieldControlMBS.writeRepresentedObjects(objects() as Variant, pboard as NSPasteboardMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
event | Cocoa Controls | MBS MacControls Plugin | 21.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.