MATLAB Function Reference
  Go to function:
    Search    Help Desk 
uimenu Properties

Uimenu Properties

This section lists property names along with the type of values each accepts. Curly braces { } enclose default values.

You can set default Uimenu properties on the Figure and Root levels:

Where PropertyName is the name of the Uimenu property and PropertyValue is the value you are specifying. Use set and get to access Uimenu properties.

Accelerator                  character

Keyboard equivalent. A character specifying the keyboard equivalent for the menu item. This allows users to select a particular menu choice by pressing the specified character in conjunction with another key, instead of selecting the menu item with the mouse. The key sequence is platform specific:

You can define an accelerator only for menu items that do not have children menus. Accelerators work only for menu items that directly execute a callback routine, not items that bring up other menus.

Note that the menu item does not have to be displayed (e.g., a submenu) for the accelerator key to work. However, the window focus must be in the Figure when the key sequence is entered.

BusyAction                   cancel | {queue}

Callback routine interruption. The BusyAction property enables you to control how MATLAB handles events that potentially interrupt executing callback routines. If there is a callback routine executing, subsequently invoked callback routes always attempt to interrupt it. If the Interruptible property of the object whose callback is executing is set to on (the default), then interruption occurs at the next point where the event queue is processed. If the Interruptible property is off, the BusyAction property (of the object owning the executing callback) determines how MATLAB handles the event. The choices are:

ButtonDownFcn                string

The button down function has no effect on Uimenu objects.

Callback                     string

Menu action. A callback routine that executes whenever you select the menu. Define this routine as a string that is a valid MATLAB expression or the name of an M-file. The expression executes in the MATLAB workspace.

A menu with children (submenus) executes its callback routine before displaying the submenus. A menu without children executes its callback routine when you release the mouse button (i.e., on the button up event).

Checked                      on | {off}

Menu check indicator. Setting this property to on places a check mark next to the corresponding menu item. Setting it to off removes the check mark. You can use this feature to create menus that indicate the state of a particular option. Note that there is no formal mechanism for indicating that an unchecked menu item will become checked when selected. Also, this property does not check top level menus or submenus, although you can change the value of the property for these menus.

Children                     vector of handles

Handles of submenus. A vector containing the handles of all children of the Uimenu object. The children objects of Uimenus are other Uimenus, which function as submenus. You can use this property to re-order the menus.

Clipping                     {on} | off

Clipping has no effect on Uimenu objects.

CreateFcn                    string

Callback routine executed during object creation. This property defines a callback routine that executes when MATLAB creates a Uimenu object. You must define this property as a default value for Uimenus. For example, the statement,

defines a default value on the Root level that sets the Figure IntegerHandle property to off whenever you create a Uimenu object. Setting this property on an existing Uimenu object has no effect. MATLAB executes this routine after setting all property values for the Uimenu.

The handle of the object whose CreateFcn is being executed is accessible only through the Root CallbackObject property, which can be queried using gcbo.

DeleteFcn                    string

Delete Uimenu callback routine. A callback routine that executes when you delete the Uimenu object (e.g., when you issue a delete command or cause the Figure containing the Uimenu to reset). MATLAB executes the routine before destroying the object's properties so these values are available to the callback routine.

The handle of the object whose DeleteFcn is being executed is accessible only through the Root CallbackObject property, which is more simply queried using gcbo.

Enable                       {on} | off

Enable or disable the Uimenu. This property controls the selectability of a menu item. When not enabled (set to off), the menu Label appears dimmed, indicating the user cannot select it.

ForegroundColor              ColorSpec X-Windows only

Color of menu label string. This property determines color of the text defined for the Label property. Specify a color using a three-element RGB vector or one of MATLAB's predefined names. The default text color is black. See ColorSpec for more information on specifying color.

HandleVisibility             {on} | callback | off

Control access to object's handle by command-line users and GUIs. This property determines when an object's handle is visible in its parent's list of children. HandleVisibility is useful for preventing command-line users from accidentally drawing into or deleting a Figure that contains only user interface devices (such as a dialog box).

Handles are always visible when HandleVisibility is on.

Setting HandleVisibility to callback causes handles to be visible from within callback routines or functions invoked by callback routines, but not from within functions invoked from the command line. This provide a means to protect GUIs from command-line users, while allowing callback routines to have complete access to object handles.

Setting HandleVisibility to off makes handles invisible at all times. This may be necessary when a callback routine invokes a function that might potentially damage the GUI (such as evaling a user-typed string), and so temporarily hides its own handles during the execution of that function.

When a handle is not visible in its parent's list of children, it cannot be returned by functions that obtain handles by searching the object hierarchy or querying handle properties. This includes get, findobj, gca, gcf, gco, newplot, cla, clf, and close.

When a handle's visibility is restricted using callback or off, the object's handle does not appear in its parent's Children property, Figures do not appear in the Root's CurrentFigure property, objects do not appear in the Root's CallbackObject property or in the Figure's CurrentObject property, and Axes do not appear in their parent's CurrentAxes property.

You can set the Root ShowHiddenHandles property to on to make all handles visible, regardless of their HandleVisibility settings (this does not affect the values of the HandleVisibility properties).

Handles that are hidden are still valid. If you know an object's handle, you can set and get its properties, and pass it to any function that operates on handles.

Interruptible                {on} | off

Callback routine interruption mode. The Interruptible property controls whether a Uimenu callback routine can be interrupted by subsequently invoked callback routines. By default (off), a callback routine executes to completion before another can begin. Only the Callback Uimenu property is affected by the Interruptible property.

Label                        string

Menu label. A string specifying the text label on the menu item. You can specify a mnemonic using the "&" character. Whatever character follows the "&" in the string appears underlined and selects the menu item when you type that character while the menu is visible. The "&" character is not displayed. On Macintosh systems, MATLAB ignores (and does not print) the "&" character. To display the "&" character in a label, use two "&" characters in the string:

`O&pen selection' yields Open selection

`Save && Go' yields Save & Go

Parent                       handle

Uimenu's parent. The handle of the Uimenu's parent object. The parent of a Uimenu object is the Figure on whose menu bar it displays, or the Uimenu of which it is a submenu. You can move a Uimenu object to another Figure by setting this property to the handle of the new parent.

Position                     scalar

Relative menu position. The value of Position indicates placement on the menu bar or within a menu. Top-level menus are placed from left to right on the menu bar according to the value of their Position property, with 1 representing the left-most position. The individual items within a given menu are placed from top to bottom according to the value of their Position property, with 1 representing the top-most position.

Selected                     on | {off}

This property is not used for Uimenu objects.

SelectionHighlight              on | off

This property is not used for Uimenu objects.

Separator                    on | {off}

Separator line mode. Setting this property to on draws a dividing line above the menu item.

Tag                          string

User-specified object label. The Tag property provides a means to identify graphics objects with a user-specified label. This is particularly useful when constructing interactive graphics programs that would otherwise need to define object handles as global variables or pass them as arguments between callback routines. You can define Tag as any string.

Type                         string (read only)

Class of graphics object. For Uimenu objects, Type is always the string 'uimenu'.

UIContextMenu                handle

This property has no effect on Uimenus.

UserData                     matrix

User-specified data. Any matrix you want to associate with the Uimenu object. MATLAB does not use this data, but you can access it using the set and get commands.

Visible                      {on} | off

Uimenu visibility. By default, all Uimenus are visible. When set to off, the Uimenu is not visible, but still exists and you can query and set its properties.



[ Previous | Help Desk | Next ]