Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSTextViewMBS class.

Next items

NSTextViewMBS.alignJustified

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Applies full justification to selected paragraphs (or all text, if the receiver is a plain text object).

Some examples using this method:

NSTextViewMBS.breakUndoCoalescing

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Informs the receiver that it should begin coalescing successive typing operations in a new undo grouping.

This method should be invoked when saving the receiver's contents to preserve proper tracking of unsaved changes and the document's dirty state.

NSTextViewMBS.changeAttributes

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Changes the attributes of the current selection.

This method changes the attributes by invoking convertAttributes: on sender and applying the returned attributes to the appropriate text. See the NSFontManager class reference for more information on attribute conversion.

Available in Mac OS X v10.3 and later.

NSTextViewMBS.changeColor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the color of the selected text.

NSTextViewMBS.changeDocumentBackgroundColor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
An action method used to set the background color.

This method gets the new color by sending a color message to sender.
This will only set the background color if allowsDocumentBackgroundColorChangereturns true.

NSTextViewMBS.checkTextInDocument

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Check text in document.

Available in Mac OS X v10.6 and later.

NSTextViewMBS.checkTextInSelection

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Check text in selection.

Available in Mac OS X v10.6 and later.

NSTextViewMBS.complete

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Invokes completion in a text view.

By default invoked using the Escape key, this method provides users with a choice of completions for the word currently being typed. May be invoked programmatically if autocompletion is desired by a client of the text system. You can change the key invoking this method using the text system's key bindings mechanism; see "Text System Defaults and Key Bindings" for an explanation of the procedure (on Apple website).

NSTextViewMBS.Constructor

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

On success the handle property is not zero.

See also:

NSTextViewMBS.Constructor(Handle as Integer)

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

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

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

See also:

NSTextViewMBS.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 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new text view with the given size and position.
Example
dim x as new NSTextViewMBS(0, 0, 100, 100)

On success the handle property is not zero.

See also:

NSTextViewMBS.didChangeText

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 18.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sends out necessary notifications when a text change completes.

Invoked automatically at the end of a series of changes, this method posts an NSTextDidChangeNotification to the default notification center, which also results in the delegate receiving an NSText delegate textDidChange message.

Subclasses implementing methods that change their text should invoke this method at the end of those methods. See Subclassing NSTextView for more information.

NSTextViewMBS.insertText(attributedString as NSAttributedStringMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Inserts text into the receiver's text at the insertion point if there is one, otherwise replacing the selection.
Example
dim textView as NSTextViewMBS // your view
dim a as new NSMutableAttributedStringMBS

if a.initWithString( "Hello World. This is just a little test." ) then

Dim NSFont as NSFontMBS = NSFontMBS.fontWithName("Arial", 24.0)
Dim NSColor as NSColorMBS = NSColorMBS.blueColor
Dim NSRange as NSRangeMBS = NSMakeRangeMBS( 0, 20)
Dim NSAttributes as New Dictionary

NSAttributes.value(NSAttributedStringMBS.NSFontAttributeName) = NSFont
NSAttributes.value(NSAttributedStringMBS.NSForegroundColorAttributeName) = NSColor

a.addAttributes( NSAttributes, NSRange)

textView.insertText a

// replace text with new one:
'textView.textStorage.setAttributedString a

end if

text: The string to insert. Can be either an string or an NSAttributedStringMBS object.

The inserted text is assigned the current typing attributes.

This method is the means by which text typed by the user enters an NSTextView. See the NSInputManager class and NSTextInput protocol specifications for more information.

This method is the entry point for inserting text typed by the user and is generally not suitable for other purposes. Programmatic modification of the text is best done by operating on the text storage directly. Because this method pertains to the actions of the user, the text view must be editable for the insertion to work.

See also:

NSTextViewMBS.insertText(text as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Inserts text into the receiver's text at the insertion point if there is one, otherwise replacing the selection.

text: The string to insert. Can be either an string or an NSAttributedStringMBS object.

The inserted text is assigned the current typing attributes.

This method is the means by which text typed by the user enters an NSTextView. See the NSInputManager class and NSTextInput protocol specifications for more information.

This method is the entry point for inserting text typed by the user and is generally not suitable for other purposes. Programmatic modification of the text is best done by operating on the text storage directly. Because this method pertains to the actions of the user, the text view must be editable for the insertion to work.

See also:

NSTextViewMBS.invalidateTextContainerOrigin

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Invalidates the calculated origin of the text container.

This method is invoked automatically; you should never need to invoke it directly. Usually called because the text view has been resized or the contents of the text container have changed.

NSTextViewMBS.loosenKerning

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Increases the space between glyphs in the receiver's selection, or in all text if the receiver is a plain text view.

Kerning values are determined by the point size of the fonts in the selection.

NSTextViewMBS.lowerBaseline

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Lowers the baseline offset of selected text by 1 point, or of all text if the receiver is a plain text view.

As such, this method defines a more primitive operation than subscripting.

NSTextViewMBS.orderFrontLinkPanel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Brings forward a panel allowing the user to manipulate links in the text view.

Available in Mac OS X v10.4 and later.

Some examples using this method:

NSTextViewMBS.orderFrontListPanel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Brings forward a panel allowing the user to manipulate text lists in the text view.

Available in Mac OS X v10.4 and later.

Some examples using this method:

NSTextViewMBS.orderFrontSpacingPanel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Brings forward a panel allowing the user to manipulate text line heights, interline spacing, and paragraph spacing, in the text view.

Available in Mac OS X v10.4 and later.

Some examples using this method:

NSTextViewMBS.orderFrontSubstitutionsPanel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Orders the substitution panel to the front.

Available on Mac OS X 10.6 or newer.

Some examples using this method:

NSTextViewMBS.orderFrontTablePanel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Brings forward a panel allowing the user to manipulate text tables in the text view.

Some examples using this method:

NSTextViewMBS.outline

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Adds the outline attribute to the selected text attributes if absent; removes the attribute if present.

If there is a selection and the first character of the selected range has a non-zero stroke width, or if there is no selection and the typing attributes have a non-zero stroke width, then the stroke width is removed; otherwise the value of NSStrokeWidthAttributeName is set to the default value for outline (3.0).

Operates on the selected range if the receiver contains rich text. For plain text the range is the entire contents of the receiver.

NSTextViewMBS.pasteAsPlainText

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Inserts the contents of the pasteboard into the receiver's text as plain text.

This method behaves analogously to insertText.

NSTextViewMBS.pasteAsRichText

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method inserts the contents of the pasteboard into the receiver's text as rich text, maintaining its attributes.

The text is inserted at the insertion point if there is one, otherwise replacing the selection.

NSTextViewMBS.performFindPanelAction(FindAction as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Performs a find panel action specified by the sender's tag.
Example
const NSFindPanelActionShowFindPanel = 1

dim n as NSTextViewMBS = TextArea1.NSTextViewMBS
n.usesFindPanel = true
n.performFindPanelAction(NSFindPanelActionShowFindPanel)

This is the generic action method for the find menu and find panel, and can be overridden to implement a custom find panel.

Possible values:
NSFindPanelActionShowFindPanel = 1
NSFindPanelActionNext = 2
NSFindPanelActionPrevious = 3
NSFindPanelActionReplaceAll = 4
NSFindPanelActionReplace = 5
NSFindPanelActionReplaceAndFind = 6
NSFindPanelActionSetFindString = 7
NSFindPanelActionReplaceAllInSelection = 8
NSFindPanelActionSelectAll = 9
NSFindPanelActionSelectAllInSelection = 10

See also:

Some examples using this method:

NSTextViewMBS.performFindPanelAction(sender as object)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Performs a find panel action specified by the sender.

This is the generic action method for the find menu and find panel, and can be overridden to implement a custom find panel.
Sender could be a NSMenuItem or maybe also a NSView.

See also:

NSTextViewMBS.raiseBaseline

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Raises the baseline offset of selected text by 1 point, or of all text if the receiver is a plain text view.

As such, this method defines a more primitive operation than superscripting.

NSTextViewMBS.replaceTextContainer(textContainer as NSTextContainerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Replaces the text container for the group of text system objects containing the receiver, keeping the association between the receiver and its layout manager intact.

textContainer: The new text container. This method raises NSInvalidArgumentException if TextContainer is nil.

NSTextViewMBS.shouldChangeTextInRange(affectedCharRange as NSRangeMBS, replacementString as string = "") as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 18.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Initiates a series of delegate messages (and general notifications) to determine whether modifications can be made to the characters and attributes of the receiver’s text.

affectedCharRange: The range of characters affected by the proposed change.
replacementString: The characters that will replace those in affectedCharRange. If only text attributes are being changed, replacementString is "".

Returns true to allow the change, false to prohibit it.

This method checks with the delegate as needed using textShouldBeginEditing and shouldChangeTextInRange.
This method must be invoked at the start of any sequence of user-initiated editing changes. If your subclass of NSTextView implements methods that modify the text, make sure to invoke this method to determine whether the change should be made. If the change is allowed, complete the change by invoking the didChangeText method.

If the receiver is not editable, this method automatically returns false. This result prevents instances in which a text view could be changed by user actions even though it had been set to be non-editable.
In macOS 10.4 and later, if there are multiple selections, this method acts on the first selected subrange.

See also:

NSTextViewMBS.showFindIndicatorForRange(charRange as NSRangeMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Causes a temporary highlighting effect to appear around the visible portion (or portions) of the specified range.

charRange: The character range around which indicators appear.

This method supports lozenge-style indication of find results. The indicators automatically disappear after a certain period of time, or when the method is called again, or when any of a number of changes occur to the view (such as changes to text, view size, or view position).

This method does not itself scroll the specified range to be visible; any desired scrolling should be done before this method is called, first, because the method acts only on the visible portion of the specified range, and, second, because scrolling causes the indicators to disappear. Calling this method with a zero-length range always removes any existing indicators.

Available in OS X v10.5 and later.

Some examples using this method:

NSTextViewMBS.startSpeaking

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Speaks the selected text, or all text if no selection.

NSTextViewMBS.stopSpeaking

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Stops the speaking of text.

NSTextViewMBS.tightenKerning

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Decreases the space between glyphs in the receiver's selection, or for all glyphs if the receiver is a plain text view.

Kerning values are determined by the point size of the fonts in the selection.

NSTextViewMBS.toggleAutomaticDashSubstitution

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Toggles automatic dash substitution.

Available on Mac OS X 10.6 or newer.

NSTextViewMBS.toggleAutomaticDataDetection

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Toggles automatic data detection.

Available on Mac OS X 10.6 or newer.

NSTextViewMBS.toggleAutomaticLinkDetection

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Changes the state of automatic link detection from enabled to disabled and vice versa.

Automatic link detection causes strings representing URLs typed in the view to be automatically made into links to those URLs.

Available in Mac OS X v10.5 and later.

NSTextViewMBS.toggleAutomaticQuoteSubstitution

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Changes the state of automatic quotation mark substitution from enabled to disabled and vice versa.

Automatic quote substitution causes ASCII quotation marks and apostrophes to be automatically replaced, on a context-dependent basis, with more typographically accurate symbols.

Available in Mac OS X v10.5 and later.

NSTextViewMBS.toggleAutomaticSpellingCorrection

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Toggles automatic spelling correction.

Available on Mac OS X 10.6 or newer.

NSTextViewMBS.toggleAutomaticTextReplacement

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Toggles automatic text replacements.

Available on Mac OS X 10.6 or newer.

NSTextViewMBS.toggleBold

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 16.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Toggles the use of a bold/non-bold font.
Example
//  some textview
dim textview as NSTextView = TextArea1.NSTextViewMBS

// switch between bold and non bold
textview.toggleBold

You can set this to continue typing with/without bold or change current selection.
Can only provide bold if the font supports it.

NSTextViewMBS.toggleContinuousSpellChecking

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Toggles whether continuous spell checking is enabled for the receiver.

NSTextViewMBS.toggleGrammarChecking

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Changes the state of grammar checking from enabled to disabled and vice versa.

Available in Mac OS X v10.5 and later.

NSTextViewMBS.toggleItalic

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 16.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Toggles the use of an italic/non-italic font.
Example
//  some textview
dim textview as NSTextView = TextArea1.NSTextViewMBS

// switch between italic and non italic
textview.toggleItalic

You can set this to continue typing with/without bold or change current selection.
Can only provide italic if the font supports it.

NSTextViewMBS.toggleSmartInsertDelete

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Changes the state of smart insert and delete from enabled to disabled and vice versa.

Controls whether the receiver inserts or deletes space around selected words so as to preserve proper spacing and punctuation.

Available in Mac OS X v10.5 and later.

NSTextViewMBS.toggleTraditionalCharacterShape

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Toggles the NSCharacterShapeAttributeName attribute at the current selection.

NSTextViewMBS.turnOffKerning

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the receiver to use nominal glyph spacing for the glyphs in its selection, or for all glyphs if the receiver is a plain text view.

NSTextViewMBS.turnOffLigatures

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the receiver to use only required ligatures when setting text, for the glyphs in the selection if the receiver is a rich text view, or for all glyphs if it's a plain text view.

NSTextViewMBS.updateDragTypeRegistration

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Updates the acceptable drag types of all text views associated with the receiver's layout manager.

If the receiver is editable and is a rich text view, causes all text views associated with the receiver's layout manager to register their acceptable drag types. If the text view isn't editable or isn't rich text, causes those text views to unregister their dragged types.

Subclasses can override this method to change the conditions for registering and unregistering drag types, whether as a group or individually based on the current state of the text view. They should invoke this method when that state changes to perform the necessary update.

Next items

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


The biggest plugin in space...