Platforms to show: All Mac Windows Linux Cross-Platform

Next items

NSCollectionViewMBS.backgroundColors as NSColorMBS()
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: An array containing the collection view’s background colors.
Notes:
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.

Feedback, Comments & Corrections

NSCollectionViewMBS.Constructor
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: The constructor for a new NSCollectionView object.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.Constructor(Handle 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
Function: The constructor.
Notes: Pass a valid handle to a NSTextField to initialize.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.Constructor(left as double, top as double, width as double, height as double)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: The constructor for a new custom NSTextField object.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.deleteItems(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
Function: Deletes the items at the specified index paths.
Example:
// remove item at index

Dim index As Integer = 1

// remove from data source
MainWindow.items.RemoveAt(index)

// remove also from view
Dim items() As NSIndexPathMBS
items.Append NSIndexPathMBS.indexPathForItem(index)

MainWindow.collectionView.deleteItems items
Notes:
indexPaths: A set of NSIndexPathMBS objects, each of which includes a section and item index corresponding to the insertion point of a single item. Specifying nil for this parameter raises an exception.

After removing items from your data source object, use this method to synchronize those changes with the collection view. Calling this method lets the collection view know that it must update its internal data structures and possibly update its visual appearance. In response, the collection view asks the layout object to update the positions of the remaining objects. If the layout object indicates that there are changes to the visible items, the collection view animates the affected items into place.

When inserting or deleting multiple sections and items, you can animate all of your changes at once using the performBatchUpdates method.

Feedback, Comments & Corrections

NSCollectionViewMBS.deleteSections(sections as NSIndexSetMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Deletes the specified sections and their contained items.
Notes:
sections: An index set containing the indexes of the sections that you want to delete. This parameter must not be nil.

Use this method to delete entire sections and their contained items. Always update your data source object before calling this method. Calling this method kicks off an update (and possible animations) to delete the specified sections. Specifically, the collection view asks the layout object for the final layout attributes for any deleted sections and may also ask for updated layout attributes for any remaining sections. If the layout attributes of any visible items changed, those changes are animated into place.

When inserting or deleting multiple sections and items, you can animate all of your changes at once using the performBatchUpdates method.

Feedback, Comments & Corrections

NSCollectionViewMBS.deselectAll
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Deselects all items in the collection view.
Notes:
This method works only when the selectable and allowsEmptySelection properties are both true YES. 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 shouldDeselectItems method to see if the items should be selected. For any items that are selected, it calls the didDeselectItems method.

Feedback, Comments & Corrections

NSCollectionViewMBS.deselectItems(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
Function: Removes the specified items from the current selection.
Notes:
indexPaths: The index paths of the items you want to deselect.

Use this method to reduce the current selection. If you want to animate the deselection 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.

Feedback, Comments & Corrections

NSCollectionViewMBS.frameForItem(Index as Integer) as NSRectMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Returns the frame of the collection view item at the specified index.
Notes:
index: The index of the collection view item.

Return the frame calculated by the receiver where it intends to place the subview for the NSCollectionViewItem at the given index. The rectangle is returned in the collection view’s coordinate system.

You can use this method in the draggingImageForItemsAtIndexes method to determine which views are in the visible portion of the enclosing scroll view.
Overriding this method will have no effect on the collection view’s subview layout.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.frameForItem(Index as Integer, numberOfItems as Integer) as NSRectMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Returns the frame of the collection view item at the specified index.
Notes:
index: The index of the collection view item.

Returns the frame calculated by the receiver where it intends to place the subview for the NSCollectionViewItem at the given index. The rectangle is returned in the collection view’s coordinate system.

You can use this method in the draggingImageForItemsAtIndexes method to determine which views are in the visible portion of the enclosing scroll view.
Overriding this method will have no effect on the collection view’s subview layout.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.indexPathForItem(indexPath as NSCollectionViewItemMBS) 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
Function: Returns the index path of the specified item.
Notes: Returns the item’s index path or nil if the item is not in the collection view.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.indexPathForItem(x as double, y as double) 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
Function: Returns the index path of the specified item.
Example:
// remove item at index

Dim index As Integer = 1

// remove from data source
MainWindow.items.RemoveAt(index)

// remove also from view
Dim items() As NSIndexPathMBS
items.Append NSIndexPathMBS.indexPathForItem(index)

MainWindow.collectionView.deleteItems items
Notes: Returns the item’s index path or nil if the item is not in the collection view.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.indexPathsForVisibleItems 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
Function: Returns the index paths of the currently active items.
Notes:
The set of NSIndexPathMBS objects corresponding to the currently visible items.

The index paths returned by this method belong to items that are active and currently being managed by the collection view. As a result, the returned set may include index paths for items that are outside of the collection view’s actual visible rectangle. For example, it may contain index paths for items that were recently visible but have since been scrolled out of view. To test whether an item is visible, check to see if its frame rectangle intersects the visibleRect of the collection view.

Feedback, Comments & Corrections

NSCollectionViewMBS.indexPathsForVisibleSupplementaryElementsOfKind(elementKind as String) 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
Function: Returns the index paths of the currently active supplementary views.
Notes:
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.

Return the set of NSIndexPathMBS objects. The returned array may be empty.

The index paths returned by this method correspond to supplementary views that are active and currently being managed by the collection view. The set may include index paths for views that are outside of the collection view’s actual visible rectangle. For example, it might contain index paths for 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.

Feedback, Comments & Corrections

NSCollectionViewMBS.insertItems(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
Function: Inserts new items into the collection view at the specified locations.
Notes:
indexPaths: A set of NSIndexPathMBS objects, each of which includes a section and item index corresponding to the insertion point of a single item. Specifying nil for this parameter raises an exception.

After adding new items to your data source object, use this method to synchronize those changes with the collection view. Calling this method lets the collection view know that it must update its internal data structures and possibly update its visual appearance. In response, the collection view asks the layout object for information about the new objects. If the layout object indicates that the new items should appear onscreen, the collection view asks the data source to provide the appropriate content, animating that content into position as needed.

When inserting or deleting multiple sections and items, you can animate all of your changes at once using the performBatchUpdates method.

Feedback, Comments & Corrections

NSCollectionViewMBS.insertSections(sections as NSIndexSetMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Inserts new sections at the specified indexes.
Notes:
sections: An index set containing the indexes at which you want to insert new sections. This parameter must not be nil.

This method tells the collection view to insert the specified sections and update itself. Always update your data source object before calling this method. Calling this method kicks off an update (and possible animations) to add the new sections. Specifically, the collection view asks the layout object for any updated layout attributes related to the new sections or any existing sections. If the layout attributes of any visible items changed, those changes are animated into place.

When inserting or deleting multiple sections and items, you can animate all of your changes at once using the performBatchUpdates method.

Feedback, Comments & Corrections

NSCollectionViewMBS.item(index as Integer) 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
Function: Returns the item associated with the specified index path.
Notes:
The item for the specified index path or nil if no item is available.

For efficiency, the collection view does not create items until they are needed, and usually it creates them only when they need to be displayed onscreen. If the collection view does not currently have an item for the specified index path, because that item would be positioned offscreen, this method returns nil.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.item(indexPath as NSIndexPathMBS) 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
Function: Returns the item associated with the specified index path.
Notes:
The item for the specified index path or nil if no item is available.

For efficiency, the collection view does not create items until they are needed, and usually it creates them only when they need to be displayed onscreen. If the collection view does not currently have an item for the specified index path, because that item would be positioned offscreen, this method returns nil.

See also:

Feedback, Comments & Corrections

NSCollectionViewMBS.layoutAttributesForItem(indexPath as NSIndexPathMBS) as NSCollectionViewLayoutAttributesMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Returns the layout information for the item at the specified index path.
Notes:
The layout attributes of the item or nil if no item exists at the specified path.

This method updates the layout information as needed before returning the specified attributes. Always use this method to retrieve the layout attributes for items in the collection view. Do not query the layout object directly.

Feedback, Comments & Corrections

NSCollectionViewMBS.layoutAttributesForSupplementaryElementOfKind(kind as String, indexPath as NSIndexPathMBS) as NSCollectionViewLayoutAttributesMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Returns the layout information for the supplementary view at the specified index path.
Notes:
kind: The kind of the supplementary view whose attributes you want. The layout object defines the kinds of supplementary views it supports. This parameter must not be nil.
indexPath: The index path of the supplementary view. Normally, this path

Returns the layout attributes of the supplementary view or nil if no item exists at the specified path.

This method updates the layout information as needed before returning the specified attributes. Always use this method to retrieve the layout attributes for supplementary views in the collection view. Do not query the layout object directly.

Feedback, Comments & Corrections

NSCollectionViewMBS.makeItem(indexPath as NSIndexPathMBS) 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
Function: Creates or returns a reusable item object of the specified type.
Notes: indexPath: The index path specifying the location of the item. The data source object receives this information in its itemForRepresentedObjectAtIndexPath method and you should just pass it along.

Some examples using this method:

Feedback, Comments & Corrections

NSCollectionViewMBS.makeSupplementaryViewOfKind(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
Function: Creates or returns a reusable supplementary view of the specified type.
Notes:
elementKind: The kind of supplementary view to create. This value is defined by the layout object. This parameter must not be an empty string or nil.
identifier: The reuse identifier for the specified item. This is the identifier you specified when registering the supplementary view. This parameter must not be nil.
indexPath: The index path specifying the location of the supplementary view. The data source object receives this information in its viewForSupplementaryElementOfKind method and you should just pass it along.

Returns a view that adopts the NSCollectionViewElement protocol, e.g. a NSCollectionViewSectionHeaderViewMBS object.

This method looks for a recycled supplementary view of the specified type and returns it if one exists. If one does not exist, it creates it one.

Feedback, Comments & Corrections

NSCollectionViewMBS.moveItem(indexPath as NSIndexPathMBS, toIndexPath 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
Function: Moves an item from one location to another in the collection view.
Notes:
indexPath: The index path of the item that you want to move. This parameter must not be nil.
newIndexPath: The index path of the item’s new location. This parameter must not be nil.

After rearranging items in your data source object, use this method to synchronize those changes with the collection view. Calling this method lets the collection view know that it must update its internal data structures and possibly update its visual appearance. You can move the item to a different section or to a new location in the same section. The collection view updates the layout as needed to account for the move, animating cells into position in response.

When inserting or deleting multiple sections and items, you can animate all of your changes at once using the performBatchUpdates method.

Feedback, Comments & Corrections

NSCollectionViewMBS.moveSection(section as Integer, toSection 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
Function: Moves a section from its current location to a new location.
Notes:
section: The index of the section that you want to move.
newSection: The new index at which to insert the section.

Use this method to reorganize sections and their contained items. Always update your data source object before calling this method. Calling this method kicks off an update (and possible animations) to move the specified section to its new location. Specifically, the collection view asks the layout object for any updated layout attributes related to the new sections or any existing sections. If the layout attributes of any visible items changed, those changes are animated into place.

When inserting or deleting multiple sections and items, you can animate all of your changes at once using the performBatchUpdates method.

Feedback, Comments & Corrections

NSCollectionViewMBS.numberOfItemsInSection(section as Integer) 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
Function: Returns the number of items in the specified section.
Notes:
section: The index of the section whose item count you want. This index is 0-based.

Returns the number of items in the section.

Use this method to get the number of items currently displayed by the collection view for the specified section. Do not call the methods of the data source to get this information.

Feedback, Comments & Corrections

NSCollectionViewMBS.reloadData
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Reloads all of the data for the collection view.
Notes:
Call this method when the data in your data source object changes or when you want to force the collection view to update its contents. When you call this method, the collection view discards any currently visible items and views and redisplays them. For efficiency, the collection view displays only the items and supplementary views that are visible after reloading the data. If the collection view’s size changes as a result of reloading the data, the collection view adjusts its scrolling offsets accordingly.
Do not call this method in the middle of animation blocks where items are being inserted or deleted. The methods used to insert and delete items automatically update the collection view’s contents.

Feedback, Comments & Corrections

NSCollectionViewMBS.reloadItems(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
Function: Reloads only the specified items.
Notes:
indexPaths: The index paths of the specific items that you want to reload. Specifying nil for this parameter raises an exception.

Call this method to update specific items in your collection view. You call this method when the underlying data for those items changes and you want to update the visual appearance of those items. When you call this method, the collection view discards the specified items and asks your data source to provide new ones. For efficiency, the collection view requests only the items that are visible.

Feedback, Comments & Corrections

NSCollectionViewMBS.reloadSections(sections as NSIndexSetMBS)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Collection View MBS MacControls Plugin 21.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Function: Reloads the data in the specified sections of the collection view.
Notes:
sections: The indexes of the sections that you want to reload. Specifying nil for this parameter raises an exception.

Call this method when the data for the specified sections changes or when you want to force the appearance of those sections to be updated. When you call this method, the collection view discards visible elements in the section along with any cached attributes for those elements. For efficiency, it then asks the layout object to provide fresh attributes for only the visible items and views and requests new views for those elements.
Do not call this method in the middle of animation blocks where items are being inserted or deleted. The methods used to insert and delete items automatically update the collection view’s contents.

Feedback, Comments & Corrections

NSCollectionViewMBS.scrollToItems(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
Function: Scrolls the collection view contents until the specified items are visible.
Example:
dim collectionView as NSCollectionViewMBS

Dim itemPaths() As NSIndexPathMBS
itemPaths.Append NSIndexPathMBS.indexPathForItem(0)

collectionView.scrollToItems(itemPaths, NSCollectionViewMBS.NSCollectionViewScrollPositionTop)
Notes:
indexPaths: The index paths of the items. The layout attributes of these items define the bounding box that needs to be scrolled onscreen.
scrollPosition: The options for scrolling the bounding box of the specified 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.

To animate the scrolling operation, call this method on the collection view’s animator proxy object instead.

Feedback, Comments & Corrections

Next items

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

The biggest plugin in space...




Links
MBS Xojo Chart Plugins

Start Chat