Changeset 681 for trunk/src/mouse_down.m
- Timestamp:
- Sep 2, 2013, 2:42:52 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_down.m
r680 r681 59 59 UvData=get(huvmat,'UserData'); 60 60 test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler action, second priority; 61 test_edit=get(hhuvmat.CheckEditObject,'Value') && (isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint'));%test for object editing, third priority61 test_edit=get(hhuvmat.CheckEditObject,'Value');%&& (isequal(obj_tag,'proj_object')||isequal(obj_tag,'DeformPoint'));%test for object editing, third priority 62 62 hset_object=findobj(allchild(0),'Name','set_object'); 63 63 if ~isempty(hset_object) … … 97 97 ind_object=find(check_pos(:,1) & check_pos(:,2),1);% select the index of the (first) object under the mouse 98 98 hchild=hchildren(ind_object);% corresponding object handle 99 htype=''; 99 100 if ~isempty(hchild) 100 101 htype=get(hchild,'Type');%type of object child of the current figure … … 105 106 xy=get(hchild,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 106 107 AxeData=get(hchild,'UserData');% data attached to the axis 107 % if isfield(AxeData,'ObjectCoord') && size(AxeData.ProjObjectCoord,2)==3 108 % xy(1,3)=AxeData.ProjObjectCoord(1,3); % z coordinate of the mouse: to generalise ... 109 % else 110 % xy(1,3)=0; % z coordinate set to 0 by default 111 % end 108 AxeData.Enable='on';% unable current axes for mouse up action 112 109 AxeData.CurrentOrigin=xy(1,1:2);% The current point set by the mouse becomes the current origin 113 110 … … 135 132 end 136 133 end 137 %break% leave the loop once an axes has been selected 138 134 set(hchild,'UserData',AxeData) 139 135 %if the mouse is over a uicontrol, with right mouse button activated, duplicate the display in an editable zoom window 140 136 case 'uicontrol' … … 153 149 hhchildren=get(hchild,'Children');%handles of all objects in the selected panel 154 150 check_visible=strcmp(get(hhchildren,'Visible'),'on');%=1 if visible='on', =0 otherwise 155 hhchildren=hhchildren(check_visible); %keep only the visible children 156 151 hhchildren=hhchildren(check_visible); %keep only the visible children 157 152 PosChildren=get(hhchildren,'Position'); 158 153 PosLength=cellfun('length',PosChildren); … … 171 166 end 172 167 end 173 end 174 % return %leave the function once a uicontrol has been selected 175 end 176 end 177 168 end 169 end 170 end 171 if ~strcmp(htype,'axes') 172 currentaxes=get(hObject,'CurrentAxes'); 173 if ~isempty(currentaxes) 174 AxeData=get(currentaxes,'UserData');% data attached to the axis 175 AxeData.Enable='off';% desactivate current axes for mouse up action 176 set(currentaxes,'UserData',AxeData); 177 end 178 end 179 178 180 %% zoom has first priority, stop here 179 181 if CheckZoom … … 236 238 %% selection of an existing projection object (third priority) 237 239 if test_edit 240 testdeform=0; 238 241 if ~(isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'create')) 239 242 userdata=get(hcurrentobject,'UserData'); … … 293 296 set_object(UvData.ProjObject{IndexObj}) 294 297 axes(hchild);%set back the current axes haxes 295 testdeform=0;296 298 set(gcbo,'Pointer','circle'); 297 299 AxeData.Drawing='deform'; … … 307 309 end 308 310 end 309 if testdeform==0 311 % if testdeform==0 312 % AxeData.Drawing='translate'; 313 % set(AxeData.CurrentObject,'Selected','on') 314 % set(gcbo,'Pointer','fleur'); 315 % end 316 else 317 if strcmp(get(hCurrentGUI,'tag'),'uvmat') %if the uvmat graph has been selected, object projection is on the other frame view_field 318 IndexObj=get(hhuvmat.ListObject,'Value'); 319 AxeData.CurrentObject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat; 320 else 321 IndexObj=get(hhuvmat.ListObject_1,'Value'); 322 AxeData.CurrentObject=UvData.ProjObject{IndexObj}.DisplayHandle.view_field; 323 end 324 ObjectData=get(AxeData.CurrentObject,'UserData'); 325 ObjectData.IndexObj=IndexObj; 326 set(AxeData.CurrentObject,'UserData',ObjectData) 327 end 328 if testdeform==0 310 329 AxeData.Drawing='translate'; 311 330 set(AxeData.CurrentObject,'Selected','on') 312 331 set(gcbo,'Pointer','fleur'); 313 end314 332 end 315 333 end
Note: See TracChangeset
for help on using the changeset viewer.