Changeset 71 for trunk/src/mouse_up.m
- Timestamp:
- Mar 29, 2010, 6:34:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_up.m
r67 r71 1 1 %'mouse_up': function activated when the mouse button is released 2 2 %---------------------------------------------------------------- 3 % function mouse_up( ggg,eventdata,handles)3 % function mouse_up(hObject,eventdata,handles) 4 4 % activated by the command: 5 5 % set(hObject,'WindowButtonUpFcn',{'mouse_up'}), … … 22 22 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 23 23 24 function mouse_up( ggg,eventdata,handles)24 function mouse_up(hObject,eventdata,handles) 25 25 MouseAction='none'; %default 26 26 zoomstate=0;%default … … 37 37 zoomstate=get(hhuvmat.zoom,'Value'); 38 38 end 39 % if isequal(MouseAction,'calib') && ~zoomstate 40 % return 41 % end 42 currentfig=gcbo; 43 AxeData=get(gca,'UserData'); 39 currentfig=hObject; 44 40 currentaxes=gca; %store the current axes handle 41 AxeData=get(currentaxes,'UserData'); 42 45 43 test_drawing=0;%default 46 44 … … 52 50 IndexObj=PlotData.IndexObj; 53 51 ObjectData=UvData.Object{IndexObj}; 52 ObjectData.enable_plot=1; 54 53 if isequal(AxeData.Drawing,'translate') 55 54 XYData=AxeData.CurrentOrigin; … … 264 263 % editing calibration point 265 264 if strcmp(MouseAction,'calib') 266 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 267 hh=findobj('Tag','calib_points')%look for handle of calibration points 265 hh=findobj(currentaxes,'Tag','calib_points')%look for handle of calibration points 268 266 if ~isempty(hh) 269 267 set(hh,'UserData',[])%remove edit mode 270 end 271 strline=[ ' | ' ' | ' ' | ' num2str(xy(1,1),4) ' | ' num2str(xy(1,2),4)]; 272 h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI 273 hh_geometry_calib=guidata(h_geometry_calib); 274 h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord'); 275 Coord=get(h_ListCoord,'String'); 276 val=get(h_ListCoord,'Value'); 277 % if length(Coord)>=val 278 % Coord(val+1:length(Coord)+1)=Coord(val:length(Coord));% push the list forward beyond the current point 279 % end 280 Coord{val}=strline; 281 set(h_ListCoord,'String',Coord) 282 %set(h_ListCoord,'Value',val+1) 283 %geometry_calib('ListCoord_Callback',hObject,eventdata,hh_geometry_calib) 284 %data=read_geometry_calib(Coord);%transform char cell to numbers 285 %XCoord=data.Coord(:,4); 286 %YCoord=data.Coord(:,5) 268 h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI 269 hh_geometry_calib=guidata(h_geometry_calib); 270 h_ListCoord=hh_geometry_calib.ListCoord; %handles of the coordinate list 271 Coord=get(h_ListCoord,'String'); 272 val=get(h_ListCoord,'Value'); 273 coord_str=Coord{val}; %current line (string) 274 k=findstr('|',coord_str);%find separator indices on the string 275 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 276 if numel(k)>=3 277 coord_str=[coord_str(1:k(3)-1) '| ' num2str(xy(1,1),4) ' | ' num2str(xy(1,2),4)]; %update the pixel information while preserving phys coord 278 else 279 coord_str=[ ' | ' ' | ' ' | ' num2str(xy(1,1),4) ' | ' num2str(xy(1,2),4)]; 280 end 281 Coord{val}=coord_str; 282 set(h_ListCoord,'String',Coord) 283 end 287 284 end 288 285 … … 301 298 hruler=findobj(currentaxes,'Tag','ruler'); 302 299 delete(hruler) 300 AxeData.Drawing='off';%stop current drawing a 303 301 end 304 302
Note: See TracChangeset
for help on using the changeset viewer.