0001 function [obj] = bm_edit_app_update_history_listbox(obj)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0017 if ~strcmp(obj.class_type, 'bm_edit_app')
0018 error('class type is invalid.');
0019 end
0020
0021
0022
0023
0024 H = guihandles(obj.h);
0025
0026 selected_index = get(H.brain_model_list_listbox, 'value');
0027 all_index = bm_manager_get_bm_list_index(obj.bmm);
0028
0029 if length(selected_index) == 1 && ~isempty(all_index)
0030 [description_cell, parm_cell] = bm_manager_get_history( obj.bmm, ...
0031 selected_index);
0032
0033 set(H.history_listbox, 'String', description_cell);
0034
0035
0036 index_no = get(H.history_listbox, 'value');
0037 parm = parm_cell{index_no};
0038 if ~isempty(parm)
0039 parm_str = vb_struct2str(parm);
0040 else
0041 parm_str = [];
0042 end
0043
0044 set(H.history_edit, 'String', parm_str);
0045 set(H.history_listbox, 'Enable', 'on');
0046 set(H.history_edit, 'Enable', 'on');
0047 else
0048
0049 set(H.history_listbox, 'String', '');
0050 set(H.history_edit, 'String', '');
0051 set(H.history_listbox, 'Enable', 'off');
0052 set(H.history_edit, 'Enable', 'off');
0053 end
0054
0055
0056
0057
0058 if nargout ~= 1
0059 error('function caller should receive obj.');
0060 end