Ignore:
Timestamp:
Apr 23, 2013, 4:22:08 PM (11 years ago)
Author:
sommeria
Message:

a few bugs repaired

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uigetfile_uvmat.m

    r613 r615  
    1717    option='browser';
    1818end
    19 if exist(InputName,'dir')
    20     InputDir=InputName;
    21       InputFileName='';
    22 elseif exist(InputName,'file')
    23     [InputDir,InputFileName,Ext]=fileparts(InputName);
    24     if isempty(InputFileName)% if InputName is already the root
    25         InputFileName=InputDir;
    26         if  ~isempty(strcmp (computer, {'PCWIN','PCWIN64'}))%case of Windows systems
    27             InputDir=[InputDir '\'];% append '\' for a correct action of dir
    28             InputFileName=[InputFileName '\'];
    29         end
    30     end
    31     if isdir(InputName)
    32         InputFileName=['+/' InputFileName Ext];
    33     end
    34 else
    35     InputDir=pwd;%look in the current work directory if the input file does not exist
    36     InputFileName='';
     19InputDir=pwd;%look in the current work directory if the input file does not exist
     20InputFileName='';%default
     21if ischar(InputName)
     22    if exist(InputName,'dir')
     23        InputDir=InputName;
     24        InputFileName='';
     25    elseif exist(InputName,'file')
     26        [InputDir,InputFileName,Ext]=fileparts(InputName);
     27        if isempty(InputFileName)% if InputName is already the root
     28            InputFileName=InputDir;
     29            if  ~isempty(strcmp (computer, {'PCWIN','PCWIN64'}))%case of Windows systems
     30                InputDir=[InputDir '\'];% append '\' for a correct action of dir
     31                InputFileName=[InputFileName '\'];
     32            end
     33        end
     34        if isdir(InputName)
     35            InputFileName=['+/' InputFileName Ext];
     36        end
     37    end
    3738end
    3839hfig=findobj(allchild(0),'tag',option);
     
    4849    uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.97 0.5 0.03],'BackgroundColor',BackgroundColor,...
    4950            'String','path:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','left');
    50     uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.89 0.9 0.08],'tag','titlebox','Max',2,'BackgroundColor',[1 1 1],'Callback',@refresh_GUI,...
     51    uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.89 0.9 0.08],'tag','titlebox','Max',2,'BackgroundColor',[1 1 1],'Callback',@titlebox_Callback,...
    5152        'String',InputDir,'FontUnits','points','FontSize',12,'FontWeight','bold');
    5253    uicontrol('Style','pushbutton','Tag','backward','Units','normalized','Position',[0.05 0.75 0.1 0.07],...
     
    8687end
    8788
    88 
     89%------------------------------------------------------------------------   
     90% --- launched by refreshing the display figure
     91function titlebox_Callback(hObject,event)
     92refresh_GUI(hObject)
     93%------------------------------------------------------------------------
    8994
    9095%------------------------------------------------------------------------   
     
    194199function list_Callback(option,hObject,event)
    195200%------------------------------------------------------------------------
     201    set(hObject,'BackgroundColor',[1 1 0])% paint list in yellow to indicate action
     202    drawnow
    196203list=get(hObject,'String');
    197204index=get(hObject,'Value');
     
    255262    end
    256263end
     264set(hObject,'BackgroundColor',[0.7 0.7 0.7])% paint list in grey to indicate action end
    257265
    258266%-------------------------------------------------------------------------   
Note: See TracChangeset for help on using the changeset viewer.