Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSOutlineViewMBS class.

NSOutlineViewMBS.child(index as Integer, ofItem as NSOutlineViewItemMBS) as NSOutlineViewItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the specified child of an item.

index: The index of the child item in the parent.
item: The parent item whose child item you want to retrieve.

Returns the child item or nil if the item could not be found.

You can call this method on an outline view with either a static or dynamic data source. For an outline view whose contents are dynamic, this method may call out to the child event of the associated data source.

NSOutlineViewMBS.childIndexForItem(item as NSOutlineViewItemMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the child index of the specified item within its parent.

The performance of this method is O(1) at best and O(n) at worst.

NSOutlineViewMBS.collapseItem(item as NSOutlineViewItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Collapses a given item.

If item is not expanded or not expandable, does nothing
If collapsing takes place, posts item collapse notification.

See also:

Some examples using this method:

NSOutlineViewMBS.collapseItem(item as NSOutlineViewItemMBS, collapseChildren as Boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Collapses a given item and, optionally, its children.

item: An item in the receiver.
Starting in OS X version 10.5, passing 'nil' will collapse each item under the root in the outline view.
collapseChildren: If true, recursively collapses item and its children. If NO, collapses item only (identical to collapseItem:).

For example, this method is invoked with the collapseChildren parameter set to true when a user Option-clicks the disclosure triangle for an item in the outline view (to collapse the item and all its contained items).
For each item collapsed, posts an item collapsed notification.

See also:

NSOutlineViewMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new outline view with size 100/100 and position 0/0
Example
dim t as new NSOutlineViewMBS

On success the handle property is not zero.

See also:

NSOutlineViewMBS.Constructor(Handle as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates an object based on the given NSOutlineView handle.
Example
dim t as new NSOutlineViewMBS(0, 0, 100, 100)
dim v as new NSOutlineViewMBS(t.handle)

MsgBox str(v.Bounds.Width)+" x "+str(v.Bounds.Height)

The handle is casted to a NSOutlineViewMBS and the plugin retains this handle.

See also:

NSOutlineViewMBS.Constructor(left as Double, top as Double, width as Double, height as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new outline view with the given size and position.
Example
dim x as new NSOutlineViewMBS(0, 0, 100, 100)

On success the handle property is not zero.

See also:

NSOutlineViewMBS.expandItem(item as NSOutlineViewItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Expands a given item.

If item is not expandable or is already expanded, does nothing.
If expanding takes place, posts an item expanded notification.

See also:

Some examples using this method:

NSOutlineViewMBS.expandItem(item as NSOutlineViewItemMBS, expandChildren as Boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Expands a specified item and, optionally, its children.

item: An item in the receiver.
Starting in OS X version 10.5, passing 'nil' will expand each item under the root in the outline view.

expandChildren: If true, recursively expands item and its children. If false, expands item only (identical to expandItem).

For example, this method is invoked with the expandChildren parameter set to YES when a user Option-clicks the disclosure triangle for an item in the outline view (to expand the item and all its contained items).
For each item expanded, posts an item expanded notification.

See also:

NSOutlineViewMBS.frameOfOutlineCellAtRow(row as Integer) as NSRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the frame of the outline cell for a given row.

row: The index of the row for which to return the frame.

Returns the frame of the outline cell for the row at index row, considering the current indentation and the value in the indentationMarkerFollowsCell property. If the row at index row is not an expandable row, returns NSZeroRect.

You can override this method in a subclass to return a custom frame for the outline button cell. If your override returns an empty rect, no outline cell is drawn for that row. You might do that, for example, so that the disclosure triangle will not be shown for a row that should never be expanded.

NSOutlineViewMBS.insertItemsAtIndexes(indexes as NSIndexSetMBS, Parent as NSOutlineViewItemMBS, animationOptions as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Inserts new items at the given indexes in the given parent with the specified optional animations.

indexes: Indexes at which to insert items.
parent: The parent for the items, or nil if the parent is the root.
animationOptions: Animated slide effects used when inserting items.

This method parallels the insertRowsAtIndexes method of NSTableView and is used in a way similar to the insertObjects method of NSMutableArray. The method does nothing if parent is not expanded. The actual item values are determined by the data source’s child event (which is called only after endUpdates to ensure data source integrity).

NSCell-based outline views must first call beginUpdates before calling this method.

You can call this method multiple times within the same beginUpdates/endUpdates block; new insertions move previously inserted new items, just like modifying an array. Inserting an index beyond what is available throws an exception.

NSOutlineViewMBS.insertRowsAtIndexes(indexes as NSIndexSetMBS, animationOptions as Integer)   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Private method to block you from calling this method in NSTableViewMBS.

NSOutlineViewMBS.isExpandable(item as NSOutlineViewItemMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value that indicates whether a given item is expandable.

True if item is expandable—that is, item can contain other items, otherwise false.

Some examples using this method:

NSOutlineViewMBS.isItemExpanded(item as NSOutlineViewItemMBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value that indicates whether a given item is expanded.

True if item is expanded, otherwise false.

Some examples using this method:

NSOutlineViewMBS.itemAtRow(row as Integer) as NSOutlineViewItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the item associated with a given row.

row: The index of a row in the receiver.

Returns the item associated with row.

Some examples using this method:

NSOutlineViewMBS.levelForItem(item as NSOutlineViewItemMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the indentation level for a given item.

The indentation level for item. If item is nil (which is the root item), returns -1.
The levels are zero-based—that is, the first level of displayed items is level 0.

NSOutlineViewMBS.levelForRow(row as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the indentation level for a given row.

The indentation level for row. For an invalid row, returns -1.
The levels are zero-based—that is, the first level of displayed items is level 0.

NSOutlineViewMBS.moveItemAtIndex(oldIndex as Integer, oldParent as NSOutlineViewItemMBS, newIndex as Integer, newParent as NSOutlineViewItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Moves an item at a given index in the given parent to a new index in a new parent.

fromIndex: Index of the item to be moved.
oldParent: The parent of the item to be moved.
toIndex: Index in the new parent to which the item is moved.
newParent: The parent of the item after it is moved.

This method parallels the moveRowAtIndex method of NSTableView. The newParent can be the same as oldParent to reorder an item within the same parent.

NSCell-based outline views must first call beginUpdates before calling this method.

You can call this method multiple times within the same beginUpdates/endUpdates block. Moving from an invalid index, or to an invalid index, throws an exception.

NSOutlineViewMBS.moveRowAtIndex(oldIndex as Integer, newIndex as Integer)   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Private method to block you from calling this method in NSTableViewMBS.

NSOutlineViewMBS.numberOfChildrenOfItem(item as NSOutlineViewItemMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the number of children for the specified parent item.

item: The parent item.

Returns the number of children associated with the parent.

You can call this method on an outline view with either a static or dynamic data source. For an outline view whose contents are dynamic, this method may call out to the numberOfChildrenOfItem event of the associated data source.

NSOutlineViewMBS.parentForItem(item as NSOutlineViewItemMBS) as NSOutlineViewItemMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the parent for a given item.

item: The item for which to return the parent.

Returns the parent for item, or nil if the parent is the root.

Some examples using this method:

NSOutlineViewMBS.reloadItem(item as NSOutlineViewItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Reloads and redisplays the data for the given item.

Reloading the cell views associated with item occurs only in apps that link against macOS 10.12 and later.
This method may cause the outline view to change its selection without calling the SelectionDidChange event.

See also:

Some examples using this method:

NSOutlineViewMBS.reloadItem(item as NSOutlineViewItemMBS, reloadChildren as Boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Reloads a given item and, optionally, its children.

item: An item in the receiver.
Starting in OS X version 10.5, passing 'nil' will reload everything under the root in the outline view.

reloadChildren: If true, recursively reloads item and its children. If false, reloads item only (identical to reloadItem).

It is not necessary, or efficient, to reload children if the item is not expanded.

See also:

NSOutlineViewMBS.removeItemsAtIndexes(indexes as NSIndexSetMBS, Parent as NSOutlineViewItemMBS, animationOptions as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Removes items at the given indexes in the given parent with the specified optional animations.

indexes: Indexes of the items to be removed.
parent: The parent of the items to be removed.
animationOptions: Animated slide effects used when removing items.

This method parallels the removeRowsAtIndexes method of NSTableView and is used in a way similar to the removeObjectsAtIndexes method of NSMutableArray. The method does nothing if parent is not expanded. If any of the child items is expanded, then all of its child rows are also be removed.

NSCell-based outline views must first call beginUpdates before calling this method.

You can call this method multiple times within the same beginUpdates/endUpdates block; changes work just like modifying an array. Removing an item at an index beyond what is available throws an exception.

NSOutlineViewMBS.removeRowsAtIndexes(indexes as NSIndexSetMBS, animationOptions as Integer)   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Private method to block you from calling this method in NSTableViewMBS.

NSOutlineViewMBS.rowForItem(item as NSOutlineViewItemMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the row associated with a given item.

The row associated with item, or -1 if item is nil or cannot be found.

Some examples using this method:

NSOutlineViewMBS.setDropItem(item as NSOutlineViewItemMBS, dropChildIndex as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 17.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Used to “retarget” a proposed drop.

item: The target item.
index: The drop index.

For example, to specify a drop on someOutlineItem, you specify item as someOutlineItem and index as NSOutlineViewDropOnItemIndex. To specify a drop between child 2 and 3 of someOutlineItem, you specify item as someOutlineItem and index as 3 (children are a zero-based index). To specify a drop on an un-expandable someOutlineItem, you specify item as someOutlineItem and index as NSOutlineViewDropOnItemIndex.

Some examples using this method:

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


The biggest plugin in space...