Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSSplitViewControlMBS control.

NSSplitViewControlMBS.BoundsChanged

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
The event called when the bounds, but not the frame, changed.

NSSplitViewControlMBS.canCollapseSubview(subview as NSViewMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Allows the delegate to determine whether the user can collapse and expand the specified subview.

subview: The subview to collapse.

Returns true if subview collapses when the user drags a divider beyond the halfway mark between its minimum size and its edge; otherwise, false.

The subview expands when the user drags the divider beyond the halfway mark between its minimum size and its edge.

To specify the minimum size, define the constrainMaxCoordinate and constrainMinCoordinate events. A subview can collapse only if you also define constrainMinCoordinate.
A collapsed subview isn’t visible, but the split view object retains it with the same size as before the collapse.
If the events are implemented, the subviews can’t collapse.

NSSplitViewControlMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No

The control is about to close.
In Xojo version 2021r3 and newer this event is named Closing.

NSSplitViewControlMBS.Closing

Type Topic Version
event Cocoa Controls 23.4

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

NSSplitViewControlMBS.constrainMaxCoordinate(proposedMaximumPosition as double, dividerIndex as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Allows the delegate to constrain the maximum coordinate limit of a divider when the user drags it.

proposedMax: The proposed maximum coordinate limit of the subview in the split view’s flipped coordinate system.
dividerIndex: Specifies the divider the user is moving, with the first divider being 0 and increasing from top to bottom (or left to right).

Returns the maximum coordinate limit of the divider.

The delegate receives this message before the split view begins tracking the mouse to position a divider. You can further constrain the limits, but you can’t extend the divider limits.
If the split bars are horizontal (views are one on top of the other), proposedMax is the bottom limit. If the split bars are vertical (views are side by side), proposedMax is the right limit. The initial value of proposedMax is the bottom (or right side) of the subview after the divider.

NSSplitViewControlMBS.constrainMinCoordinate(proposedMinimumPosition as double, dividerIndex as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Allows the delegate to constrain the minimum coordinate limit of a divider when the user drags it.

proposedMin: The proposed minimum coordinate limit of the subview in the split view’s flipped coordinate system.
dividerIndex: Specifies the divider the user is moving, with the first divider being 0 and increasing from top to bottom (or left to right).

Returns the minimum coordinate limit of the divider.

The delegate receives this message before the split view begins tracking the cursor to position a divider. You can further constrain the limits, but you can’t extend the divider limits.
If the split bars are horizontal (views are one on top of the other), proposedMin is the top limit. If the split bars are vertical (views are side by side), proposedMin is the left limit. The initial value of proposedMin is the top (or left side) of the subview before the divider.

NSSplitViewControlMBS.constrainSplitPosition(proposedPosition as double, dividerIndex as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Allows the delegate to constrain the divider to certain positions.

proposedPosition: The cursor’s current position, and the proposed position of the divider.
dividerIndex: The index of the divider the user is moving, with the first divider being 0 and increasing from top to bottom (or left to right).

Returns the position for constraining the divider.

If the delegate implements this method, the split view calls it repeatedly as the user moves the divider.
If a subview’s height must be a multiple of a certain number, use this method to return the multiple nearest to proposedPosition.

NSSplitViewControlMBS.ConstructContextualMenu(base as MenuItem, x as Integer, y as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
This event is called when it is appropriate to display a contextual menu for the control.

NSSplitViewControlMBS.ContextualMenuAction(hitItem as MenuItem) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
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.

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa 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.

NSSplitViewControlMBS.drawDivider(graphics as NSGraphicsMBS, Rect as NSRectMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Draws a divider between two of the split view’s subviews.
Example
Function drawDivider(graphics as NSGraphicsMBS, Rect as NSRectMBS) Handles drawDivider as Boolean

// draw a red box with blue border
graphics.setFillColor NSColorMBS.redColor
graphics.setStrokeColor NSColorMBS.blueColor

Dim r As New NSRectMBS(rect.X, rect.y + rect.Height/2 - 5, 10, 10)
graphics.fillRect r
graphics.strokeRect r

Return True
End Function

Rect: The entire divider rectangle in the split view’s flipped coordinate system.

If you override this method to use a custom style for the divider, you may need to change the size of the divider.

NSSplitViewControlMBS.EnableMenuItems

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No

The event where you can enable menu items.
In Xojo version 2021r3 and newer this event is named MenuBarSelected.

NSSplitViewControlMBS.FocusLost

Type Topic Version
event Cocoa Controls 23.4

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.

NSSplitViewControlMBS.FocusReceived

Type Topic Version
event Cocoa Controls 23.4

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.

NSSplitViewControlMBS.FrameChanged

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ 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.

NSSplitViewControlMBS.GotFocus

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No

The control itself got focus.
In Xojo version 2021r3 and newer this event is named FocusReceived.

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

NSSplitViewControlMBS.LostFocus

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No

The control lost focus.
In Xojo version 2021r3 and newer this event is named FocusLost.

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

NSSplitViewControlMBS.MenuBarSelected

Type Topic Version
event Cocoa Controls 23.4

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

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ 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.

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ 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.

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ 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.

NSSplitViewControlMBS.Open

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No

The control is about to was created and you can initialize it.
In Xojo version 2021r3 and newer this event is named Opening.

NSSplitViewControlMBS.Opening

Type Topic Version
event Cocoa Controls 23.4

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

NSSplitViewControlMBS.resizeSubviewsWithOldSize(oldSize as NSSizeMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Allows the delegate to specify custom sizing behavior for the subviews of the split view.

oldSize: The size of the split view before the user resizes it.

If the delegate implements this method, it receives this message after the split view resizes.

Resize the subviews so that the sum of the sizes of the subviews plus the sum of the thickness of the dividers equals the size of the new frame of the NSSplitView. You can get the thickness of a divider through the dividerThickness method.

If you implement this delegate method to resize subviews on your own, the NSSplitViewMBS doesn’t perform any error checking for you. However, you can invoke adjustSubviews() to perform the default sizing behavior.

NSSplitViewControlMBS.ScaleFactorChanged(NewFactor as double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
The backing store scale factor has changed.

Please invalidate any cached bitmaps or other relevant state.

NSSplitViewControlMBS.shouldAdjustSizeOfSubview(view as NSViewMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Allows the delegate to specify whether to resize the subview.

subview: The subview to resize.

If adjustSubviews() can change the size of the subview, return true; otherwise, false. By returning false, you lock the size of the split view subview while the split view resizes.

Regardless of the value that this method returns, adjustSubviews() may change the origin of the subview. Nonresizable subviews may resize to prevent an invalid subview layout.
If a split view has no delegate, or if its delegate doesn’t respond to this message, the split view behaves as if this method returns true.

NSSplitViewControlMBS.shouldHideDivider(dividerIndex as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Allows the delegate to determine whether the user can drag a divider or adjust it off the edge of the split view.

dividerIndex: The zero-based index of the divider.

Return true if the user can drag the divider off the edge of the split view, resulting in it not being visible.

If a split view has no delegate, or if its delegate doesn’t respond to this message, the split view behaves as if it has a delegate that returns false when it receives this message.

NSSplitViewControlMBS.splitViewDidResizeSubviews

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Notifies the delegate when the split view resizes its subviews.

The control invokes this event after the split view resizes two of its subviews in response to the repositioning of a divider.

NSSplitViewControlMBS.splitViewWillResizeSubviews

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 23.4 ✅ Yes ❌ No ❌ No ❌ No
Notifies the delegate when the split view is about to resize its subviews.

The control invokes this method before the split view resizes two of its subviews in response to the repositioning of a divider.

NSSplitViewControlMBS.willShowContextualMenu(menu as NSMenuMBS, NSEvent as NSEventMBS)   New in 24.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Controls MBS MacCocoa Plugin 24.1 ✅ Yes ❌ No ❌ No ❌ No
Will show contextual menu.

Your chance to modify the menu before it is shown, e.g. to add menu entries.

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


The biggest plugin in space...