Why is UIAxes default interactivity disabled with WindowScrollWheelFcn?

3 visualizzazioni (ultimi 30 giorni)
Why do default interactions (pan, zoom, etc.) for UIAxes become disabled when declaring hardware callbacks such as WindowScrollWheelFcn?  To illustrate, compare the behaviors in the following two examples:
%%
f1 = uifigure;
ax1 = uiaxes(f1);
surf(ax1,peaks); %default interactions are enabled
%%
f2 = uifigure;
ax2 = uiaxes(f2);
surf(ax2,peaks);
f2.WindowScrollWheelFcn = 'disp("hello")'; %disables default interactions such as pan, rotate, etc.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 18 Gen 2024
Modificato: MathWorks Support Team il 29 Feb 2024 alle 12:45
This is currently the expected behavior.  Here are two possible workarounds:
1) Enable the interactions via the axes toolbar ("axtoolbar"), which is available in R2018b and later.  The interactions can be enabled by clicking the desired control in the toolbar.
Please run the below command in the MATLAB R2018b command window to get the release specific documentation with more information about "axtoolbar":
web(fullfile(docroot, 'matlab/ref/axtoolbar.html'))
2) Alternatively, enable the specific interaction programatically, as exemplified below:
%enable pan
pan(ax2, 'on');
%enable rotate
rotate3d(ax2, 'on');
% enable zoom
zoom(ax2, 'on');
Note: This method only allows one interaction (pan, zoom, rotate, etc.) to be enabled at a time.
Please follow the below link to search for the required information regarding the current release:

Più risposte (0)

Categorie

Scopri di più su Visual Exploration in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Prodotti


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by