Changeset 472 for trunk/src/fill_GUI.m


Ignore:
Timestamp:
Jun 25, 2012, 12:12:24 AM (12 years ago)
Author:
sommeria
Message:

many bugs repaired. series set to work in mode background

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fill_GUI.m

    r461 r472  
    55errormsg='';
    66fields=fieldnames(Param);%list of fields in Param
     7% loop on the elements of the input structure Param
    78for ifield=1:numel(fields)
    8     if isstruct(Param.(fields{ifield}))
     9    if isstruct(Param.(fields{ifield}))% case of sa sub-structure
    910        if isfield(handles,fields{ifield})
    1011            set(handles.(fields{ifield}),'Visible','on')
     
    1314                hchild.(get(children(ichild),'tag'))=children(ichild);
    1415            end
    15             errormsg=fill_GUI(Param.(fields{ifield}),hchild);
     16            errormsg=fill_GUI(Param.(fields{ifield}),hchild);% apply the function to the substructure
    1617        end
    1718    else
    1819        hh=[];
    19         input_data=Param.(fields{ifield});
     20        input_data=Param.(fields{ifield})
    2021        check_done=0;
    2122        if isfield(handles,fields{ifield})
    22             hh=handles.(fields{ifield});
     23            hh=handles.(fields{ifield})
    2324            if strcmp(get(hh,'Type'),'uitable')
    2425                set(hh,'Visible','on')
     
    4546                    end
    4647                    set(hh,'String',input_data)
    47                 case{'Listbox','popupmenu'}
     48                case{'listbox','popupmenu'}
     49                    input_data
    4850                    if isnumeric(input_data)
    4951                        input_data=num2str(input_data);
    5052                    end
    5153                    menu=get(hh,'String');
    52                     iline=find(strcmp(input_data,menu));
    53                     if isempty(iline)
    54                         iline=numel(menu)+1;
    55                         set(hh,'String',[menu;{input_data}])
     54                    if ischar(input_data)
     55                        input_data={input_data};
    5656                    end
    57                     set(hh,'Value',iline)
     57                    values=zeros(size(input_data));
     58                    for idata=1:numel(input_data)
     59                        iline=find(strcmp(input_data{idata},menu));
     60                        if isempty(iline)
     61                            values(idata)=numel(menu)+1;
     62                            menu=[menu;input_data(idata)];
     63                        else
     64                            values(idata)=iline;
     65                        end
     66                    end
     67                    set(hh,'String',[menu;input_data(idata)])
     68                    set(hh,'Value',values)
    5869            end
    5970        end
Note: See TracChangeset for help on using the changeset viewer.