Changeset 361 for trunk/src/fill_GUI.m
- Timestamp:
- Jan 9, 2012, 8:26:06 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/fill_GUI.m
r360 r361 7 7 for ifield=1:numel(fields) 8 8 if isstruct(Param.(fields{ifield})) 9 fields{ifield}10 9 if isfield(handles,fields{ifield}) 11 errormsg=fill_GUI(Param.(fields{ifield}),get(handles.(fields{ifield}),'children')); 10 set(handles.(fields{ifield}),'Visible','on') 11 children=get(handles.(fields{ifield}),'children'); 12 for ichild=1:numel(children) 13 hchild.(get(children(ichild),'tag'))=children(ichild); 14 end 15 errormsg=fill_GUI(Param.(fields{ifield}),hchild); 12 16 end 13 17 else 14 fields{ifield} 15 num2str(Param.(fields{ifield})) 16 if isnumeric(Param.(fields{ifield})) 17 if isfield(handles,['num_' fields{ifield}]) 18 set(handles.(['num_' fields{ifield}]),'String',num2str(Param.(fields{ifield}))) 18 hh=[]; 19 if isfield(handles,fields{ifield}) 20 hh=handles.(fields{ifield}); 21 if strcmp(get(hh,'Type'),'uitable') 22 set(hh,'Data',input) 23 break 19 24 end 20 else 21 if isfield(handles,fields{ifield}) 22 set(handles.(fields{ifield}),'String',num2str(Param.(fields{ifield}))) 25 elseif isnumeric(input) && isfield(handles,['num_' fields{ifield}]) 26 hh=handles.(['num_' fields{ifield}]); 27 end 28 if ~isempty(hh) 29 set(hh,'Visible','on') 30 switch get(hh,'style') 31 case {'checkbox','pushbutton','radiobutton','togglebutton'} 32 if isnumeric(input) 33 set(hh,'Value',input) 34 end 35 case 'edit' 36 if isnumeric(input) 37 input=num2str(input); 38 end 39 set(hh,'String',input) 40 case{'Listbox','popupmenu'} 41 if isnumeric(input) 42 input=num2str(input); 43 end 44 menu=get(hh,'String'); 45 iline=find(strcmp(input,menu)); 46 if isempty(iline) 47 iline=numel(menu)+1; 48 set(hh,'String',[menu;{input}]) 49 end 50 set(hh,'Value',iline) 23 51 end 24 52 end
Note: See TracChangeset
for help on using the changeset viewer.