Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

CFAttributedStringMBS.AsNSAttributedString as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns a new NSAttributedStringMBS object pointing to same attributed string.
Example:
// make CF version
dim c as CFAttributedStringMBS = CFAttributedStringMBS.Create("Hello World", nil)
MsgBox c.String

// get NS Version
dim n as NSAttributedStringMBS = c.AsNSAttributedString
MsgBox n.text
Notes: For passing to functions which need a NSAttributedStringMBS.

Feedback, Comments & Corrections

CFAttributedStringMBS.AttributeAndLongestEffectiveRange(location as Integer, attrName as CFStringMBS, inRange as CFRangeMBS, byref effectiveRange as CFRangeMBS) as CFObjectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns the value of a given attribute of an attributed string at a specified location.
Notes:
location: The location in str at which to determine the attributes. It is a programming error for loc to specify a location outside the bounds of str.
attrName: The name of the attribute whose value you want to determine.
inRange: The range in str within which you want to find the longest effective range of the attributes at loc. inRange must not exceed the bounds of str.
effectiveRange: upon return contains the maximal range within inRange over which the exact same set of attributes apply. The returned range is clipped to inRange.
Returns the attribute value of str at the specified location.

Feedback, Comments & Corrections

CFAttributedStringMBS.AttributesAndLongestEffectiveRange(location as Integer, inRange as CFRangeMBS, byref effectiveRange as CFRangeMBS) as CFDictionaryMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns the attributes of an attributed string at a specified location.
Notes:
location: The location in str at which to determine the attributes. loc must not exceed the bounds of str.
inRange: The range in str within to find the longest effective range of the attributes at loc. inRange must not exceed the bounds of str.
effectiveRange: upon return contains the maximal range within inRange over which the exact same set of attributes apply. The returned range is clipped to inRange.

Feedback, Comments & Corrections

CFAttributedStringMBS.AttributesDictionary(location as Integer, byref effectiveRange as CFRangeMBS) as CFDictionaryMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns the attributes of an attributed string at a specified location.
Notes:
location: The location in str at which to determine the attributes. loc must not exceed the bounds of str.
effectiveRange: upon return contains a range including loc over which exactly the same set of attributes apply as at loc.

Returns a dictionary that contains the attributes of str at the specified location. Ownership follows the Get Rule.

For performance reasons, a range returned in effectiveRange is not necessarily the maximal range. If you need the maximum range, you should use AttributesAndLongestEffectiveRange.

Note that the returned attribute dictionary might change in unpredictable ways if the attributed string is edited after this call. If you want to preserve the state of the dictionary, you should make an actual copy of it rather than just retaining it. In addition, you should make no assumptions about the relationship of the actual dictionary returned by this call and the dictionary originally used to set the attributes, other than the fact that the values stored in the dictionaries will be identical (that is, ==) to those originally specified.

Feedback, Comments & Corrections

CFAttributedStringMBS.AttributeValue(location as Integer, attrName as CFStringMBS, byref effectiveRange as CFRangeMBS) as CFObjectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns the value of a given attribute of an attributed string at a specified location.
Notes:
location: The location in str at which to determine the attributes. loc must not exceed the bounds of str.
attrName: The name of the attribute whose value you want to determine.
effectiveRange: upon return contains a range including loc over which exactly the same set of attributes apply as at location.

Returns the value of the specified attribute at the specified location in str. Ownership follows the Get Rule.

For performance reasons, a range returned in effectiveRange is not necessarily the maximal range. If you need the maximum range, you should use AttributeAndLongestEffectiveRange.

Feedback, Comments & Corrections

CFAttributedStringMBS.Constructor(str as CFAttributedStringMBS, range as CFRangeMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Creates a sub-attributed string from the specified range.
Notes:
str: The attributed string to copy.
range: The range of the attributed string to copy. range must not exceed the bounds of Str.

Returns a new attributed string whose string and attributes are copied from the specified range of the supplied attributed string. Raises OutOfMemory exception if there was a problem copying the object. Ownership follows the Create Rule.

See also:

Feedback, Comments & Corrections

CFAttributedStringMBS.Constructor(str as CFStringMBS, attributeDictionary as CFDictionaryMBS = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Creates an attributed string with specified string and attributes.
Notes:
str: A string that specifies the characters to use in the new attributed string. This value is copied.
attributeDictionary: A dictionary that contains the attributes to apply to the new attributed string. This value is copied.

Returns an attributed string that contains the characters from str and the attributes specified by attributes. Raises OutOfMemory exception if there was a problem in creating the attributed string.

Note that both the string and the attributes dictionary are copied. The specified attributes are applied to the whole string. If you want to apply different attributes to different ranges of the string, you should use a mutable attributed string.

See also:

Feedback, Comments & Corrections

CFAttributedStringMBS.Copy as CFAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Creates an immutable copy of an attributed string.

Feedback, Comments & Corrections

CFAttributedStringMBS.GetLength as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 10.3 Yes No No Yes, macOS only No
Function: Queries the length of the string.
This item is deprecated and should no longer be used.
Notes: Deprecated in favor of Length property.

Feedback, Comments & Corrections

CFAttributedStringMBS.GetString as CFStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 10.3 Yes No No Yes, macOS only No
Function: Queries the text of the attributed string.
This item is deprecated and should no longer be used.
Notes: Deprecated in favor of String function.

Feedback, Comments & Corrections

CFAttributedStringMBS.MutableCopy(maxLength as Integer = 0) as CFAttributedStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Creates a mutable attributed string copy.
Notes: maxLength, if not 0, is a hard bound on the length of the attributed string; exceeding this size limit during any editing operation is a programming error. If 0, there is no limit on the length.

Feedback, Comments & Corrections

CFAttributedStringMBS.String as CFStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreFoundation MBS MacCF Plugin 14.2 Yes No No Yes, macOS only No
Function: Returns the string for an attributed string.
Notes: For performance reasons, the string returned will often be the backing store of the attributed string, and it might therefore change if the attributed string is edited. However, this is an implementation detail, and you should not rely on this behavior.

Feedback, Comments & Corrections

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

The biggest plugin in space...




Links
MBS Xojo PDF Plugins