MATLAB Function Reference | Search  Help Desk |
uicontextmenu Properties |
BusyAction
cancel | {queue}
Callback routine interruption. The BusyAction
property enables you to control how MATLAB handles events that potentially interrupt executing callback routines. If a callback routine is executing, subsequently invoked callback routines 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 whose callback is executing determines how MATLAB handles the event. The choices are:
cancel
- discard the event that attempted to execute a second callback routine.
queue
- queue the event that attempted to execute a second callback routine until the current callback finishes.
ButtonDownFcn
stringThis property has no effect on Uicontextmenu objects.
Callback
stringControl action. A routine that executes whenever you right-click on an object for which a context menu is defined. The routine executes immediately before the context menu is posted. 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.
Children
matrixThe Uimenus defined for the Uicontextmenu.
Clipping
{on} | off
This property has no effect on Uicontextmenu objects.
CreateFcn
stringCallback routine executed during object creation. This property defines a callback routine that executes when MATLAB creates a Uicontextmenu object. You must define this property as a default value for Uicontextmenus. For example, this statement:
set(0,'DefaultUicontextmenuCreateFcn',... 'set(gcf,''IntegerHandle'',''off'')')defines a default value on the Root level that sets the Figure
IntegerHandle
property to off
whenever you create a Uicontextmenu object. MATLAB executes this routine after setting all property values for the Uicontextmenu. Setting this property on an existing Uicontextmenu object has no effect.
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 Uicontextmenu callback routine. A callback routine that executes when you delete the Uicontextmenu object (e.g., when you issue a delete
command or clear the Figure containing the Uicontextmenu). MATLAB executes the routine before destroying the object's properties so these values are available to the callback routine.
gcbo
.
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).
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 provides 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 evaluating 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.
HitTest
{on} | off
This property has no effect on Uicontextmenu objects.
Interruptible
{on} | off
Callback routine interruption mode. The Interruptible
property controls whether a Uicontextmenu callback routine can be interrupted by subsequently invoked callback routines. By default (off
), a callback routine executes to completion before another can begin.
ButtonDownFcn
and Callback
properties are affected by the Interruptible
property. MATLAB checks for events that can interrupt a callback routine only when it encounters a drawnow
, figure
, getframe
, or pause
command in the routine.
Parent
handle Uicontextmenu's parent. The handle of the Uicontextmenu's parent object. The parent of a Uicontextmenu object is the Figure in which it appears. You can move a Uicontextmenu object to another Figure by setting this property to the handle of the new parent.
Selected
on | {off}
This property has no effect on Uicontextmenu objects.
SelectionHighlight
{on} | off
This property has no effect on Uicontextmenu objects.
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
Class of graphics object. For Uicontextmenu objects, Type
is always the string 'uicontextmenu'
.
UIContextMenu
handleThis property has no effect on Uicontextmenus.
UserData
matrix
User-specified data. Any data you want to associate with the Uicontextmenu object. MATLAB does not use this data, but you can access it using set
and get
.
Visible
{on} | off
Uicontextmenu visibility. The Visible
property determines or indicates whether the context menu is posted. The property is normally controlled automatically, returning on
when the menu is posted as a result of a right-click and off
after a menu item has been selected and the context menu is withdrawn. You can use the property to force the context menu to be posted without a menu click or to be withdrawn before an item is selected.