Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSTableViewMBS class.
NSTableViewMBS.addTableColumn(column as NSTableColumnMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
- /MacControls/Listbox and TableView Demos/NSOutlineView/Disk Browser
- /MacControls/Listbox and TableView Demos/NSOutlineView/OutlineControl
- /MacControls/Outline View Test
- /MacControls/TableControl
- /MacFrameworks/Cocoa Controls/TableView
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
For NSView-based table views, multiple row changes—that is, insertions, deletions, and moves—are animated simultaneously by surrounding calls to those method calls with beginUpdates and endUpdates. These methods are nestable.
The selected rows are maintained during the series of insertions, deletions, moves, and scrolling. If a selected row is deleted, a selection changed notification occurs after removeRowsAtIndexes is called.
It is not necessary to call beginUpdates and endUpdates if only one insertion, deletion, or move is occurring and the table view is an NSView-based table view. When using an NSCell-based table view, you must surround any insertion, deletion, or move in an update block for animations to occur.
The main reason for doing a batch update of changes to a table view is to avoid having the table animate unnecessarily.
Note that these methods should be called to reflect changes in your model; they do not make any underlying model changes.
For NSCell-based table views, it is required to call beginUpdates if you want to animate the insertRowsAtIndexes, removeRowsAtIndexes, and moveRowAtIndex.
Some examples using this method:
NSTableViewMBS.canDragRowsWithIndexes(rowIndexes as NSIndexSetMBS, mouseDownPoint as NSPointMBS) 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 |
rowIndexes: The row indexes to drag.
mouseDownPoint: The location where the drag was initiated.
Returns no to disallow the drag.
NSTableViewMBS.columnAtPoint(p as NSPointMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns the index of the column aPoint lies in, or –1 if aPoint lies outside the receiver's bounds.
See also:
NSTableViewMBS.columnAtPoint(x as Double, y as Double) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns the index of the column aPoint lies in, or –1 if aPoint lies outside the receiver's bounds.
See also:
NSTableViewMBS.columnForView(view as NSViewMBS) 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 |
view: The view for which to retrieve the column.
Returns the index of the column containing view in the tableColumns array. This method returns -1 if the view is not in the table view. This method may also return -1 if the row containing the view is being animated away, such as during the deletion of a row.
This method is typically called in the action method of an NSButton (or NSControl) to find out what row (and column) the action should be performed on.
The implementation is O(n) where n is the number of visible rows, so this method should generally not be called within a loop.
NSTableViewMBS.columnIndexesInRect(rect as NSRectMBS) as NSIndexSetMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Available in Mac OS X v10.5 and later.
NSTableViewMBS.columnWithIdentifier(identifier as string) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns the index of the first column in the receiver whose identifier is equal to anObject (when compared using isEqual:) or –1 if no columns are found with the specified identifier.
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
On success the handle property is not zero.
See also:
NSTableViewMBS.Constructor(Handle as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The handle is casted to a NSTableView and the plugin retains this handle.
See also:
NSTableViewMBS.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 | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
On success the handle property is not zero.
See also:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSTableViewMBS.deselectColumn(column as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Colunn is from 0 to numberOfColumns-1.
NSTableViewMBS.deselectRow(row as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Deselects the row at rowIndex if it's selected, regardless of whether empty selection is allowed.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Xojo calls this destructor automatically.
NSTableViewMBS.dragImageForRowsWithIndexes(dragRows as NSIndexSetMBS, tableColumns() as NSTableColumnMBS, theEvent as NSEventMBS, byref dragImageOffset as NSPointMBS) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
dragRows: An index set containing the row indexes that should be in the image.
tableColumns: An array of table columns that should be in the image.
dragEvent: The event that initiated the drag.
dragImageOffset: An in/out parameter specifying the offset of the cursor in the image, the default value is NSZeroPoint. Returning NSZeroPoint causes the cursor to be centered.
Returns an NSImage containing a custom image for the specified rows and columns participating in the drag.
NSTableViewMBS.edit(column as Integer, row as Integer, selectit as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This method is invoked automatically in response to user actions; you should rarely need to invoke it directly.
This method scrolls the receiver so that the cell is visible, sets up the field editor, and sends selectWithFrame() and editWithFrame() to the field editor's NSCell object with the NSTableView as the text delegate.
The row at rowIndex must be selected prior to calling editColumn:row:withEvent:select:, or an exception will be raised.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Ends the group of updates for the table view. This method, like beginUpdates, is nestable. See beginUpdates for details.
Some examples using this method:
NSTableViewMBS.frameOfCellAtColumnRow(column as Integer, 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 |
column: The index in the tableColumns array of the column containing the cell whose rectangle you want.
row: The index of the row containing the cell whose rectangle you want.
Returns a rectangle locating the cell that lies at the intersection of columnIndex and rowIndex. This method returns NSRectMBS.Zero if columnIndex or rowIndex is greater than the number of columns or rows in the table view.
You can use this method to update a single cell more efficiently than sending the table view a reloadData message using reloadData function.
The result of this method is used in a drawWithFrame:inView: message to the table column's data cell. You can subclass and override this method to customize the frame of a particular cell. However, never return a frame larger than the default implementation returns.
The default frame is computed to have a height equal to the rectOfRow: for rowIndex, minus the half intercellSpacing height on the top and half on the bottom. The width of frame is equal to the with of the table column minus half the intercellSpacing width on the left, and half on the right.
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
NSTableViewMBS.hiddenRowIndexes as NSIndexSetMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The value of this property is an index set containing the indexes of any hidden table rows. Table rows may be hidden by invoking the hideRowsAtIndexes method. Some drag-and-drop operations also result in hidden rows.
NSTableViewMBS.hideRowsAtIndexes(indexes as NSIndexSetMBS, 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 |
indexes: An index set containing indexes of the rows to be hidden.
rowAnimation: An animation effect to be applied when the rows are hidden.
Use this method when you no longer want the data to be visible to the user, but you don’t want to permanently remove the data. Hidden table rows have a height of zero and cannot be selected by the user. However, if a selected table row is hidden, it will remain selected.
Hiding a table row causes the didRemoveRowView delegate method to be invoked.
NSTableViewMBS.indicatorImageInTableColumn(column as NSTableColumnMBS) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 9.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
An indicator image is an arbitrary (small) image that is rendered on the right side of the column header. An example of its use is in Mail to indicate the sorting direction of the currently sorted column in a mailbox.
(Read and Write computed property)
NSTableViewMBS.insertRowsAtIndexes(indexes as NSIndexSetMBS, 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 |
indexes: The final positions of the new rows to be inserted.
animationOptions: The animation displayed during the insert. See NSTableViewAnimationOptions for the possible values that can be combined using the bitwise OR operator.
The numberOfRows in the table view is automatically increased by the count of indexes.
Calling this method multiple times within the same beginUpdates and endUpdates block is allowed, and changes are processed incrementally.
NSCell-based table views must first call beginUpdates before calling this method.
NSTableViewMBS.isColumnSelected(column as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
column is from 0 to to numberOfColumns.
NSTableViewMBS.isRowSelected(row as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
row is from 0 to to numberOfRows.
NSTableViewMBS.moveColumn(column as Integer, toIndex as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
columnIndex: The current index of the column to move.
newIndex: The new index for the moved column.
This method raises the ColumnDidMove event.
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
NSTableViewMBS.moveRowAtIndex(oldIndex as Integer, newIndex 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 |
oldIndex: Initial row index.
newIndex: New row index.
This is similar to removing a row at oldIndex and inserting it at newIndex, except the same view is used and simply has its position updated to the new location.
Changes happen incrementally as they are sent to the table, so as soon as this method is called the row can be considered moved. However the underlying view is not moved until endUpdates has been called.
This method can be called multiple times within the same beginUpdates and endUpdates block.
NSCell-based table views must first call beginUpdates before calling this method.
NSTableViewMBS.noteHeightOfRowsWithIndexesChanged(indexSet as NSIndexSetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 16.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
indexSet: Index set of rows that have changed their height.
If you implement heightOfRow event this method immediately retiles the table view using the row heights the event provides.
For NSView-based tables, this method will animate. To turn off the animation, create an NSAnimationContext grouping and set the duration to 0. Then call this method and end the grouping.
For NSCell-based tables, this method normally doesn't animate. However, it will animate if you call it inside a beginUpdates/endUpdates block.
NSTableViewMBS.noteNumberOfRowsChanged
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This method allows the receiver to update the scrollers in its scroll view without actually reloading data into the receiver. It's useful for a data source that continually receives data in the background over a period of time, in which case the table view can remain responsive to the user while the data is received.
NSTableViewMBS.rectOfColumn(column as Integer) as NSRectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The rectangle containing the column at columnIndex. Returns NSRectMBS.Zero (an empty rectangle) if columnIndex lies outside the range of valid column indices for the receiver.
You can use this method to update a single column more efficiently than sending the table view a reloadData message.
aTableView.setNeedsDisplayInRect(aTableView.rectOfColumn(column))
NSTableViewMBS.rectOfRow(row as Integer) as NSRectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns the rectangle containing the row at rowIndex. Returns NSRectMBS.Zero (an empty rectangle) if rowIndex lies outside the range of valid row indices for the receiver.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This method forces redraw of all the visible cells in the receiver. If you want to update the value in a single cell, column, or row, it is more efficient to use frameOfCellAtColumn(), rectOfColumn(), or rectOfRow() in conjunction with setNeedsDisplayInRect(). If you just want to update the scroller, use noteNumberOfRowsChanged; if the height of a set of rows changes, use noteHeightOfRowsWithIndexesChanged().
See also:
NSTableViewMBS.reloadData(rowIndexes as NSIndexSetMBS, columnIndexes as NSIndexSetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
rowIndexes: The indexes of the rows to update.
columnIndexes: The indexes of the columns to update.
For cells that are visible, the appropriate dataSource and delegate methods are called and the cells are redrawn.
For tables that support variable row heights, the row height is not re-queried from the delegate; it is your responsibility to invoke noteHeightOfRowsWithIndexesChanged if a row height change is required.
For NSView-based table views, this method drops the view-cells in the table row, but not the NSTableRowView instances.
See also:
NSTableViewMBS.removeRowsAtIndexes(indexes as NSIndexSetMBS, 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 |
indexes: An index set containing the rows to remove.
animationOptions: The animation displayed during the insert. See NSTableViewAnimationOptions for the possible values that can be combined using the bitwise OR operator.
This method deletes from the table the rows represented at indexes and automatically decreases numberOfRows by the count of indexes.
The row indexes should be with respect to the current state displayed in the table view, and not the final state, because the specified rows do not exist in the final state.
Calling this method multiple times within the same beginUpdates and endUpdates block is allowed, and changes are processed incrementally.
Changes are processed incrementally as the insertRowsAtIndexes, removeRowsAtIndexes, and the moveRowAtIndex methods are called. It is acceptable to delete row 0 multiple times, as long as there is still a row available.
NSCell-based table views must first call beginUpdates before calling this method.
NSTableViewMBS.removeTableColumn(column as NSTableColumnMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
NSTableViewMBS.rowAtPoint(p as NSPointMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns the index of the row aPoint lies in, or –1 if aPoint lies outside the receiver's bounds.
See also:
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
NSTableViewMBS.rowAtPoint(x as Double, y as Double) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns the index of the row aPoint lies in, or –1 if aPoint lies outside the receiver's bounds.
See also:
NSTableViewMBS.rowForView(view as NSViewMBS) 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 |
view: The view for which to retrieve the row.
Returns the index of the row containing to view. This method returns -1 if the view is not in the table view. This method may also return -1 if the row containing the view is being animated away, such as during the deletion of a row.
This method is typically called in the action method for an NSButton (or NSControl) to find out what row (and column) the action should be performed on.
The implementation is O(n) where n is the number of visible rows, so this method should generally not be called within a loop.
NSTableViewMBS.rowsInRect(rect as NSRectMBS) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Rect: A rectangle in the coordinate system of the table view.
Returns a range of indexes for the table view’s rows that lie wholly or partially within the horizontal boundaries of aRect. If the width or height of aRect is 0, this method returns an NSRange whose length is 0.
The location of the range is the index of the first row in the rectangle, and the length is the number of rows that lie in the rectangle.
NSTableViewMBS.rowViewAtRow(row as Integer, makeIfNecessary as Boolean) as NSViewMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 17.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
row: The row index.
makeIfNecessary: True if a view is required, NO if you want to update properties on a view, if one is available.
Returns an instance, or subclass, of NSTableRowView. Returning nil is also valid if makeIfNecessary is false and the view did not exist.
This method first attempts to return a currently displayed view in the visible area. If there is no visible view, and makeIfNecessary is true, a prepared temporary view is returned. If makeIfNecessary is false, and the view is not visible, nil is returned.
In general, makeIfNecessary should be true if you require a resulting view, and false if you want to update properties on a view only if it is available (generally this means it is visible).
An exception is thrown if row falls outside of the number of rows in the table (numberOfRows). The returned result should generally not be held onto for longer than the current run loop cycle. It’s better to call rowViewAtRow whenever a view is required.
NSTableViewMBS.scrollColumnToVisible(column as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSTableViewMBS.scrollRowToVisible(row as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSTableViewMBS.ScrollToLine(Line as Integer, Animated as Boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 16.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If animated is true, the scroll is animated.
The line is centered in the middle of the viewable area if possible.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If the table allows multiple selection, this action method selects all rows or all columns, according to whether rows or columns were most recently selected. If nothing has been recently selected, this method selects all rows. If this table doesn't allow multiple selection, this method does nothing.
NSTableViewMBS.selectColumnIndexes(indexes as NSIndexSetMBS, extend as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
f the extend flag is false the selected columns are specified by indexes. If extend is true, the columns indicated by indexes are added to the collection of already selected columns, providing multiple selection.
NSTableViewMBS.selectedColumnIndexes as NSIndexSetMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns an index set containing the indexes of the selected columns.
NSTableViewMBS.selectedRowIndexes as NSIndexSetMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Available in Mac OS X v10.3 and later.
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
- /MacControls/Listbox and TableView Demos/NSOutlineView/Disk Browser
NSTableViewMBS.selectRowIndexes(indexes as NSIndexSetMBS, extend as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If the extend flag is false the selected rows are specified by indexes. If extend is true, the rows indicated by indexes are added to the collection of already selected rows, providing multiple selection.
Available in Mac OS X v10.3 and later.
Some examples using this method:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
NSTableViewMBS.setDraggingSourceOperationMask(mask as Integer, isLocal 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 |
mask: The drag operation mask. See NSDragOperation for the supported values.
isLocal: True if the destination is the same application, otherwise false. In either case the specified mask value is archived and used.
The items on this page are in the following plugins: MBS MacControls Plugin.