MATLAB Function Reference | Search  Help Desk |
uicontextmenu | Examples See Also |
handle = uicontextmenu('PropertyName
',PropertyValue,...);
uicontextmenu
creates a context menu, which is a menu that is accessed when the user right-clicks on the graphics object associated with the menu. On a Macintosh, perform a right-click using a Ctrl-click.
You create context menu items using the uimenu
function. Menu items appear in the order the uimenu
statements appear. You associate a context menu with an object using the UIContextMenu
property for the object and specifying the context menu's handle as the property value.
More information about context menus.
This table lists all uicontextmenu
properties, grouping them by function. Each property name acts as a link to a description of the property.Property Name |
Property Description |
Property Value |
Controlling Style and Appearance | ||
Clipping |
This property has no effect on Uicontextmenu objects |
|
SelectionHighlight |
This property has no effect on Uicontextmenu objects |
|
Visible |
Uicontextmenu visibility |
Value: on , off Default: on |
General Information About the Object | ||
Children |
The Uimenus defined for the Uicontextmenu |
Value: matrix |
Parent |
Uicontextmenu object's parent |
Value: scalar Figure handle |
Selected |
This property has no effect on Uicontextmenu objects |
|
Tag |
User-specified object identifier |
Value: string |
Type |
Class of graphics object |
Value: string (read-only) Default: uicontrol |
UserData |
User-specified data |
Value: matrix |
Controlling Callback Routine Execution | ||
BusyAction |
Callback routine interruption |
Value: cancel , queue Default: queue |
ButtonDownFcn |
This property has no effect on Uicontextmenu objects |
|
Callback |
Control action |
Value: string |
CreateFcn |
Callback routine executed during object creation |
Value: string |
DeleteFcn |
Callback routine executed during object deletion |
Value: string |
Interruptible |
Callback routine interruption mode |
Value: on , off Default: on |
UIContextMenu |
This property has no effect on Uicontextmenu objects |
|
Controlling Access to Objects | ||
HandleVisibility |
Whether handle is accessible from command line and GUIs |
Value: on , callback , off Default: on |
HitTest |
This property has no effect on Uicontextmenu objects |
|
% Define the context menu cmenu = uicontextmenu; % Define the line and associate it with the context menu hline = plot(1:10, 'UIContextMenu', cmenu); % Define callbacks for context menu items cb1 = ['set(hline, ''LineStyle'', ''--'')']; cb2 = ['set(hline, ''LineStyle'', '':'')']; cb3 = ['set(hline, ''LineStyle'', ''-'')']; % Define the context menu items item1 = uimenu(cmenu, 'Label', 'dashed', 'Callback', cb1); item2 = uimenu(cmenu, 'Label', 'dotted', 'Callback', cb2); item3 = uimenu(cmenu, 'Label', 'solid', 'Callback', cb3);When the user extend-clicks on the line, the context menu appears, as shown in this figure:
uicontrol
, uimenu