Disable arrows in uitoggletool (zoom) in GUI.

2 Ansichten (letzte 30 Tage)
Dimani4
Dimani4 am 28 Jun. 2021
Beantwortet: Dimani4 am 29 Jun. 2021
Hi people,
I did some gui with some 2D intensity picture. When the GUI opens if I click in some place on the picture the cursor appears. Every pixel means some graph. I can move the cursor with arrows on the keyboard. I add zoom button to the GUI. If I make zoom on the picture and then disable the button of zoom (by clicking on it) if I try to move the cursor with the arrows (as before) it doesnt let me do it. After I zoom the picture I can control zoom also with arrows. I guess somehow it is interracting with the cursor function, i.e. after opening zoom I cannot move cursor with arrows even if zoom is disabled. However if I dont use zoom I can move the cursor with arrows without any problems. But since I used zoom I cannot move the cursor with the arrows. The question is how to enable arrows again to move the cursor after zoom function.
Thank you.
Arrows I mean arrows on the keyboard : left, right, up, down.

Akzeptierte Antwort

Dimani4
Dimani4 am 29 Jun. 2021
I got it. It turned out very easy solution. When I push the zoom I turned OFF the datacursor and when I done with zoom I just turned ON again the datacursor. When you turned ON again in the zoomed picture the datacursor you can move it with the arrows.
This is how I turned OFF the datacursor:
function uitoggletool2_OnCallback(hObject, eventdata, handles) %zoom+
% hObject handle to uitoggletool2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% zoom(handles.topogr_image_trace,'off');
% disableDefaultInteractivity(handles.axes1);
% imgzoompan(handles.axes1,'ImgWidth',256,'ImgHeight',256);
global cursorMode;
cursorMode.removeAllDataCursors();
datacursormode off;
handles.radiobutton4.Value=0;
guidata(hObject, handles);
This is how I turn ON the datacursor:
datacursormode on;
cursorMode.removeAllDataCursors();
% hDatatip=cursorMode.createDatatip(handles.raman_measur);
hDatatip=cursorMode.createDatatip(handles.topogr_image_trace);
set(hDatatip, 'Position', pos) ;
updateDataCursors(cursorMode);
Thank you for your generous help.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Produkte


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by