Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSTextMBS class.

Next items

NSTextMBS.alignment as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The text alignment.

(Read and Write computed property)

NSTextMBS.backgroundColor as NSColorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The background color.

(Read and Write computed property)

NSTextMBS.baseWritingDirection as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The initial writing direction used to determine the actual writing direction for text.

The Text system uses this value as a hint for calculating the actual direction for displaying Unicode characters. You should not need to call this method directly. If no writing direction is set, returns NSWritingDirectionNatural.

Available in Mac OS X v10.4 and later.
(Read and Write computed property)

NSTextMBS.changeFont

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method changes the font of the selection for a rich text object, or of all text for a plain text object.

If the receiver doesn't use the Font panel, this method does nothing.

This method changes the font by sending a convertFont message to the shared NSFontManager and applying each NSFont returned to the appropriate text. See the NSFontManager class specification for more information on font conversion.

NSTextMBS.checkSpelling

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method searches for a misspelled word in the receiver's text.

The search starts at the end of the selection and continues until it reaches a word suspected of being misspelled or the end of the text. If a word isn't recognized by the spelling server, a showGuessPanel message then opens the Guess panel and allows the user to make a correction or add the word to the local dictionary.

NSTextMBS.Constructor

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

On success the handle property is not zero.

See also:

NSTextMBS.Constructor(Handle as Integer)

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

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

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

See also:

NSTextMBS.Constructor(left as Double, top as Double, width as Double, height as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new text with the given size and position.
Example
dim x as new NSTextMBS(0, 0, 100, 100)

On success the handle property is not zero.

See also:

NSTextMBS.copy

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method copies the selected text onto the general pasteboard, in as many formats as the receiver supports.

NSTextMBS.copyFont

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method copies the font information for the first character of the selection (or for the insertion point) onto the font pasteboard, as NSFontPboardType.

NSTextMBS.copyRuler

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method copies the paragraph style information for first selected paragraph onto the ruler pasteboard, as NSRulerPboardType, and expands the selection to paragraph boundaries.

NSTextMBS.cut

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method deletes the selected text and places it onto the general pasteboard, in as many formats as the receiver supports.

NSTextMBS.delete

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method deletes the selected text.

NSTextMBS.drawsBackground as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the scrollview draws its background.

(Read and Write computed property)

NSTextMBS.Enabled as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 16.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Enables/disables the control.

If enabled, text is in default text color.
if disabled, you can't edit or select and the text color is gray.
(Read and Write computed property)

NSTextMBS.font as NSFontMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The font of the first character in the receiver's text, or of the insertion point if there's no text.

(Read and Write computed property)

NSTextMBS.importsGraphics as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether the receiver allows the user to import files by dragging.

(Read and Write computed property)

NSTextMBS.isEditable as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the receiver allows the user to edit text, false if it doesn't.

You can change the receiver's text programmatically regardless of this setting.

If the receiver is editable, it's also selectable.
(Read and Write computed property)

NSTextMBS.isFieldEditor as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the receiver interprets Tab, Shift-Tab, and Return (Enter) as cues to end editing and possibly to change the first responder.

True if the receiver interprets Tab, Shift-Tab, and Return (Enter) as cues to end editing and possibly to change the first responder; false if it accepts them as text input.

See the NSWindow class specification for more information on field editors. By default, NSText objects don't behave as field editors.
(Read and Write computed property)

NSTextMBS.isHorizontallyResizable as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
True if the receiver automatically changes its width to accommodate the width of its text, false if it doesn't.

By default, an NSText object is not horizontally resizable.
(Read and Write computed property)

NSTextMBS.isRichText as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the NSText allows the user to apply attributes to specific ranges of the text.

(Read and Write computed property)

NSTextMBS.isRulerVisible as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the receiver's enclosing scroll view shows its ruler.

NSTextMBS.isSelectable as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the text allows the user to select text, false if it doesn't.

(Read and Write computed property)

NSTextMBS.isVerticallyResizable as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
True if the receiver automatically changes its height to accommodate the height of its text, false if it doesn't.

By default, an NSText object is vertically resizable.
(Read and Write computed property)

NSTextMBS.maxSizeHeight as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the receiver's maximum height.

NSTextMBS.maxSizeWidth as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the receiver's maximum width.

NSTextMBS.minSizeHeight as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the receiver's minimum height.

NSTextMBS.minSizeWidth as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the receiver's maximum width.

NSTextMBS.paste

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method pastes text from the general pasteboard at the insertion point or over the selection.

NSTextMBS.pasteFont

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method pastes font information from the font pasteboard onto the selected text or insertion point of a rich text object, or over all text of a plain text object.

NSTextMBS.pasteRuler

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method pastes paragraph style information from the ruler pasteboard onto the selected paragraphs of a rich text object.

NSTextMBS.readRTFDFromFile(file as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Attempts to read the RTFD file, returning true if successful and false if not.

file should be the path for an .rtf file or an .rtfd file wrapper, not for the RTF file within an .rtfd file wrapper.

NSTextMBS.replaceCharactersInRangeWithRTF(start as Integer, length as Integer, rtfData as MemoryBlock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Replaces the characters in the given range with RTF text interpreted from the given RTF data.

This method applies only to rich text objects.

This method does not include undo support by default. Clients must invoke shouldChangeTextInRange to include this method in an undoable action.

This method is designed for transferring text from out-of-process sources such as the pasteboard. In most cases, programmatic modification of the text is best done by operating on the text storage directly, using the general methods of NSMutableAttributedString.

NSTextMBS.replaceCharactersInRangeWithRTFD(start as Integer, length as Integer, rtfdData as MemoryBlock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Replaces the characters in the given range with RTFD text interpreted from the given RTFD data.

This method applies only to rich text objects.

This method does not include undo support by default. Clients must invoke shouldChangeTextInRange to include this method in an undoable action.

This method is designed for transferring text from out-of-process sources such as the pasteboard. In most cases, programmatic modification of the text is best done by operating on the text storage directly, using the general methods of NSMutableAttributedString.

NSTextMBS.replaceCharactersInRangeWithString(start as Integer, length as Integer, text as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Replaces the characters in the given range with those in the given string.

For a rich text object, the text is assigned the formatting attributes of the first character of the text it replaces, or of the character immediately before aRange if the range's length is 0. If the range's location is 0, the formatting attributes of the first character in the receiver are used.

This method does not include undo support by default. Clients must invoke shouldChangeTextInRange to include this method in an undoable action.

In most cases, programmatic modification of the text is best done by operating on the text storage directly, using the general methods of NSMutableAttributedString.

NSTextMBS.RTFDFromRange(start as Integer, length as Integer) as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a string that contains an RTFD stream corresponding to the characters and attributes within aRange.

Raises an NSRangeException if any part of aRange lies beyond the end of the receiver's characters.

When writing data to the pasteboard, you can use the memoryblock object as the first argument to NSPasteboard's setDataForType method, with a second argument of NSRTFDPboardType.

NSTextMBS.RTFFromRange(start as Integer, length as Integer) as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
eturns a string object that contains an RTF stream corresponding to the characters and attributes within aRange, omitting any attachment characters and attributes.

Raises an NSRangeException if any part of aRange lies beyond the end of the receiver's characters.

When writing data to the pasteboard, you can use the memoryblock as the first argument to NSPasteboard's setDataForType method, with a second argument of NSRTFPboardType.

NSTextMBS.scrollRangeToVisible(start as Integer, length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Scrolls the receiver in its enclosing scroll view so the first characters of aRange are visible.

NSTextMBS.selectAll

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method selects all of the receiver's text.

NSTextMBS.selectedRange as NSRangeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Text MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The range of selected characters.
Example
dim t as NSTextViewMBS = TextArea1.NSTextViewMBS
dim s as NSTextStorageMBS = t.textStorage

const NSUnderlineStyleSingle = 1

dim r as NSRangeMBS = t.selectedRange
s.addAttribute NSAttributedStringMBS.NSStrikethroughStyleAttributeName, NSUnderlineStyleSingle, r

(Read and Write computed property)

Some examples using this property:

NSTextMBS.setFontForRange(font as NSFontMBS, start as Integer, length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the font of characters within the given range to font.

This method applies only to a rich text object.

This method does not include undo support by default. Clients must invoke shouldChangeTextInRanges to include this method in an undoable action.

NSTextMBS.setMaxSize(width as Double, height as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the receiver's maximum size.

NSTextMBS.setMinSize(width as Double, height as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the receiver's minimum size.

NSTextMBS.setTextColorForRange(colorValue as NSColorMBS, start as Integer, length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the text color of characters within the given range to colorValue.

Removes the text color attribute if colorValue is nil. This method applies only to rich text objects.

This method does not include undo support by default. Clients must invoke shouldChangeTextInRange to include this method in an undoable action.

NSTextMBS.showGuessPanel

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This action method opens the Spelling panel, allowing the user to make a correction during spell checking.

NSTextMBS.sizeToFit

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Text MBS MacCocoa Plugin 8.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Resizes the receiver to fit its text.

The text view will not be sized any smaller than its minimum size, however.

Next items

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


The biggest plugin in space...