Why is UIAxes default interactivity disabled with WindowScrollWheelFcn?

1 回表示 (過去 30 日間)
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.

採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 1 月 18 日
編集済み: MathWorks Support Team 2024 年 2 月 29 日
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:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by