Platforms to show: All Mac Windows Linux Cross-Platform

Back to DesktopNSCollectionViewControlMBS control.

Next items

DesktopNSCollectionViewControlMBS.acceptDrop(draggingInfo as NSDraggingInfoMBS, indexPath as NSIndexPathMBS, dropOperation as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Incorporates the dropped content into the collection view.

draggingInfo: The information about the drag operation.
indexPath: The index path at which the drop occurred. Use this location as the insertion point for the content.
dropOperation: The type of drop operation to perform.

Return true if the drop operation should be accepted or false if it should be rejected.

The collection view calls this event when the user releases the mouse button while it is over a valid drop target. This event is called after the validateDrop method validates that dropping the content at the specified location is possible. You must implement this event to accept the dropped content and incorporate it into the collection view.

In your implementation, use the information in the draggingInfo parameter to retrieve the data, update your data source object, and insert the appropriate items into the collection view. The dropped data is stored in the draggingPasteboard property of the dragging information object.

If the animatesToDestination property of the dragging information is true, update the image and frame for each dragged item to its new location in the collection view.

DesktopNSCollectionViewControlMBS.BoundsChanged

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
The event called when the bounds, but not the frame, changed.

DesktopNSCollectionViewControlMBS.cancelPrefetchingForItems(indexPaths() as NSIndexPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Notifies your 'prefetchDataSource' that items at the specified 'indexPaths', for which the CollectionView previously sent prefetchItems evnet, are no longer expected to be displayed.

This is a good opportunity to cancel any pending resource fetches you've initiated for the items, if possible and worthwhile. This is only sent for items that don't end up being displayed; CollectionView doesn't cancel prefetching for items that it actually instantiates and shows.

DesktopNSCollectionViewControlMBS.canDragItems(indexPaths() as NSIndexPathMBS, NSEvent as NSEventMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Returns a Boolean indicating whether a drag operation involving the specified items can begin.

indexPaths: The index paths of the items about to be dragged.
event: The mouse-down event that began the drag operation.

Return true if the drag operation can begin or false if it cannot.

If you do not implement this event, the collection view assumes a return value of true.

DesktopNSCollectionViewControlMBS.Closing

Type Topic Version
event Cocoa Collection View 21.5

The control is about to close.
In older Xojo versions, this event is named Close.

DesktopNSCollectionViewControlMBS.ConstructContextualMenu(base as DesktopMenuItem, x as Integer, y as Integer) As Boolean

Type Topic Version
event Cocoa Collection View 22.1
This event is called when it is appropriate to display a contextual menu for the control.

DesktopNSCollectionViewControlMBS.ContextualMenuItemSelected(selectedItem As DesktopMenuItem) As Boolean

Type Topic Version
event Cocoa Collection View 21.5
Called when a menuitem is choosen.

This allows the control to react on its relevant menu items. Please return true if you handled it or false to give others a chance.

DesktopNSCollectionViewControlMBS.didChangeItems(indexPaths() as NSIndexPathMBS, highlightState as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks the delegate to approve the pending highlighting of the specified items.

indexPaths: The array of NSIndexPathMBS objects corresponding to the items being highlighted.
highlightState: The new highlight state for the items.

Returns the array of NSIndexPath objects corresponding to the items that you want to receive the specified highlight. If you do not want any items to receive the specified highlight state, return an empty set.

Use this method to approve or modify the set of items targeted to receive the specified highlight state. During interactive selection or dragging, the collection view calls this method when actions occur that would affect the highlight state of items. Your implementation of the method can return the proposed set of index paths as-is or modify the set and disallow the highlighting of some or all of the items. Removing items from the set suppresses the corresponding actions, such as selecting the item or showing its eligibility as a drop target.

If you do not implement this method, the collection view updates the highlight state for the items specified by the indexPaths parameter.

DesktopNSCollectionViewControlMBS.didCloseContextualMenu(menu as NSMenuMBS, NSEvent as NSEventMBS)   New in 24.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 24.1 ✅ Yes ❌ No ❌ No ❌ No
Did close contextual menu.

Allows you to restart any animation you may have stopped in the willShowContextualMenu event.

DesktopNSCollectionViewControlMBS.didDeselectItems(indexPaths() as NSIndexPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Notifies the delegate object that one or more items were deselected.

indexPaths: The array of NSIndexPathMBS objects corresponding to the items that were deselected.

After the user successfully deselects one or more items, the collection view calls this method to let you know that the items are no longer selected. Use this method to respond to the selection change and to make any necessary adjustments to your content or the collection view.
This method is not called when you set the selection programmatically using the methods of the NSCollectionViewMBS class.

DesktopNSCollectionViewControlMBS.didEndDisplayingItem(item as NSCollectionViewItemMBS, indexPath as NSIndexPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Notifies the delegate that the specified item was removed from the collection view.

item: The item that was removed.
indexPath: The index path of the item.

The collection view calls this method after removing an item from its content. You can use this method to track the removal of items and perform related tasks.

DesktopNSCollectionViewControlMBS.didEndDisplayingSupplementaryView(view as NSViewMBS, elementKind as String, indexPath as NSIndexPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Notifies the delegate that the specified supplementary view was removed from the collection view.

view: The supplementary view that was removed.
elementKind: The type of the supplementary view. Layouts are responsible for defining the types of supplementary views they support.
indexPath: The index path associated with the supplementary view.

The collection view calls this method after removing a supplementary view from its content. You can use this method to track the removal of views and perform related tasks.

DesktopNSCollectionViewControlMBS.didSelectItems(indexPaths() as NSIndexPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Notifies the delegate object that one or more items were selected.

collectionView: The collection view notifying you of the selection change.
indexPaths: The array of NSIndexPathMBS objects corresponding to the items that are now selected.

After the user successfully selects one or more items, the collection view calls this method to let you know that the selection has been made. Use this method to respond to the selection change and to make any necessary adjustments to your content or the collection view.
This method is not called when you set the selection programmatically using the methods of the NSCollectionViewMBS class.

DesktopNSCollectionViewControlMBS.draggingImageForItems(indexPaths() as NSIndexPathMBS, NSEvent as NSEventMBS, byref dragImageOffset as NSPointMBS) as NSImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Creates and returns a drag image to represent the specified items during a drag.

indexPaths: The index paths of the items being dragged.
NSEvent: The mouse-down event that began the drag operation. You can use the mouse location when determining what value to return in the dragImageOffset parameter.
dragImageOffset: The offset value to use when positioning the image. On input, the point is NSZeroPoint, which centers the returned image under the mouse. Your method can return a different point that repositions the drag image by the specified offset values.

Return the image to use for the dragged items.

Your implementation of this event should create an appropriate image to use during the drag operation. The collection view places the center of your image at the current mouse location. Update the value in the dragImageOffset parameter to shift the position of your image by the specified amount.
If you do not implement this event, the collection view uses the drag image returned by the draggingImageForItemsAtIndexPaths method instead.

DesktopNSCollectionViewControlMBS.draggingSessionEnded(session as NSDraggingSessionMBS, screenPoint as NSPointMBS, dragOperation as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Notifies your delegate that a drag session ended.

session: The dragging session that ended.
screenPoint: The end point (in screen coordinates) for the drag operation.
operation: The operation that was performed. Use this value to determine how the operation ended. For example, for content that was dragged to the trash, the operation type would be NSDragOperationDelete (32).

You can use this method to perform tasks related to the ending of a drag session.

DesktopNSCollectionViewControlMBS.draggingSessionWillBegin(session as NSDraggingSessionMBS, screenPoint as NSPointMBS, indexPaths() as NSIndexPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Notifies your delegate that a drag session is about to begin.

session: The dragging session that is about to begin.
screenPoint: The starting point (in screen coordinates) for the drag operation. (in Cocoa coordinate system with bottom = zero)
indexPaths: The index paths of the items being dragged.

You can use this method to modify the dragging session or to perform other tasks related to the beginning of a drag session.

DesktopNSCollectionViewControlMBS.FocusLost

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No

The control lost focus.
In older Xojo versions, this event is named LostFocus.

This only fires if the control itself lost focus and not a sub control.

DesktopNSCollectionViewControlMBS.FocusReceived

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No

The control itself got focus.
In older Xojo versions, this event is named GotFocus.

This only fires if the control itself got focus and not a sub control.

DesktopNSCollectionViewControlMBS.FrameChanged

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
The event called when the frame changed.

This event notifies you, that the control changed it's bounding frame, which is position and/or size.

DesktopNSCollectionViewControlMBS.insetForSectionAtIndex(layout as NSCollectionViewLayoutMBS, section as Integer) as NSEdgeInsetsMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks you for the margins to apply to content in the specified section.

collectionViewLayout: The layout object requesting the information.
section: The index of the section whose margins are needed.

Return the margins to apply to items in the specified section.

Implement this method when you want to provide margins for sections in the flow layout. Your implementation can return the same margins for all sections or it can return different margins for different sections. You can also adjust the margins of each section dynamically each time you update the layout. If you do not implement this method, the margins are obtained from the properties of the flow layout object.

The insets you return reflect the spacing between the items and the header and footer views of the section. They also reflect the spacing at the edges of a single row or column. For more information about how insets are applied, see the description of the sectionInset property.

DesktopNSCollectionViewControlMBS.ItemApplyLayoutAttributes(item as NSCollectionViewItemMBS, layoutAttributes as NSCollectionViewLayoutAttributesMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Applies the specified layout attributes to the element.

In your custom elements, you can use this method to apply the specified attributes to your content. For example, if your element object is a view controller, you would override this method and use it to apply the attributes to the root view object. When using your element with a layout object that supports custom attributes, you would also use this method to apply those custom attributes.

DesktopNSCollectionViewControlMBS.ItemDidTransition(item as NSCollectionViewItemMBS, oldLayout as NSCollectionViewLayoutMBS, newLayout as NSCollectionViewLayoutMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Tells the element that the layout object of the collection view changed.

oldLayout: The collection view’s previous layout object.
newLayout: The current layout object associated with the collection view.

The default implementation of this method does nothing. Subclasses can override it and use it to finalize any behaviors associated with the change in layouts.

In OS X 10.11, this method is never called.

DesktopNSCollectionViewControlMBS.itemForRepresentedObject(indexPath as NSIndexPathMBS) as NSCollectionViewItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks your data source object to provide the item at the specified location in the collection view.

indexPath: The index path that specifies the location of the item. This index path contains both the section index and the item index within that section.

Returns a configured item object. You must not return nil from this method.

All data source objects must implement this method. Your implementation is responsible for creating, configuring, and returning the appropriate item object based on the specified index path. You do this by calling the makeItem() method of the collection view to retrieve an empty item object of the appropriate type. After receiving the item object, update its properties with the data from your app’s data structures and return it.
You do not need to set the frame of an item’s view from this method. The collection view gets the item’s location and other layout-related attributes from the layout object during a separate step.

DesktopNSCollectionViewControlMBS.ItemPreferredLayoutAttributesFittingAttributes(item as NSCollectionViewItemMBS, layoutAttributes as NSCollectionViewLayoutAttributesMBS) as NSCollectionViewLayoutAttributesMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks your element if it wants to modify any layout attributes before they are applied.

layoutAttributes: The attributes provided by the layout object. These attributes represent the values that the layout object intends to apply to the element.

Return the final attributes to apply to the element.

The default implementation of this method returns the same attributes that are in the layoutAttributes parameter. You can override this method in subclasses and use it to return a different set of attributes. If you override this method, call super first to give the system the opportunity to make changes, then modify the returned attributes.

DesktopNSCollectionViewControlMBS.ItemPrepareForReuse(item as NSCollectionViewItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Performs any necessary cleanup to prepare the element for use again.

The recycling of content is an important technique for improving performance of a collection view. Instead of creating all views from scratch, the collection view recycles views and view controllers that move offscreen. When your app subsequently calls the makeItem or makeSupplementaryViewOfKind method, the collection view retrieves a recycled object from the appropriate storage, calls this method, and then returns the object to your app.

Implement this method when you need to delete old data or when you want to restore your recycled views to a standard initial state prior to their reuse. For example, you might use this method to restore the size of a view to some standard size or reset the alpha to 1.0 to ensure that the view is fully opaque. Do not use this method to configure the view with new data. Restoring your views to a default state in this method simplifies the configuration code you must write in your data source object later.

DesktopNSCollectionViewControlMBS.ItemWillTransition(item as NSCollectionViewItemMBS, oldLayout as NSCollectionViewLayoutMBS, newLayout as NSCollectionViewLayoutMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Tells the element that the layout object of the collection view is about to change.

oldLayout: The current layout object used by the collection view.
newLayout: The new layout object that is about to be used by the collection view.

The default implementation of this method does nothing. Subclasses can override it and use it to prepare for the change in layouts.

Special Considerations
In OS X 10.11, this method is never called.

DesktopNSCollectionViewControlMBS.MenuBarSelected

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No

The event where you can enable menu items.
In older Xojo versions, this event is named EnableMenuItems.

DesktopNSCollectionViewControlMBS.minimumInteritemSpacingForSectionAtIndex(layout as NSCollectionViewLayoutMBS, section as Integer) as double

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks you for the spacing between successive items of a single row or column.

collectionViewLayout: The layout object requesting the information.
section: The index of the section whose inter-item spacing is needed.

Return the minimum space (in points) to apply between successive items in a single row or column.

Implement this method when you want to provide custom inter-item spacing for sections in the flow layout. Your implementation can return the same spacing for all sections or it can return different spacing for different sections. You can also adjust the inter-item spacing of each section dynamically each time you update the layout. If you do not implement this method, the inter-item spacing is obtained from the properties of the flow layout object.

For a vertically scrolling layout, this value represents the minimum spacing between items in the same row. For a horizontally scrolling layout, this value represents the minimum spacing between items in the same column. The layout object uses this spacing only to compute how many items can fit in a single row or column. The actual spacing may be increased after the number of items has been determined. For more information about how inter-item spacing is applied, see the description of the minimumInteritemSpacing property.

DesktopNSCollectionViewControlMBS.minimumLineSpacingForSectionAtIndex(layout as NSCollectionViewLayoutMBS, section as Integer) as double

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks you for the spacing between successive rows or columns of a section.

collectionViewLayout: The layout object requesting the information.
section: The index of the section whose line spacing is needed.

Returns the minimum space (in points) to apply between successive lines in a section.

Implement this method when you want to provide custom line spacing for sections in the flow layout. Your implementation can return the same line spacing for all sections or it can return different line spacing for different sections. You can also adjust the line spacing of each section dynamically each time you update the layout. If you do not implement this method, the line spacing is obtained from the properties of the flow layout object.

For a vertically scrolling layout, this value represents the minimum spacing between successive rows. For a horizontally scrolling layout, this value represents the minimum spacing between successive columns. This spacing is not applied to the space between the header and the first line or between the last line and the footer. For more information about how line spacing is applied, see the description of the minimumLineSpacing property.

DesktopNSCollectionViewControlMBS.MouseDown(x as Integer, y as Integer, Modifiers as Integer) As Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
The mouse button was pressed inside the control’s region at the location passed in to x, y.

The coordinates x and y are local to the control, i.e. they represent the position of the mouse click relative to the upper-left corner or the Control.
Return True if you are going to handle the MouseDown. In such a case:

  • The Action event, if any, will not execute and the state of the object will not change.
  • You will receive the MouseDrag and MouseUp events.
If you return False, the system handles the MouseDown so the above event handlers do not get called.

DesktopNSCollectionViewControlMBS.MouseDrag(x as Integer, y as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
This event fires continuously after the mouse button was pressed inside the Control.

Mouse location is local to the control passed in to x, y.
As this event is fired continuously (hundreds of time per second), it is your responsibility to determine if the mouse has really moved.

DesktopNSCollectionViewControlMBS.MouseUp(x As Integer, y As Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
The mouse button was released.

Use the x and y parameters to determine if the mouse button was released within the control's boundaries.

DesktopNSCollectionViewControlMBS.namesOfPromisedFilesDroppedAtDestination(dropURL as String, indexPaths() as NSIndexPathMBS) as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Returns the names of the promised files that you created for a drag operation.

dropURL: The URL at which to create the promised files.
indexPaths: The index paths of the dragged items.

Return an array of strings containing the filenames you created, or intend to create, at the specified URL.

At the start of a drag operation, your app must provide the data that constitutes the items being dragged. If you specify a file promise, instead of the data itself, use this method to specify the names of the files you promised. If the files already exist, move them to the directory specified by the dropURL parameter. If you must create the files first, use this method to specify the names of the files you intend to provide and begin creating those files asynchronously on a background thread.

The filenames you return are made available from the namesOfPromisedFilesDroppedAtDestination method of the NSDraggingInfo object passed around during the drag operation.

DesktopNSCollectionViewControlMBS.numberOfItemsInSection(section as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks your data source object to provide the number of items in the specified section.

All data source objects must implement this event. Your implementation should quickly return the number of items in the specified section.
Make sure the number of items you return is accurate. The itemForRepresentedObject event must be able to provide a visual representation for each item in the section.

DesktopNSCollectionViewControlMBS.numberOfSections as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks your data source object to provide the total number of sections.

Implement this method when the organization of your data requires more than one section. If you do not implement this method, the collection view creates only one section.

DesktopNSCollectionViewControlMBS.Opening

Type Topic Version
event Cocoa Collection View 21.5

The control is about to was created and you can initialize it.
In older Xojo versions, this event is named Open.

DesktopNSCollectionViewControlMBS.pasteboardWriterForItem(indexPath as NSIndexPathMBS) as NSPasteboardItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Provides the pasteboard writer for the item at the specified index path.

collectionView: The collection view making the request.
indexPath: The index path of the item requiring a pasteboard writer.

Returns the pasteboard writer object to use for managing the item data. Return nil to prevent the collection view from dragging the item.

You must implement this method or the collectionView:writeItemsAtIndexPaths method to support drag operations. The collection view calls this method in preference over the writeItemsAtIndexPaths method if both are implemented. If your app supports multi-image drag and drop, you must implement this method.

The collection view calls this method for each item involved in the drag operation after it has determined that a drag should begin but before the drag operation has started. Your implementation of this method should create and return the pasteboard writer—an object conforming to the NSPasteboardWriting protocol—to use for providing the item’s data. Using the object you provide, the collection view creates an NSDraggingItem object for you and configures its draggingFrame and imageComponents properties for you using information from the item at the specified index path.
If you implement this method, the collection view does not call the draggingImageForItemsAtIndexPaths of your delegate or the draggingImageForItemsAtIndexPaths method of NSCollectionView.

DesktopNSCollectionViewControlMBS.performBatchUpdatesCompleted(tag as variant, finished as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
A event to execute when the changes made in the performBatchUpdatesWork events have finished animating.

finished: A Boolean value indicating whether the animations completed successfully. The value of this parameter is true if the animations ran to completion or false if they were interrupted.

DesktopNSCollectionViewControlMBS.performBatchUpdatesWork(tag as variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
The event that performs the needed inset, delete, reload, or move operations.

DesktopNSCollectionViewControlMBS.prefetchItems(indexPaths() as NSIndexPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Notifies your 'prefetchDataSource' that items at the specified 'indexPaths' are likely to be instantiated and displayed soon.

The CollectionView sends this as early as possible, to give your 'prefetchDataSource' the opportunity to begin acquiring any resources such as thumbnail images or metadata that you might need in order to prepare the item's content for display. The given 'indexPaths' are sorted by the order in which they are likely to be needed.

DesktopNSCollectionViewControlMBS.referenceSizeForFooterInSection(layout as NSCollectionViewLayoutMBS, section as Integer) as NSSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks you for the size of the footer view in the specified section.

collectionViewLayout: The layout object requesting the information.
section: The index of the section whose footer size is requested.

The size of the footer. Return NSZeroSize if you do not want a footer added to the section.

If you implement this method, the flow layout object calls it to obtain the size of the footer in each section and uses that information to set the size of the corresponding views. If you do not implement this method, the footer size is obtained from the properties of the flow layout object.

The flow layout object uses only one of the returned size values. For a vertically scrolling layout, the layout object uses the height value. For a horizontally scrolling layout, the layout object uses the width value. The other value is sized appropriately to match the opposing dimension of the collection view itself. Set the size of the footer to 0 to prevent it from being displayed.

DesktopNSCollectionViewControlMBS.referenceSizeForHeaderInSection(layout as NSCollectionViewLayoutMBS, section as Integer) as NSSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks you for the size of the header view in the specified section.

collectionViewLayout: The layout object requesting the information.
section: The index of the section whose header size is requested.

Returns the size of the header. Return NSZeroSize if you do not want a header added to the section.

If you implement this method, the flow layout object calls it to obtain the size of the header in each section and uses that information to set the size of the corresponding views. If you do not implement this method, the header size is obtained from the properties of the flow layout object.

The flow layout object uses only one of the returned size values. For a vertically scrolling layout, the layout object uses the height value. For a horizontally scrolling layout, the layout object uses the width value. The other value is sized appropriately to match the opposing dimension of the collection view itself. Set the size of the header to 0 to prevent it from being displayed.

DesktopNSCollectionViewControlMBS.ScaleFactorChanged(NewFactor as double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
The backing store scale factor has changed.

Please invalidate any cached bitmaps or other relevant state.

DesktopNSCollectionViewControlMBS.shouldChangeItems(indexPaths() as NSIndexPathMBS, highlightState as Integer) as NSIndexPathMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Collection View MBS MacControls Plugin 21.5 ✅ Yes ❌ No ❌ No ❌ No
Asks the delegate to approve the pending highlighting of the specified items.

indexPaths: The set of NSIndexPathMBS objects corresponding to the items being highlighted.
highlightState: The new highlight state for the items.

Return the set of NSIndexPath objects corresponding to the items that you want to receive the specified highlight. If you do not want any items to receive the specified highlight state, return an empty set.

Use this method to approve or modify the set of items targeted to receive the specified highlight state. During interactive selection or dragging, the collection view calls this method when actions occur that would affect the highlight state of items. Your implementation of the method can return the proposed set of index paths as-is or modify the set and disallow the highlighting of some or all of the items. Removing items from the set suppresses the corresponding actions, such as selecting the item or showing its eligibility as a drop target.
If you do not implement this method, the collection view updates the highlight state for the items specified by the indexPaths parameter.

Next items

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


The biggest plugin in space...