Filter löschen
Filter löschen

How can I set an ActionPostCallback of zoomInteraction from default axes toolbar (UIAxes / Appdesigner)?

39 Ansichten (letzte 30 Tage)
Hey guys,
is there a way to set an ActionPostCallback / ActionPreCallback in the default zoomInteraction of default axes toolbar? In specific, I would like to update several user input fields containing the axes limits after zooming in a UIAxes.
In the past, when I used GUIDE, I had the possiblity of setting the ActionPostCallback of the zoom object:
h = zoom;
h.ActionPostCallback = @mypostcallback;
How can I do that in Appdesigner?
Thanks for your help and kind regards,
Benjamin

Antworten (1)

Gouri Chennuru
Gouri Chennuru am 13 Aug. 2020
Hi Benjamin,
You can execute zoom functionality using 3 different types of call backs ButtonDownFilter, ActionPreCallback, ActionPostCallback.
You can create callbacks for pre and post-buttonDown events for zoom mode objects to trigger, as follows
h = zoom;
h.ActionPreCallback = @myprecallback;
h.ActionPostCallback = @mypostcallback;
h.Enable = 'on';
%
function myprecallback(obj,evd)
disp('A zoom is about to occur.');
%
function mypostcallback(obj,evd)
disp('A zoom has occured.');
Hope this Helps!
  1 Kommentar
Benjamin Hackl
Benjamin Hackl am 14 Aug. 2020
Hi Gouri,
thanks for you immediate answer. Originally I tried to immplement a ActionPostCallback (UIAxes in Appdesigner) in two different ways:
1) Modification of default zoomin function of standard axestoolbar: unfortunately the default object does not have properties like: ActionPreCallback / ActionPostCallback
2) Creating my own zoom-button on the axestoolbar with axtoolbarbnt() function with:
h = zoom(UIAxes_name)
Apperently the zoom() function does not give any function handle back in Appdesigner. Means, I do not have access to their callbacks, like: h.ActionPostCallback = @mypostcallback;
Meanwhile I found the following community entry:
For the moment my intention to connect a function to zooming action in Appdesigner seems to be impossible.
Do you have any further idea / advices?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graphics Object Properties 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!

Translated by