Changeset 625 for trunk/src/mouse_motion.m
- Timestamp:
- May 2, 2013, 7:51:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r622 r625 30 30 FigData=get(hObject,'UserData'); 31 31 if ishandle(FigData)% case of a zoom plot, the handle of the parent rectangle is stored in UserData, its parent is the plotting axes of the rectangle 32 CurrentFig=get(get(FigData,'parent'),'parent');32 hCurrentFig=get(get(FigData,'parent'),'parent'); 33 33 else 34 CurrentFig=hObject;%usual plot35 end 36 hhCurrentFig=guidata( CurrentFig);%handles of the elements in the GUI containing the current figure (uvmat or view_field)34 hCurrentFig=hObject;%usual plot 35 end 36 hhCurrentFig=guidata(hCurrentFig);%handles of the elements in the GUI containing the current figure (uvmat or view_field) 37 37 CheckZoom=get(hhCurrentFig.CheckZoom,'Value');% check for zoom on mode 38 38 CheckZoomFig=get(hhCurrentFig.CheckZoomFig,'Value');% check for zoom sub fig creation mode 39 hPlotAxes=hhCurrentFig.PlotAxes';% handles of the main plot axes 40 AxeData=get(hPlotAxes,'UserData');% data attached to the axis 41 test_draw=0;%test for mouse drawing of object, =0 by default 42 if isfield(AxeData,'Drawing')&& ~isempty(AxeData.Drawing) 43 test_draw=~isequal(AxeData.Drawing,'off');%=1 if mouse drawing of object is active 44 end 39 45 test_zoom_draw=0; 40 test_draw=0;%test for mouse drawing of object, =0 by default41 46 test_object=0; %test for object editing or creation 42 47 test_edit_object=0;% edit test for mouse shap: an arrow … … 64 69 text_displ_4=''; 65 70 66 AxeData=[];%default71 % AxeData=[];%default 67 72 xy=[];%default 68 73 xy_fig=get(hObject,'CurrentPoint');% current point of the current figure (gcbo) … … 92 97 CurrentAxes=hchild; 93 98 xy=get(CurrentAxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 94 AxeData=get(CurrentAxes,'UserData');% data attached to the axis95 if isfield(AxeData,'Drawing')&& ~isempty(AxeData.Drawing)96 test_draw=~isequal(AxeData.Drawing,'off');%=1 if mouse drawing of object is active97 end98 99 test_zoom_draw=test_draw && isequal(AxeData.Drawing,'zoom')&& isfield(AxeData,'CurrentOrigin') && isequal(get(gcf,'SelectionType'),'normal'); 99 100 test_object=test_draw && isfield(AxeData,'CurrentObject') && ~isempty(AxeData.CurrentObject) && ishandle(AxeData.CurrentObject); 100 %if ~test_edit_object && ~test_zoom_draw && ~test_ruler101 101 if ~test_edit_object && ~test_ruler && ~CheckZoom 102 102 pointershape='crosshair';%set pointer with cross shape (default when mouse is over an axis) 103 103 end 104 FigData=get( CurrentFig,'UserData');104 FigData=get(hCurrentFig,'UserData'); 105 105 tagaxes=get(CurrentAxes,'tag'); 106 106 if isfield(FigData,tagaxes) … … 130 130 pointershape='arrow'; %mouse indicates the detection of a vector 131 131 if isempty(hhh) 132 set(0,'CurrentFigure', CurrentFig)133 set( CurrentFig,'CurrentAxes',CurrentAxes)132 set(0,'CurrentFigure',hCurrentFig) 133 set(hCurrentFig,'CurrentAxes',CurrentAxes) 134 134 rectangle('Curvature',[1 1],... 135 135 'Position',[X(ivec)-Field.CoordMesh/2 Y(ivec)-Field.CoordMesh/2 Field.CoordMesh Field.CoordMesh],'EdgeColor','m',... … … 232 232 hhhh=findobj(CurrentAxes,'Tag','PIV_search_marker'); 233 233 if isempty(hhh) 234 set(0,'CurrentFigure', CurrentFig)235 set( CurrentFig,'CurrentAxes',CurrentAxes)234 set(0,'CurrentFigure',hCurrentFig) 235 set(hCurrentFig,'CurrentAxes',CurrentAxes) 236 236 rectangle('Curvature',[0 0],... 237 237 'Position',[xround-ibx2 yround-iby2 2*ibx2 2*iby2],'EdgeColor','m',... … … 420 420 421 421 %% update the mouse pointer 422 set( CurrentFig,'Pointer',pointershape);422 set(hCurrentFig,'Pointer',pointershape);
Note: See TracChangeset
for help on using the changeset viewer.