0001 function vb_batch_list_update_variable_listbox(fig)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0016 error('invalid figure handle is specified.');
0017 end
0018
0019
0020
0021
0022 data = guidata(fig);
0023
0024 [variable_list, table] = vb_batch_mgr_get_table_data(data.bmgr);
0025 set(data.H.variable_listbox, 'String', variable_list);
0026
0027
0028 line_no = get(data.H.variable_listbox, 'Value');
0029 Nvalue = length(variable_list);
0030 if Nvalue < 1
0031 line_no = 1;
0032 elseif line_no > Nvalue
0033 line_no = Nvalue;
0034 end
0035 set(data.H.variable_listbox, 'Value', line_no);
0036
0037
0038
0039 Nrow = size(table, 1);
0040 set(data.H.Nparm_set_text, 'String', num2str(Nrow));
0041
0042
0043 components = [data.H.variable_rename_push;
0044 data.H.variable_remove_push
0045 data.H.edit_table_push];
0046 if Nvalue
0047 set(components, 'Enable', 'on');
0048 else
0049 set(components, 'Enable', 'off');
0050 end