Disable arrows in uitoggletool (zoom) in GUI.

조회 수: 2 (최근 30일)
Dimani4
Dimani4 2021년 6월 28일
답변: Dimani4 2021년 6월 29일
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.

채택된 답변

Dimani4
Dimani4 2021년 6월 29일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by