Index: trunk/src/uvmat.m
===================================================================
--- trunk/src/uvmat.m	(revision 65)
+++ trunk/src/uvmat.m	(revision 67)
@@ -222,4 +222,5 @@
 set(hObject,'WindowButtonDownFcn',{'mouse_down'})%set mouse click action function
 set(hObject,'WindowButtonUpFcn',{'mouse_up',handles}) 
+set(hObject,'DeleteFcn',{@closefcn})%
 
 %TRANSFORM menu: loads the information stored in prefdir to initiate the browser and the list of functions
@@ -1841,4 +1842,5 @@
 if  ~isequal(transform_name,'') && ~isequal(transform_name,'px')
     if test_1 && isfield(UvData,'XmlData_1') && isfield(UvData.XmlData_1,'GeometryCalib')%use geometry calib recorded from the ImaDoc xml file as first priority
+        Field_a=transform(Field_a,UvData.XmlData_1);%the first field has been stored without transform
         Field_b=transform(Field_b,UvData.XmlData_1);
     elseif ~test_1 && isfield(UvData,'XmlData') && isfield(UvData.XmlData,'GeometryCalib')%use geometry calib
@@ -4352,8 +4354,4 @@
 
 % --------------------------------------------------------------------
-function MenuRun_Callback(hObject, eventdata, handles)
-% --------------------------------------------------------------------
-
-% --------------------------------------------------------------------
 function MenuHelp_Callback(hObject, eventdata, handles)
 % --------------------------------------------------------------------
@@ -4367,13 +4365,4 @@
 end
 
-% --------------------------------------------------------------------
-function MenuOpen_Callback(hObject, eventdata, handles)
-% --------------------------------------------------------------------
-% --------------------------------------------------------------------
-function MenuOpen_1_Callback(hObject, eventdata, handles)
-% --------------------------------------------------------------------
-% --------------------------------------------------------------------
-function MenuExport_Callback(hObject, eventdata, handles)
-% --------------------------------------------------------------------
 
 % --------------------------------------------------------------------
@@ -4468,13 +4457,16 @@
 set(handles.zoom,'Value',0)
 set(handles.zoom,'BackgroundColor',[0.7 0.7 0.7])
+set(handles.MenuTools,'enable','off')
+set(handles.MenuObject,'enable','off')
+set(handles.MenuEdit,'enable','off')
 %         set(handles.create,'Value',0)
 %         set(handles.create,'BackgroundColor',[0 1 0])
 %         set(handles.create,'enable','off')      
-set(handles.edit_vect,'Value',0)
-set(handles.edit_vect,'enable','off')
-edit_vect_Callback(hObject, eventdata, handles)
-set(handles.edit,'Value',0)
-set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
-set(handles.edit,'enable','off')
+% set(handles.edit_vect,'Value',0)
+% set(handles.edit_vect,'enable','off')
+% edit_vect_Callback(hObject, eventdata, handles)
+% set(handles.edit,'Value',0)
+% set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
+% set(handles.edit,'enable','off')
 set(handles.list_object_1,'Value',1)      
 % initiate display of GUI geometry_calib
@@ -4669,5 +4661,7 @@
 
 % ------------------------------------------------------------------
-function MenuEdit_Callback(hObject, eventdata, handles)
+function MenuEditObject_Callback(hObject, eventdata, handles)
+set(handles.edit,'Value',1)
+edit_Callback(hObject, eventdata, handles)
 
 %--------------------------------------------------------------------------
@@ -4851,2 +4845,20 @@
 set(handles.uvmat,'UserData',UvData);
 
+%------------------------------------------------------------------------
+% executed when closing: set the parent interface button to value 0
+function closefcn(gcbo,eventdata)
+%------------------------------------------------------------------------
+%delete all the associated figures if exist
+hh=findobj(allchild(0),'tag','view_field');
+if ~isempty(hh)
+    delete(hh)
+end
+hh=findobj(allchild(0),'name','geometry_calib');
+if ~isempty(hh)
+    delete(hh)
+end
+hh=findobj(allchild(0),'tag','set_object');
+if ~isempty(hh)
+    hhh=findobj(hh,'tag','PLOT');
+    set(hhh,'enable','off')
+end
