Home > vbmeg > functions > gui > vb_input_settings > vb_input_settings_callback.m

vb_input_settings_callback

PURPOSE ^

SYNOPSIS ^

function vb_input_settings_callback(data, hObj)

DESCRIPTION ^

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vb_input_settings_callback(data, hObj)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 H = data.H;
0007 
0008 switch(hObj)
0009     case {H.name_listbox, H.value_listbox}
0010         if strcmpi(get(H.fig, 'SelectionType'), 'open')
0011             % double click
0012             ix = get(H.name_listbox, 'Value');
0013             if ~isempty(ix)
0014                 data.def{ix(1)} = vb_input_settings_set_item(data.def{ix(1)});
0015             end
0016         end
0017         vb_input_settings_update_gui(data);
0018     case H.edit_push
0019         ix = get(H.name_listbox, 'Value');
0020         if ~isempty(ix)
0021             data.def{ix(1)} = vb_input_settings_set_item(data.def{ix(1)});
0022         end
0023         vb_input_settings_update_gui(data);
0024     case H.input_seq_push
0025         data = vb_input_settings_set_sequencially(data);
0026         vb_input_settings_update_gui(data)
0027     case H.saveas_push
0028         feval(data.save_func, data.def);
0029     case H.ok_push
0030         data.cancel = false;
0031         set(H.fig, 'Visible', 'off');
0032     case {H.cancel_push, H.fig}
0033         if isequal(data.org_def, data.def)
0034             data.cancel = true;
0035             set(H.fig, 'Visible', 'off');
0036         else
0037             res = questdlg('Are you sure?', 'Confirm', 'Yes', 'No', 'Yes');
0038             if strcmpi(res, 'yes')
0039                 data.cancel = true;
0040                 set(H.fig, 'Visible', 'off');
0041             end
0042         end
0043 %     case H.fig
0044 %         % close request
0045 %         data.cancel = true;
0046 %         set(H.fig, 'Visible', 'off');
0047 end
0048 
0049 guidata(H.fig, data);
0050

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005