function changehdlconfigtab(hDlg, tag, index)
%CHANGEHDLCONFIGTAB TabChangedCallback for the FDHDLC dialog

% Author(s): J. Sun
% Copyright 2008-2011 The MathWorks, Inc.
%
h = hDlg.getSource;
switch tag
case [h.getproductname 'Dialog_Main_Tab']
hSrc = getDialogSource(hDlg);
set(hSrc, 'HDLActiveTab', index);
case [h.getproductname 'GlobalSettings_Tab']
% find the belonging dialog handle
hSrc = getDialogSource(hDlg);
hGLBDialogObj = hSrc.getsubcomponent('Global Settings');
set(hGLBDialogObj, 'ActiveTab', index);
case [h.getproductname 'TestBenchPanel_Tab']
% find the belonging dialog handle
hSrc = getDialogSource(hDlg);
hTBObj = hSrc.getsubcomponent(DAStudio.message('HDLShared:hdldialog:hdltbComponentName'));
set(hTBObj, 'ActiveTab', index);
end