Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSComboBoxMBS class.

NSComboBoxMBS.addItemWithObjectValue(value as Variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Adds an object to the end of the receiver's internal item list.

anObject: The object to add to the internal item list.

This method logs a warning if usesDataSource returns true.

Some examples using this method:

NSComboBoxMBS.completes as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether the receiver tries to complete what the user types in the text field.

Returns true if the receiver tries to complete what the user types in the text field; otherwise false.
(Read and Write computed property)

Some examples using this property:

NSComboBoxMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new button with size 100/100 and position 0/0
Example
dim t as new NSComboBoxMBS(0, 0, 100, 20)

On success the handle property is not zero.

See also:

NSComboBoxMBS.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
Creates an object based on the given NSComboBox handle.
Example
dim t as new NSComboBoxMBS(0, 0, 100, 100)
dim v as new NSComboBoxMBS(t.handle)

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

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

See also:

NSComboBoxMBS.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 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new combo box with the given size and position.
Example
dim left,top,width,height as Integer
// define rectangle
dim x as new NSComboBoxMBS(left, top, width, height)

On success the handle property is not zero.

See also:

NSComboBoxMBS.deselectItemAtIndex(index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Deselects the pop-up list item at the specified index if it's selected.

index: The index of the item to deselect.

If the selection does in fact change, this method posts an NSComboBoxSelectionDidChangeNotification to the default notification center.

Some examples using this method:

NSComboBoxMBS.hasVerticalScroller as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether the receiver will display a vertical scroller.

Returns true if the receiver will display a vertical scroller; otherwise false.

Note that the scroller will be displayed even if the pop-up list contains fewer items than will fit in the area specified for display.
(Read and Write computed property)

NSComboBoxMBS.indexOfItemWithObjectValue(value as Variant) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Searches the receiver's internal item list for the specified object and returns the lowest matching index.

anObject: The object for which to return the index.

Returns the lowest index in the internal item list whose corresponding value is equal to that of the specified object. Objects are considered equal if they have the same id or if isEqual returns true.

If none of the objects in the receiver's internal item list are equal to anObject, indexOfItemWithObjectValue returns NSNotFound (-1).

This method logs a warning if usesDataSource returns true.

Some examples using this method:

NSComboBoxMBS.indexOfSelectedItem as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the index of the last item selected from the pop-up list.

Returns the index of the last item selected from the receiver's pop-up list or -1 if no item is selected.

Note that nothing is initially selected in a newly initialized combo box.

NSComboBoxMBS.intercellSpacing as NSSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the horizontal and vertical spacing between cells in the receiver's pop-up list.

Returns the space between cells in the pop-up list. The default spacing is (3.0, 2.0).
(Read and Write computed property)

NSComboBoxMBS.isButtonBordered as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether the combo box button is set to display a border.

True if the button has a border; otherwise false.
Available in Mac OS X v10.3 and later
(Read and Write computed property)

Some examples using this property:

NSComboBoxMBS.itemHeight as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the height of each item in the receiver's pop-up list.

The default item height is 16.0.
(Read and Write computed property)

Some examples using this property:

NSComboBoxMBS.noteNumberOfItemsChanged

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Informs the receiver that the number of items in its data source has changed.

This method allows the receiver to update the scrollers in its displayed pop-up list without actually reloading data into the receiver. It is particularly useful for a data source that continually receives data in the background over a period of time, in which case the NSComboBox can remain responsive to the user while the data is received.

See the NSComboBoxDataSource informal protocol specification for information on the messages an NSComboBox sends to its data source.

Some examples using this method:

NSComboBoxMBS.numberOfItems as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the total number of items in the pop-up list.

NSComboBoxMBS.numberOfVisibleItems as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the maximum number of items visible in the pop-up list.

The maximum number of items visible at any one time in the pop-up list.
(Read and Write computed property)

Some examples using this property:

NSComboBoxMBS.reloadData

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Marks the receiver as needing redisplay, so that it will reload the data for visible pop-up items and draw the new values.

NSComboBoxMBS.removeAllItems

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Removes all items from the receiver's internal item list.

This method logs a warning if usesDataSource returns true.

NSComboBoxMBS.removeItemAtIndex(index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Removes the object at the specified location from the receiver's internal item list.

index: The index of the object to remove. All items beyond index are moved up one slot to fill the gap.

The removed object receives a release message. This method raises an NSRangeException if index is beyond the end of the list and logs a warning if usesDataSource returns true.

NSComboBoxMBS.removeItemWithObjectValue(value as Variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Removes all occurrences of the given object from the receiver's internal item list.

anObject: The object to remove from the internal item list. Objects are considered equal if they have the same id or if isEqual: returns true.

This method logs a warning if usesDataSource returns true.

Some examples using this method:

NSComboBoxMBS.scrollItemAtIndexToTop(index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Scrolls the receiver's pop-up list vertically so that the item at the specified index is as close to the top as possible.

index: The index of the item to scroll to the top.

The pop-up list need not be displayed at the time this method is invoked.

Some examples using this method:

NSComboBoxMBS.scrollItemAtIndexToVisible(index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Scrolls the receiver's pop-up list vertically so that the item at the specified index is visible.

index: The index of the item to make visible.

The pop-up list need not be displayed at the time this method is invoked.

Some examples using this method:

NSComboBoxMBS.selectItemAtIndex(index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Selects the pop-up list row at the given index.

index: The index of the item to select in the pop-up list.

Posts an NSComboBoxSelectionDidChangeNotification to the default notification center if the selection does in fact change. Note that this method does not alter the contents of the combo box's text field—see Setting the Combo Box's Value for more information.

NSComboBoxMBS.selectItemWithObjectValue(value as Variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Selects the first pop-up list item that corresponds to the given object.

anObject: The object to select in the pop-up list. Objects are considered equal if they have the same id or if isEqual: returns true.

This method logs a warning if usesDataSource returns true. Posts an NSComboBoxSelectionDidChangeNotification to the default notification center if the selection does in fact change. Note that this method doesn't alter the contents of the combo box's text field—see Setting the Combo Box's Value for more information.

Some examples using this method:

NSComboBoxMBS.usesDataSource as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Controls MBS MacControls Plugin 10.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value indicating whether the receiver uses an external data source to populate its pop-up list.

True if the receiver uses an external data source to populate the receiver's pop-up list, false if it uses an internal item list.
(Read and Write computed property)

Some examples using this property:

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


The biggest plugin in space...