Changeset 667 for trunk/src/fill_GUI.m
- Timestamp:
- Jul 15, 2013, 2:50:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/fill_GUI.m
r664 r667 25 25 UserData=get(GUI_handle,'UserData'); 26 26 fields=fieldnames(Param);%list of fields in Param 27 % loop on the elements of the input structure Param 27 28 %-------------------------------------------------------------------------------------- 29 %----------------- loop on the elements of the input structure Param ------------------ 30 %-------------------------------------------------------------------------------------- 28 31 for ifield=1:numel(fields) 29 % case of a sub-structure --> fill a panel30 32 if isstruct(Param.(fields{ifield}))% case of a sub-structure 33 %% case of a sub-structure --> fill a panel 31 34 if isfield(handles,fields{ifield}) 32 35 set(handles.(fields{ifield}),'Visible','on') 33 errormsg=fill_GUI(Param.(fields{ifield}),handles.(fields{ifield}));% apply the function to the substructure36 errormsg=fill_GUI(Param.(fields{ifield}),handles.(fields{ifield}));% recursively apply the function to the substructure 34 37 elseif isfield(UserData,fields{ifield})&& isfield(handles,fields{ifield})&&isfield(Param.(fields{ifield}),'Name') 35 38 UserData.(fields{ifield})=Param.(fields{ifield}); 36 39 set(handles.(fields{ifield}),'String',Param.(fields{ifield}).Name) 37 40 end 38 % case of an element39 41 else 42 %% case of an element 40 43 hh=[]; 41 44 input_data=Param.(fields{ifield}); 42 45 check_done=0; 43 46 if isfield(handles,fields{ifield}) 47 % a GUI element has a tag name equal to the key name in the element of Param 44 48 hh=handles.(fields{ifield}); 45 49 if strcmp(get(hh,'Type'),'uitable') 50 % case of a table 46 51 set(hh,'Visible','on') 47 52 if ischar(input_data) … … 52 57 end 53 58 elseif isnumeric(input_data) 54 if numel(input_data)>155 %deals with array displayed in multiple boxes labeled by an index59 % for numeric input element, look for a GUI element with the same tag name preceded by 'num_' 60 if numel(input_data)>1 % deals with array displayed in multiple boxes labeled by an index 56 61 for ibox=1:numel(input_data) 57 62 if isfield(handles,['num_' fields{ifield} '_' num2str(ibox)]) … … 66 71 end 67 72 for ibox=1:numel(hh) 73 % finalise the update of GUI uicontrol filled by the input element 68 74 if ~isempty(hh(ibox))&& ~check_done 69 set(hh(ibox),'Visible','on') 70 % input_data 75 set(hh(ibox),'Visible','on')% make the filled GUI element visible 71 76 if isfield(get(hh(ibox)),'Style') 72 77 switch get(hh(ibox),'Style')
Note: See TracChangeset
for help on using the changeset viewer.