Index: /trunk/src/browse_data.m
===================================================================
--- /trunk/src/browse_data.m	(revision 740)
+++ /trunk/src/browse_data.m	(revision 741)
@@ -72,5 +72,5 @@
 set(hObject, 'Units', OldUnits);
 if exist('Campaign','var')
-    [CampaignPath,CampaignName]=fileparts(Campaign);
+    [tild,CampaignName]=fileparts(Campaign);
     RootXml=fullfile(Campaign,[CampaignName '.xml']);
     s=[];
@@ -125,16 +125,27 @@
     if isempty(MirrorRoot)
         return
+    elseif strcmp(MirrorRoot,SourcePath)
+        msgbox_uvmat('ERROR','The mirror folder must be different from the source')
+        return
     else
         MirrorDir=fullfile(MirrorRoot,ProjectName);
     end
-    if ~exist(MirrorDir,'dir')
-        mkdir(MirrorDir)
+    if exist(MirrorDir,'dir')
+        msgbox_uvmat('ERROR',['The folder ' MirrorDir ' chosen as new mirror campaign already exists']) 
+        return
+    else
+        [s,errormsg]=mkdir(MirrorDir)% create the mirror dir
+        if s~=1
+            msgbox_uvmat('ERROR',['error in creating ' MirrorDir ': ' errormsg]) 
+            return
+        end
     end
     MirrorDoc.SourceDir=SourceDir;
     t=struct2xml(MirrorDoc);
     set(t,1,'name','DataTree');
-    save(t,fullfile(MirrorDir,[ProjectName '.xml']))
+    save(t,fullfile(MirrorDir,[ProjectName '.xml']))% create an xml file in the mirror folder to indicate its source folder
     set(handles.MirrorDir,'String',MirrorDir)
     set(handles.MirrorDir,'Visible','on')
+    set(handles.CreateMirror,'String','update_mirror')
 end
 ExpName={''};
@@ -206,8 +217,8 @@
  function ListExperiments_Callback(hObject, eventdata, handles)
 
-MirrorPath='';
-CampaignPath=get(handles.SourceDir,'String');
 if strcmp(get(handles.MirrorDir,'Visible'),'on')
     MirrorPath=get(handles.MirrorDir,'String');
+else
+    MirrorPath=get(handles.SourceDir,'String');
 end
 ListExperiments=get(handles.ListExperiments,'String');
@@ -229,5 +240,5 @@
 for iexp=1:numel(ListExperiments)
     if strcmp(ListExperiments{iexp}(1),'+')% if the item is a directory
-        ListExperiments{iexp}(1)=[];
+        ListExperiments{iexp}(1)=[];%remove the first char '+' used to mark folders
         ListStruct=dir(fullfile(MirrorPath,ListExperiments{iexp})); %list files and dir in the source experiment directory
         ListCells=struct2cell(ListStruct);%transform dir struct to a cell arrray
@@ -279,8 +290,8 @@
                 if ~isempty(MirrorPath)
                     mirror=fullfile(MirrorPath,ListExperiments{iexp},ListFiles{ilist});
-                    if exist(mirror,'dir')||exist(mirror,'file')
+                    if exist(mirror,'file')% if mirror already exists as a file or folder
                         [tild,msg]=fileattrib(mirror);
                         if strcmp(msg.Name,mirror)%if the mirror name already exists as a local file or dir
-                            if msg.directory% case of a f
+                            if msg.directory% case of a folder
                                 answer=msgbox_uvmat('INPUT_Y-N',['replace local folder ' msg.Name ' by a link to the source dir']);
                                 if strcmp(answer,'Yes')
@@ -292,15 +303,14 @@
                                     end
                                 end
-                            else
+                            else % case of an existing mirror file
                                 answer=msgbox_uvmat('INPUT_Y-N',['replace local file ' msg.Name ' by a link to the source file']);
                                 if strcmp(answer,'Yes')
                                     delete(mirror);
-                                    system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder
-                                    
+                                    system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder                                  
                                 end
                             end
-                        else% create mirror to the data series if needed
-                            system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder
                         end
+                    else% create mirror to the data series if needed
+                        system(['ln -s ' DataSeries ' ' mirror]); % create the link to the source folder                     
                     end
                     if isempty(find(strcmp(ListFiles{ilist},ListDevices), 1))% if the item is not already in ListDevices
@@ -586,4 +596,5 @@
 Device=Device(Value);
 Device=regexprep(Device,'^\+/','');% remove the +/ used to mark dir
+Device=regexprep(Device,'^~','');% remove the ~ used to mark symbolic link
 handles.output.Experiment=Experiment;
 handles.output.DataSeries=Device;
Index: /trunk/src/mouse_motion.m
===================================================================
--- /trunk/src/mouse_motion.m	(revision 740)
+++ /trunk/src/mouse_motion.m	(revision 741)
@@ -25,8 +25,4 @@
 function mouse_motion(hObject,eventdata,handles)
 
-% if ~exist('handles','var')
-%     set(hCurrentFig,'Pointer','arrow');
-%     return
-% end
 FigData=get(hObject,'UserData');
 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
@@ -84,4 +80,5 @@
 % AxeData=[];%default
 xy=[];%default
+set(hCurrentFig,'Units','normalized')
 xy_fig=get(hObject,'CurrentPoint');% current point of the current figure (gcbo)
 pointershape='arrow';% default pointer is an arrow 
@@ -218,9 +215,9 @@
             end
             %display the z coordinate if defined by the projection plane
-            if isfield(Field,'ObjectType') && strcmp(Field.ObjectType,'plane') && isfield(Field,'ObjectCoord') && length(Field.ObjectCoord)>=3
+            if isfield(Field,'ProjObjectType') && strcmp(Field.ProjObjectType,'plane') && isfield(Field,'ProjObjectCoord') && length(Field.ProjObjectCoord)>=3
                 pos=[xy(1,1) xy(1,2) 0];
-                if isfield(Field,'ObjectAngle')&&~isequal(Field.ObjectAngle,[0 0 0])
-                    om=norm(Field.ObjectAngle);%norm of rotation angle in radians
-                    OmAxis=Field.ObjectAngle/om; %unit vector marking the rotation axis
+                if isfield(Field,'ProjObjectAngle')&&~isequal(Field.ProjObjectAngle,[0 0 0])
+                    om=norm(Field.ProjObjectAngle);%norm of rotation angle in radians
+                    OmAxis=Field.ProjObjectAngle/om; %unit vector marking the rotation axis
                     cos_om=cos(pi*om/180);
                     sin_om=sin(pi*om/180);
@@ -228,5 +225,6 @@
                     pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1-cos_om)*(OmAxis*pos')*OmAxis;
                 end
-                pos=pos+[Field.ObjectCoord 0];
+               % pos=pos+[Field.ProjObjectCoord 0];
+               pos=pos+Field.ProjObjectCoord;
                 text_displ_3=[text_displ_3 'x,y,z=' num2str(pos,4)];
             end
