主要内容

optics.ui.MaterialSelectionEventData Class

Namespace: optics.ui
Superclasses: event.EventData

Event data for when new material is selection

Since R2026a

Description

Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

The optics.ui.MaterialSelectionEventData class defines the event data passed to listeners when you select a new optical glass material in the opticalMaterialPicker object, either interactively or programmatically. When the object triggers an event using the notify handle class method, MATLAB® assigns values to the properties of a MaterialSelectionEventData object and passes that object to the listener callback function (the event handler).

The optics.ui.MaterialSelectionEventData class is a handle class.

Class Attributes

ConstructOnLoad
true
HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

The notify handle class method creates an MaterialSelectionEventData object when called to trigger an event.

Properties

expand all

Event source, represented as a handle to the OpticalMaterialPicker object that triggered the event.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Name of the event, represented as a character vector.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Selected material, represented as an opticalMaterial object.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Examples

collapse all

Get the event properties from the optics.ui.MaterialSelectionEventData object passed to this callback function when the event is triggered.

function myCallback(src,evt)
   eventSource = evt.Source;
   eventName = evt.EventName;
   eventSelectedMaterial = evt.SelectedMaterial;
   ...
end

Version History

Introduced in R2026a

See Also

Objects