Adding a contextmenu to an axes that mimics pan/zoom/rotate's contextmenu behavior
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I'm trying to implement a customized UIcontextMenu
hFigure = figure;
currentAxes = axes;
hline = plot(currentAxes,1:10);
props_context.Parent = hFigure;
props_context.Tag = 'myContextMenu';
currentAxes.UIContextMenu = uicontextmenu(props_context);
hui = currentAxes.UIContextMenu;
props = [];
props.Label = 'Test';
props.Tag = 'Test';
props.Separator = 'off';
props.Callback = @foo;
ufullview = uimenu(hui,props);
So far so good. But notice that I'm not able to right click on the line in the axes and have the contextmenu popping up.
I know one way to work around this would be to turn the line's hittest or pickablepart 'off', however if I do that
hline.HitTest = 'off';
Now if I enable the data cursor mode, note that it won't work because I just turned the HitTest to 'off'.
So my question goes...is there a way to add a context menu that works just like the pan/zoom/rotate mode's context menu? Note that they work regardless where you click within the axes.
Thanks
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!