Changeset 667 for trunk/src/fill_GUI.m


Ignore:
Timestamp:
Jul 15, 2013, 2:50:08 PM (11 years ago)
Author:
sommeria
Message:

a few bugs corrected.
multimask introduced in series
displ_uvmat transformed into disp_uvmat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fill_GUI.m

    r664 r667  
    2525UserData=get(GUI_handle,'UserData');
    2626fields=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%--------------------------------------------------------------------------------------
    2831for ifield=1:numel(fields)
    29     % case of a sub-structure --> fill a panel
    3032    if isstruct(Param.(fields{ifield}))% case of a sub-structure
     33    %% case of a sub-structure --> fill a panel
    3134        if isfield(handles,fields{ifield})
    3235            set(handles.(fields{ifield}),'Visible','on')
    33             errormsg=fill_GUI(Param.(fields{ifield}),handles.(fields{ifield}));% apply the function to the substructure
     36            errormsg=fill_GUI(Param.(fields{ifield}),handles.(fields{ifield}));% recursively apply the function to the substructure
    3437        elseif isfield(UserData,fields{ifield})&& isfield(handles,fields{ifield})&&isfield(Param.(fields{ifield}),'Name')
    3538            UserData.(fields{ifield})=Param.(fields{ifield});
    3639            set(handles.(fields{ifield}),'String',Param.(fields{ifield}).Name)
    3740        end
    38         % case of an element
    3941    else
     42    %% case of an element
    4043        hh=[];
    4144        input_data=Param.(fields{ifield});
    4245        check_done=0;
    4346        if isfield(handles,fields{ifield})
     47        % a GUI element has a tag name equal to the key name in the element of Param
    4448            hh=handles.(fields{ifield});
    4549            if strcmp(get(hh,'Type'),'uitable')
     50            % case of a table
    4651                set(hh,'Visible','on')
    4752                if ischar(input_data)
     
    5257            end
    5358        elseif isnumeric(input_data)
    54             if numel(input_data)>1
    55                 %deals with array displayed in multiple boxes labeled by an index
     59        % 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
    5661                for ibox=1:numel(input_data)
    5762                    if isfield(handles,['num_' fields{ifield} '_' num2str(ibox)])
     
    6671        end
    6772        for ibox=1:numel(hh)
     73        % finalise the update of GUI uicontrol filled by the input element
    6874            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
    7176                if isfield(get(hh(ibox)),'Style')
    7277                    switch get(hh(ibox),'Style')
Note: See TracChangeset for help on using the changeset viewer.