Changeset 472 for trunk/src/fill_GUI.m
- Timestamp:
- Jun 25, 2012, 12:12:24 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/fill_GUI.m
r461 r472 5 5 errormsg=''; 6 6 fields=fieldnames(Param);%list of fields in Param 7 % loop on the elements of the input structure Param 7 8 for ifield=1:numel(fields) 8 if isstruct(Param.(fields{ifield})) 9 if isstruct(Param.(fields{ifield}))% case of sa sub-structure 9 10 if isfield(handles,fields{ifield}) 10 11 set(handles.(fields{ifield}),'Visible','on') … … 13 14 hchild.(get(children(ichild),'tag'))=children(ichild); 14 15 end 15 errormsg=fill_GUI(Param.(fields{ifield}),hchild); 16 errormsg=fill_GUI(Param.(fields{ifield}),hchild);% apply the function to the substructure 16 17 end 17 18 else 18 19 hh=[]; 19 input_data=Param.(fields{ifield}) ;20 input_data=Param.(fields{ifield}) 20 21 check_done=0; 21 22 if isfield(handles,fields{ifield}) 22 hh=handles.(fields{ifield}) ;23 hh=handles.(fields{ifield}) 23 24 if strcmp(get(hh,'Type'),'uitable') 24 25 set(hh,'Visible','on') … … 45 46 end 46 47 set(hh,'String',input_data) 47 case{'Listbox','popupmenu'} 48 case{'listbox','popupmenu'} 49 input_data 48 50 if isnumeric(input_data) 49 51 input_data=num2str(input_data); 50 52 end 51 53 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}; 56 56 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) 58 69 end 59 70 end
Note: See TracChangeset
for help on using the changeset viewer.