Changeset 675 for trunk/src/set_object.m


Ignore:
Timestamp:
Aug 27, 2013, 11:25:21 PM (11 years ago)
Author:
sommeria
Message:

various bugs corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r674 r675  
    270270%------------------------------------------------------------------------
    271271% --- Executes on selection change in ProjMode.
     272%------------------------------------------------------------------------
     273
    272274function ProjMode_Callback(hObject, eventdata, handles)
    273275menu=get(handles.ProjMode,'String');
     
    305307switch ObjectStyle
    306308    case 'points'
    307         set(handles.num_RangeY_2,'TooltipString','num_YMax: range of projection around each point')
     309        set(handles.num_RangeY_2,'TooltipString','num_RangeY_2: range of projection around each point')
    308310%         set(handles.XObject,'TooltipString','XObject: set of x coordinates of the points')
    309311%         set(handles.YObject,'TooltipString','YObject: set of y coordinates of the points')
    310312%         set(handles.ZObject,'TooltipString','ZObject: set of z coordinates of the points')
    311313    case {'line','polyline','polygon'}
    312         set(handles.num_RangeY_2,'TooltipString','num_YMax: range of projection around the line')
     314        set(handles.num_RangeY_2,'TooltipString','num_RangeY_2: range of projection around the line')
    313315         set(handles.Coord,'TooltipString','Coord: table of x,y, z coordinates defining the line')
    314316%         set(handles.YObject,'TooltipString','YObject: set of y coordinates defining the line')
     
    319321        end       
    320322    case {'rectangle','ellipse'}
    321         set(handles.num_RangeX_2,'TooltipString',['num_XMax: half length of the ' ObjectStyle])
    322         set(handles.num_RangeY_2,'TooltipString',['num_YMax: half width of the ' ObjectStyle])
     323        set(handles.num_RangeX_2,'TooltipString',['num_RangeX_2: half length of the ' ObjectStyle])
     324        set(handles.num_RangeY_2,'TooltipString',['num_RangeY_2: half width of the ' ObjectStyle])
    323325%         set(handles.XObject,'TooltipString',['XObject:  x coordinate of the ' Type ' centre'])
    324326%         set(handles.YObject,'TooltipString',['YObject:  y coordinate of the ' Type ' centre'])
     
    636638dir_save=uigetfile_uvmat('select the folder for the new xml object file:',RootPath,'uigetdir');
    637639if ~isempty(dir_save)
    638     % dir_save=uigetdir(RootPath);
    639640    ObjectName=get(handles.Name,'String');
    640641    if ~isempty(ObjectName)&&~strcmp(ObjectName,'')
    641         def={fullfile(dir_save,[ObjectName '.xml'])};
     642        def=[ObjectName '.xml'];
    642643    else
    643         def={fullfile(dir_save,[Object.Style '.xml'])};
    644     end
    645     displ_txt='save object as an .xml file';%default display
     644        def=[Object.Style '.xml'];
     645    end
     646    displ_txt={'save object as an .xml file in';dir_save};%default display
    646647    menu=get(handles.ProjMode,'String');
    647648    value=get(handles.ProjMode,'Value');
    648649    ProjMode=menu{value};
    649650    if strcmp(ProjMode,'mask_inside')||strcmp(ProjMode,'mask_outside')
    650         displ_txt='save mask contour as an .xml file: to create a mask image, use save_mask on the GUI uvmat (lower right)';
    651     end
    652     answer=msgbox_uvmat('INPUT_TXT','save object as an .xml file',def);
    653     if ~isempty(answer)
     651        displ_txt={'save mask contour as an .xml file:'; 'to create a mask image, use save_mask on the GUI uvmat (lower right)'};
     652    end
     653    answer=msgbox_uvmat('INPUT_TXT',displ_txt,def);
     654    if iscell(answer)
     655        FullName=fullfile(dir_save,answer{1});
    654656        t=struct2xml(Object);
    655657        t=set(t,1,'name','ProjObject');
    656         save(t,answer{1})
    657     end
    658     msgbox_uvmat('CONFIRMATION',[answer{1}  ' saved'])
     658        save(t,FullName)
     659        msgbox_uvmat('CONFIRMATION',[FullName  ' saved'])
     660    end
    659661end
    660662
Note: See TracChangeset for help on using the changeset viewer.