Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSControlMBS class.

NSControlMBS.calcSize

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Recomputes any internal sizing information for the receiver, if necessary.

This method uses the calcDrawInfo method of its cell to perform the calculations. Most controls maintain a flag that informs them if any of their cells have been modified in such a way that the location or size of the cell should be recomputed. If such a modification happens, this method is automatically invoked before the control is displayed. You should never need to invoke it yourself.

NSControlMBS.ConnectActionEvent

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Connects the action event.

If you want to use addhandler with this class and the action event, you need to call ConnectActionEvent after addhandler to actually have the plugin put things in place for handling the event.

NSControlMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 10.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new control with size 100/100 and position 0/0
Example
dim t as new NSControlMBS

On success the handle property is not zero.

See also:

NSControlMBS.Constructor(Handle as Integer)

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

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

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

See also:

NSControlMBS.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 MacCocoa Plugin 10.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new control with the given size and position.
Example
dim x as new NSControlMBS(0, 0, 100, 20)

On success the handle property is not zero.

See also:

NSControlMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 13.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The destructor.

NSControlMBS.EnableEvents

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 13.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Enables events after you assigned methods to them with AddHandler.

NSControlMBS.performClick

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Simulates a single mouse click on the receiver.

This method calls the performClick method of the receiver's cell. This method raises an exception if the action message cannot be successfully sent.

NSControlMBS.selectCell(Cell as NSCellMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Selects the specified cell and redraws the control as needed.

Cell: The cell to select. The cell must belong to the receiver.

If the cell is already selected (or does not belong to the receiver), this method does nothing. If the cell belongs to the receiver and is not selected, this method changes its state to NSOnState and redraws the cell.

NSControlMBS.setNeedsDisplay

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Marks the receiver as needing redisplay (assuming automatic display is enabled).

This method also recalculates the dimensions of the control as needed.

NSControlMBS.sizeToFit

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Resizes the receiver's frame so that it is the minimum size needed to contain its cell.

If you want a multiple-cell custom subclass of NSControl to size itself to fit its cells, you must override this method. This method neither redisplays the receiver nor marks it as needing display. You must do this yourself with either thedisplay or setNeedsDisplay method.

NSControlMBS.validateEditing

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacCocoa Plugin 9.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Validates changes to any user-typed text.

Validation sets the object value of the cell to the current contents of the cell's editor (the NSText object used for editing), storing it as a simple string or an attributed string object based on the attributes of the editor.

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


The biggest plugin in space...