ToolbarStateButton - Axes toolbar state button appearance and behavior - MATLAB (original) (raw)

ToolbarStateButton Properties

Axes toolbar state button appearance and behavior

ToolbarStateButton properties control the appearance and behavior of the axes ToolbarStateButton object. By changing property values, you can modify certain aspects of the state button.

tb = axtoolbar('default') btn = axtoolbarbtn(tb,'state') btn.Tooltip = 'My State Button';

expand all

Button icon, specified as one of these values. The axes toolbar displays icons as grayscale images. MATLAB® scales down the image to fit, if necessary.

Example: btn.Icon = 'icon.png'

Example: btn.Icon = 'C:\Documents\icon.png'

Example: btn.Icon = 'rotate'

Button tool tip, specified as a character vector, cell array of character vectors, or a string array. Use this property to display a message when you hover the pointer over the button. To display multiple lines of text, specify a cell array of character vectors or a string array. Each element in the array displays a separate line of text.

Example: btn.Tooltip = 'My Tooltip'

Current state of the button, specified as 'on' or'off', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Callbacks

expand all

State button callback that executes when you click the button, specified as one of these values:

This callback executes when you click a state button. It does not execute if a state button Value property changes programmatically.

If you specify this property using a function handle, then MATLAB passes the source StateButton object and an event data structure as the first and second input arguments to the function. This table describes the fields in the event data structure.

Field Description
Source StateButton object
Axes Associated Axes object
EventName 'ValueChanged'
Value Current value (either 'on' or'off')
PreviousValue Previous value (either 'on' or'off')

Callback Execution Control

expand all

This property is read-only.

Parent/Child

expand all

Parent container, specified as an AxesToolbar object.

This object has no children. You cannot set this property.

Identifiers

expand all

This property is read-only.

Type of graphics object, returned as 'toolbarstatebutton'.

Object identifier, specified as a character vector or string scalar. You can specify a unique Tag value to serve as an identifier for an object. When you need access to the object elsewhere in your code, you can use the findobj function to search for the object based on the Tag value.

Unused Properties

expand all

Setting this property has no effect on objects of this type.

Mouse-click callback, specified as a function handle, a cell array, or a character vector.

Note

The button does not use this property.

Version History

Introduced in R2018b