Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSCollectionViewMBS class.

Previous items

NSCollectionViewMBS.selectAll

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Selects all items in the collection view, if doing so is possible.

This method works only when the selectable and allowsMultipleSelection properties are both true. If either property is set to false, this method quietly does nothing and any connected menu item is disabled.

This method consults the delegate object regarding the selection. Specifically, it calls the delegate’s shouldSelectItems method to see if the items should be selected. For any items that are selected, it calls the didSelectItems method.

NSCollectionViewMBS.selection as NSIndexPathMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The array of index paths representing the currently selected items.

This property reflects the index paths of the currently selected items, where each index path contains a section number and an index number for the item in that section. This property is updated automatically when the user selects items interactively. You can also change the selection programmatically by assigning a new value to this property. To animate changes to the selection, call this method on the collection view’s animator proxy object instead.
It is a programmer error to specify an index path that does not refer to a valid item in the data source. If you specify an invalid index path, this method raises an exception.
This property is key-value observable. Other methods that modify the selection automatically update this property.

NSCollectionViewMBS.selectItems(indexPaths() as NSIndexPathMBS, scrollPosition as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Adds the specified items to the current selection and optionally scrolls the items into position.

indexPaths: The index paths of the items you want to select.
scrollPosition: The options for scrolling the newly selected items into view. You may combine one vertical and one horizontal scrolling option when calling this method. Specifying more than one option for either the vertical or horizontal directions raises an exception.

Use this method to extend the current selection. If you want to animate the selection of the new items, call this method on the collection view’s animator proxy object instead. This method does not call any methods of the delegate object when making the selection.

NSCollectionViewMBS.setBackgroundColors(Colors() as NSColorMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets array containing the collection view’s background colors.

This property contains an array of NSColorMBS objects, representing the colors to use when drawing the background grid. Specifying an empty array or nil causes the collection view to use the default colors returned by the controlAlternatingRowBackgroundColors method.

When a background view is specified for the collection view, the colors in this property are ignored.

NSCollectionViewMBS.setDraggingSourceOperationMask(mask as integer, local as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Configures the default value returned from draggingSourceOperationMaskForLocal.

mask: The types of drag operations allowed.
isLocal: If true, mask applies when the drag destination object is in the same application as the receiver; if false, mask applies when the destination object is outside the receiver's application.

By default, draggingSourceOperationMaskForLocal returns NSDragOperationEvery when isLocal is true and NSDragOperationNone when isLocal is false.

Available in Mac OS X v10.5 and later.

NSCollectionViewMBS.setSelection(indexPaths() as NSIndexPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the selection.

NSCollectionViewMBS.supplementaryViewForElementKind(elementKind as String, indexPath as NSIndexPathMBS) as NSCollectionViewSectionHeaderViewMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the supplementary view associated with the specified index path.

elementKind: The kind of the supplementary views you want returned. The layout object defines the kinds of supplementary views it supports. This parameter must not be nil.
indexPath: The index path whose supplementary view you want.

Returns the view for the specified index path or nil if no view is available.

For efficiency, the collection view does not create supplementary views until they are needed. Typically, views are created only when they need to be displayed onscreen. If the collection view does not currently have a supplementary view for the specified index path, because that view would be positioned offscreen, this method returns nil.

NSCollectionViewMBS.toggleSectionCollapse(sender as NSViewMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Collapses the section in which the sender resides into a single horizontally scrollable row.

Please pass the button clicked as sender.

NSCollectionViewMBS.visibleItems as NSCollectionViewItemMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns an array of the actively managed items in the collection view.

An array of NSCollectionViewItemMBS objects. The returned array may be empty.

The items returned by this method represent the ones that are active and currently being managed by the collection view. This array may contain items that are outside of the collection view’s actual visible rectangle. For example, it may contain items that were recently visible but have since been scrolled out of view. To test whether an item is actually visible, check to see if its frame rectangle intersects the visibleRect of the collection view.

NSCollectionViewMBS.visibleSupplementaryViewsOfKind(elementKind as String) as NSViewMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns an array of the actively managed supplementary views in the collection view.

elementKind: The kind of the supplementary views you want returned. The layout object defines the kinds of supplementary views it supports. This parameter must not be nil.

Returns an array of view objects. The returned array may be empty.

The views returned by this method represent the ones that are active and are currently being managed by the collection view. The array may contain supplementary views that are outside of the collection view’s actual visible rectangle. For example, it might contain views that were recently visible but have since been scrolled out of the visible rectangle. To test whether a view is actually visible, check to see if its frame rectangle intersects the visibleRect of the collection view.

Previous items

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


💬 Ask a question or report a problem
The biggest plugin in space...