Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSViewMBS class.
NSViewMBS.noteFocusRingMaskChanged
Function:
Invoked to notify the view that the focus ring mask requires updating.
Notes:
It is important to note that it is only necessary for developers to invoke this method when some internal state change of their application, that the Application Kit can't determine, affects the shape of the focus ring mask.
It is assumed that if the view is marked as needing display, or is resized, its focus ring shape is likely to have changed, and there is no need for clients to explicitly send this message in such cases, they are handled automatically.
If, however, a view is showing a focus ring around some part of its content (an NSImage, perhaps), and that content changes, the client must provide notification by invoking this method so that focusRingMaskBounds and drawFocusRingMask will be invoked to redraw the focus ring.
Available in Mac OS X v10.7 and later.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
It is important to note that it is only necessary for developers to invoke this method when some internal state change of their application, that the Application Kit can't determine, affects the shape of the focus ring mask.
It is assumed that if the view is marked as needing display, or is resized, its focus ring shape is likely to have changed, and there is no need for clients to explicitly send this message in such cases, they are handled automatically.
If, however, a view is showing a focus ring around some part of its content (an NSImage, perhaps), and that content changes, the client must provide notification by invoking this method so that focusRingMaskBounds and drawFocusRingMask will be invoked to redraw the focus ring.
Available in Mac OS X v10.7 and later.
Some examples using this method:
NSViewMBS.pageFooter as NSAttributedStringMBS
Function:
Returns a default footer string that includes the current page number and page count.
Notes:
A printable view class can override this method to substitute its own content in place of the default value. You should not need to call this method directly. The printing system calls it once per page during printing.
Footers are generated only if the user defaults contain the key NSPrintHeaderAndFooter with the value true.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
A printable view class can override this method to substitute its own content in place of the default value. You should not need to call this method directly. The printing system calls it once per page during printing.
Footers are generated only if the user defaults contain the key NSPrintHeaderAndFooter with the value true.
NSViewMBS.pageHeader as NSAttributedStringMBS
Function:
Returns a default header string that includes the print job title and date.
Notes:
Typically, the print job title is the same as the window title. A printable view class can override this method to substitute its own content in place of the default value. You should not need to call this method directly. The printing system calls it once per page during printing.
Headers are generated only if the user defaults contain the key NSPrintHeaderAndFooter with the value true.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
Typically, the print job title is the same as the window title. A printable view class can override this method to substitute its own content in place of the default value. You should not need to call this method directly. The printing system calls it once per page during printing.
Headers are generated only if the user defaults contain the key NSPrintHeaderAndFooter with the value true.
NSViewMBS.previousKeyView as NSViewMBS
Function:
Returns the view object preceding the receiver in the key view loop.
Notes:
This view should, if possible, be made first responder when the user navigates backward from the receiver using keyboard interface control.
Returns nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
This view should, if possible, be made first responder when the user navigates backward from the receiver using keyboard interface control.
Returns nil on any error.
NSViewMBS.previousValidKeyView as NSViewMBS
Function:
Returns the closest view object in the key view loop that precedes the receiver and accepts first responder status.
Notes:
This method ignores hidden views when it determines the previous valid key view.
Returns nil on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
This method ignores hidden views when it determines the previous valid key view.
Returns nil on any error.
NSViewMBS.print
Function:
This action method opens the Print panel, and if the user chooses an option other than canceling, prints the receiver and all its subviews to the device specified in the Print panel.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSViewMBS.registeredDraggedTypes as string()
Function:
Returns the array of pasteboard drag types that the view can accep
Example:
Notes:
This method returns the types registered by calling registerForDraggedTypes:. Each element of the array is a uniform type identifier. The returned elements are in no particular order, but the array is guaranteed not to contain duplicate entries.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Example:
// we register some types
Listbox1.AcceptPictureDrop
Listbox1.AcceptTextDrop
// and query them:
MsgBox Join(Listbox1.NSViewMBS.registeredDraggedTypes, EndOfLine)
' shows:
'NeXT TIFF v4.0 pasteboard type
'com.apple.traditional-mac-plain-text
'NSStringPboardType
NSViewMBS.registerForDraggedTypes(Types() as string)
Function:
Registers the pasteboard types that the receiver will accept as the destination of an image-dragging session.
Notes:
Types: An array of uniform type identifiers. See Types for Standard Data (Mac OS X 10.6 and later) for descriptions of the pasteboard type identifiers.
Registering an NSView object for dragged types automatically makes it a candidate destination object for a dragging session. As such, it must properly implement some or all of the NSDraggingDestination protocol methods. As a convenience, NSView provides default implementations of these methods. See the NSDraggingDestination protocol specification for details.
Xojo with Cocoa target implements the methods listed above. So this method is useful to change the allowed types for the case the framework has a bug.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
Types: An array of uniform type identifiers. See Types for Standard Data (Mac OS X 10.6 and later) for descriptions of the pasteboard type identifiers.
Registering an NSView object for dragged types automatically makes it a candidate destination object for a dragging session. As such, it must properly implement some or all of the NSDraggingDestination protocol methods. As a convenience, NSView provides default implementations of these methods. See the NSDraggingDestination protocol specification for details.
Xojo with Cocoa target implements the methods listed above. So this method is useful to change the allowed types for the case the framework has a bug.
NSViewMBS.removeAllToolTips
Function:
Removes all tool tips assigned to the receiver.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSViewMBS.removeFromSuperview
Function:
Unlinks the view from its superview and its window, removes it from the responder chain, and invalidates its cursor rectangles.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Some examples using this method:
NSViewMBS.removeFromSuperviewWithoutNeedingDisplay
Function:
Unlinks the receiver from its superview and its window and removes it from the responder chain, but does not invalidate its cursor rectangles to cause redrawing.
Notes:
The receiver is also released; if you plan to reuse it, be sure to retain it before sending this message and to release it as appropriate when adding it as a subview of another view.
Unlike its counterpart, removeFromSuperview, this method can be safely invoked during display.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
The receiver is also released; if you plan to reuse it, be sure to retain it before sending this message and to release it as appropriate when adding it as a subview of another view.
Unlike its counterpart, removeFromSuperview, this method can be safely invoked during display.
Some examples using this method:
NSViewMBS.RenderImage(subviews as boolean = false, flipped as boolean = false) as variant
Function:
Renders a picture of the view.
Example:
Notes:
May return nil on any error.
The value of this variant must be an object of class NSImageMBS.
Added flipped parameter for version 20.3.
Flipped was true for older versions.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 8.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Example:
dim n as new NSProgressIndicatorMBS
n.sizeToFit
dim image as NSImageMBS = n.RenderImage
dim pic as Picture = image.CopyPicture
Backdrop = pic
May return nil on any error.
The value of this variant must be an object of class NSImageMBS.
Added flipped parameter for version 20.3.
Flipped was true for older versions.
NSViewMBS.replaceSubview(oldView as NSViewMBS, newView as NSViewMBS)
Function:
Replaces one of the receiver's subviews with another view.
Notes:
oldView: The view to be replaced by newView. May not be nil.
newView: The view to replace oldView. May not be nil.
This method does nothing if oldView is not a subview of the receiver.
Neither oldView nor newView may be nil, and the behavior is undefined if either of these parameters is nil.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
oldView: The view to be replaced by newView. May not be nil.
newView: The view to replace oldView. May not be nil.
This method does nothing if oldView is not a subview of the receiver.
Neither oldView nor newView may be nil, and the behavior is undefined if either of these parameters is nil.
NSViewMBS.rotateByAngle(angle as Double)
Function:
Rotates the receiver's bounds rectangle by a specified degree value around the origin of the coordinate system, (0.0, 0.0).
Notes:
angle: A float value specifying the angle of rotation, in degrees.
See the BoundsRotation property description for more information. This method neither redisplays the receiver nor marks it as needing display. You must do this yourself with display or NeedsDisplay.
This method posts an NSViewBoundsDidChangeNotification to the default notification center if the receiver is configured to do so.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
angle: A float value specifying the angle of rotation, in degrees.
See the BoundsRotation property description for more information. This method neither redisplays the receiver nor marks it as needing display. You must do this yourself with display or NeedsDisplay.
This method posts an NSViewBoundsDidChangeNotification to the default notification center if the receiver is configured to do so.
NSViewMBS.scaleUnitSquareToSize(size as NSSizeMBS)
Function:
Scales the receiver's coordinate system so that the unit square scales to the specified dimensions.
Notes:
For example, a newUnitSize of (0.5, 1.0) causes the receiver's horizontal coordinates to be halved, in turn doubling the width of its bounds rectangle. Note that scaling is performed from the origin of the coordinate system, (0.0, 0.0), not the origin of the bounds rectangle; as a result, both the origin and size of the bounds rectangle are changed. The frame rectangle remains unchanged.
This method neither redisplays the receiver nor marks it as needing display. You must do this yourself with display or setNeedsDisplay.
This method posts an NSViewBoundsDidChangeNotification to the default notification center if the receiver is configured to do so.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
For example, a newUnitSize of (0.5, 1.0) causes the receiver's horizontal coordinates to be halved, in turn doubling the width of its bounds rectangle. Note that scaling is performed from the origin of the coordinate system, (0.0, 0.0), not the origin of the bounds rectangle; as a result, both the origin and size of the bounds rectangle are changed. The frame rectangle remains unchanged.
This method neither redisplays the receiver nor marks it as needing display. You must do this yourself with display or setNeedsDisplay.
This method posts an NSViewBoundsDidChangeNotification to the default notification center if the receiver is configured to do so.
Some examples using this method:
NSViewMBS.Screenshot as Picture
Function:
Renders the view into a picture.
Notes:
Like ScreenshotWindowMBS, but only for the view you are interested in, e.g. a map.
Returns nil on failure like out of memory.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 22.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
Like ScreenshotWindowMBS, but only for the view you are interested in, e.g. a map.
Returns nil on failure like out of memory.
NSViewMBS.setBackgroundFilters(Filters() as variant)
Function:
Sets an array of Core Image filters to apply to the view’s background.
Notes:
This property contains an array of CIFilterMBS objects. This array represents the background filters stored in the backgroundFilters property of the view’s layer. If the view does not have a layer, setting the value of this property has no effect.
The default value of this property is an empty array.
We use variant here to reduce plugin dependencies. Please use with array of variants containing CIFilterMBS.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
This property contains an array of CIFilterMBS objects. This array represents the background filters stored in the backgroundFilters property of the view’s layer. If the view does not have a layer, setting the value of this property has no effect.
The default value of this property is an empty array.
We use variant here to reduce plugin dependencies. Please use with array of variants containing CIFilterMBS.
NSViewMBS.setBoundsOrigin(origin as NSPointMBS)
Function:
Sets the bounds origin.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
See also:
NSViewMBS.setBoundsOrigin(x as Double, y as Double)
Function:
Sets the bounds origin.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 7.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
See also:
NSViewMBS.setBoundsSize(size as NSSizeMBS)
Function:
Sets the bounds size of the nsview.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
See also:
NSViewMBS.setBoundsSize(width as Double, height as Double)
Function:
Sets the bounds size of the nsview.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 7.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
See also:
NSViewMBS.setContentFilters(Filters() as variant)
Function:
Sets an array of Core Image filters to apply to the contents of the view and its sublayers.
Notes:
This property contains an array of CIFilterMBS objects. This array represents the filters stored in the filters property of the view’s layer. If the view does not have a layer, setting the value of this property has no effect.
The default value of this property is an empty array.
We use variant here to reduce plugin dependencies. Please use with array of variants containing CIFilterMBS.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes:
This property contains an array of CIFilterMBS objects. This array represents the filters stored in the filters property of the view’s layer. If the view does not have a layer, setting the value of this property has no effect.
The default value of this property is an empty array.
We use variant here to reduce plugin dependencies. Please use with array of variants containing CIFilterMBS.
NSViewMBS.setFocus
Function:
Convenience function to set the focus to this view.
Notes: Calls internally makeFirstResponder on NSWindow.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Notes: Calls internally makeFirstResponder on NSWindow.
NSViewMBS.setFrameOrigin(origin as NSPointMBS)
Function:
Sets the frame origin.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
See also:
NSViewMBS.setFrameOrigin(x as Double, y as Double)
Function:
Sets the frame origin.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 7.7 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
See also:
NSViewMBS.setFrameSize(size as NSSizeMBS)
Function:
Sets the frame size.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
See also:
NSViewMBS.setFrameSize(width as Double, height as Double)
Function:
Sets the frame size.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 7.7 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
See also:
NSViewMBS.subviews(recursive as boolean = false) as NSViewMBS()
Function:
The immediate subviews.
Notes:
The order of the subviews may be considered as being back-to-front, but this does not imply invalidation and drawing behavior. The order is based on the order of the receiver's subviews as specified in the nib file from which they were unarchived or the programmatic interface for modifying the receiver's subview list. This ordering is also the reverse of the order in which hit-testing is done.
If recursive is true, we include all subviews of all subviews. (new in 14.2)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Notes:
The order of the subviews may be considered as being back-to-front, but this does not imply invalidation and drawing behavior. The order is based on the order of the receiver's subviews as specified in the nib file from which they were unarchived or the programmatic interface for modifying the receiver's subview list. This ordering is also the reverse of the order in which hit-testing is done.
If recursive is true, we include all subviews of all subviews. (new in 14.2)
Some examples using this method:
NSViewMBS.unregisterDraggedTypes
Function:
Unregisters the receiver as a possible destination in a dragging session.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacBase Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The items on this page are in the following plugins: MBS MacBase Plugin.
