function [widgets, currRow] = getSharedWidgets(this, src, minimumSize, currRow, tagpf)
%

%   Copyright 2008-2023 The MathWorks, Inc.

enableWidget = strcmpi(src.EDAScriptGeneration, 'on');

pageName = [message('HDLShared:hdldialog:hdlccHDLCodername').getString '/' ...
            message('HDLShared:hdldialog:hdledasGroupName').getString];

useEda.Name           = DAStudio.message('HDLShared:hdldialog:hdledasGenerateEDA');
useEda.Type           = 'checkbox';
useEda.Source         = this;
useEda.Tag            = [tagpf 'EDAScriptGeneration'];
useEda.RowSpan        = [currRow currRow];
useEda.ColSpan        = [1 6];
useEda.Mode = true;
useEda.DialogRefresh = true;
useEda.ObjectMethod = 'setCheckBox';
useEda.Value        = strcmpi(src.EDAScriptGeneration,'on');
useEda.MethodArgs   = {'%value', 'EDAScriptGeneration', src};
useEda.ArgDataTypes = {'mxArray', 'string', 'mxArray'};

currRow = currRow+1;

scriptList.Type    = 'listbox';
scriptList.Graphical = true;
scriptList.Entries = { DAStudio.message('HDLShared:hdldialog:hdledasListName1'), ...
    DAStudio.message('HDLShared:hdldialog:hdledasListName2'), ...
    DAStudio.message('HDLShared:hdldialog:hdledasListName3'),...
    };
if this.showLintWidgets % if Lint widgets are to be shown
    scriptList.Entries = [scriptList.Entries ...
        {DAStudio.message('HDLShared:hdldialog:hdledasListName4Lint')}];
end

scriptList.Source = this;
scriptList.ObjectProperty = 'ScriptSelection';
scriptList.MultiSelect = 0;
scriptList.RowSpan = [currRow currRow+5];
scriptList.ColSpan = [1 1];
scriptList.MaximumSize = [240 -1];
scriptList.Tag = [tagpf 'EDAScriptList'];
scriptList.Mode = true;
scriptList.DialogRefresh = true;
scriptList.Enabled = enableWidget;

ColSpan = [2 6];
pfColSpan = [2 5];

%If user selects a SimulationTool then we take over the script generation,
%otherwise we honor the EDA Scripts. Hence when the user select a simulator we
%should disable the EDA Scripts Simulation panes. If dealing with FDHDLC UI,
%then do not pay attention to the simulation tool--it does not apply.
EnableHDLSimulatorScript = enableWidget && (strcmpi(src.SimulationTool,'Custom')...
    || isa(this,'fdhdlcoderui.fdhdledas'));

startRow = currRow;
% HDLCompileFilePostfix
postfix.Type           = 'edit';
postfix.Name           = DAStudio.message('HDLShared:hdldialog:hdledasCompileFilePostfix');
postfix.ObjectProperty = 'HDLCompileFilePostfix';
postfix.Source         = src;
postfix.Tag            = [tagpf 'HDLCompileFilePostfix'];
postfix.RowSpan        = [currRow currRow];
postfix.ColSpan        = pfColSpan;
postfix.Mode           = true;
postfix.Enabled = EnableHDLSimulatorScript;
postfix.Visible = this.ScriptSelection == 0;

itemHDLCompileFilePostfix = postfix;

currRow = currRow+1;

item.Visible = postfix.Visible;

% HDLCompileInit
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLCompileInit');
item.ObjectProperty = 'HDLCompileInit';
item.Source         = src;
item.Tag            = [tagpf 'HDLCompileInit'];
item.RowSpan = [currRow currRow];
item.ColSpan = ColSpan;
item.MinimumSize = minimumSize;
item.WordWrap = true;
item.Mode = true;
item.Enabled = EnableHDLSimulatorScript;
itemHDLCompileInit = item;

currRow = currRow+1;
% HDLCompileVHDLCmd
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLCompileVHDLCmd');
item.ObjectProperty = 'HDLCompileVHDLCmd';
item.Source         = src;
item.Tag            = [tagpf 'HDLCompileVHDLCmd'];
item.RowSpan = [currRow currRow];
% item.ColSpan = ColSpan;
item.MinimumSize = minimumSize;
item.WordWrap = true;
item.Enabled = EnableHDLSimulatorScript;
item.Mode = true;

itemHDLCompileVHDLCmd = item;
itemHDLCompileVHDLCmd.Enabled =  EnableHDLSimulatorScript && strcmpi(src.TargetLanguage, 'vhdl');

currRow = currRow+1;
% HDLCompileVerilogCmd
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLCompileVerilogCmd');
item.ObjectProperty = 'HDLCompileVerilogCmd';
item.Source         = src;
item.Tag            = [tagpf 'HDLCompileVerilogCmd'];
item.RowSpan = [currRow currRow];
% item.ColSpan = ColSpan;
item.MinimumSize = minimumSize;
item.WordWrap = true;
item.Enabled = EnableHDLSimulatorScript;
item.Mode = true;

itemHDLCompileVerilogCmd = item;
itemHDLCompileVerilogCmd.Enabled = EnableHDLSimulatorScript && strcmpi(src.TargetLanguage, 'verilog');

currRow = currRow+1;
% HDLCompileTerm
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLCompileTerm');
item.ObjectProperty = 'HDLCompileTerm';
item.Source         = src;
item.Tag            = [tagpf 'HDLCompileTerm'];
item.RowSpan = [currRow currRow];
% item.ColSpan = ColSpan;
item.MinimumSize = minimumSize;
item.WordWrap = true;
item.Mode = true;
item.Enabled = EnableHDLSimulatorScript;

itemHDLCompileTerm = item;

scriptsItems = {itemHDLCompileFilePostfix, itemHDLCompileInit, ...
    itemHDLCompileVHDLCmd, itemHDLCompileVerilogCmd, itemHDLCompileTerm};

currRow = startRow;
% HDLSimFilePostfix
postfix.Type           = 'edit';
postfix.Name           = DAStudio.message('HDLShared:hdldialog:hdledasHDLSimFilePostfix');
postfix.ObjectProperty = 'HDLSimFilePostfix';
postfix.Source         = src;
postfix.Tag            = [tagpf 'HDLSimFilePostfix'];
postfix.RowSpan        = [currRow currRow];
postfix.ColSpan        = pfColSpan;
postfix.Mode           = true;
postfix.Enabled = EnableHDLSimulatorScript;
postfix.Visible = this.ScriptSelection == 1;
itemHDLSimFilePostfix = postfix;

item.Visible =postfix.Visible;

currRow = currRow+1;
% HDLSimInit
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLSimInit');
item.ObjectProperty = 'HDLSimInit';
item.Source         = src;
item.Tag            = [tagpf 'HDLSimInit'];
item.RowSpan = [currRow currRow];
% item.ColSpan = ColSpan;

item.MinimumSize = minimumSize;

item.WordWrap = true;
item.Mode = true;
item.Enabled = EnableHDLSimulatorScript;
itemHDLSimInit = item;

currRow = currRow+1;
% HDLSimCmd
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLSimCmd');
item.ObjectProperty = 'HDLSimCmd';
item.Source         = src;
item.Tag            = [tagpf 'HDLSimCmd'];
item.RowSpan = [currRow currRow];
% item.ColSpan = ColSpan;

item.MinimumSize = minimumSize;

item.WordWrap = true;
item.Mode = true;
item.Enabled = EnableHDLSimulatorScript;
itemHDLSimCmd = item;

currRow = currRow+1;
% HDLSimViewWaveCmd
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLSimViewWaveCmd');
item.ObjectProperty = 'HDLSimViewWaveCmd';
item.Source         = src;
item.Tag            = [tagpf 'HDLSimViewWaveCmd'];
item.RowSpan = [currRow currRow];
% item.ColSpan = ColSpan;

item.MinimumSize = minimumSize;

item.WordWrap = true;
item.Mode = true;
item.Enabled = EnableHDLSimulatorScript;
itemHDLSimViewWaveCmd = item;

currRow = currRow+1;
% HDLSimTerm
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLSimTerm');
item.ObjectProperty = 'HDLSimTerm';
item.Source         = src;
item.Tag            = [tagpf 'HDLSimTerm'];
item.RowSpan = [currRow currRow];
% item.ColSpan = ColSpan;

item.MinimumSize = minimumSize;

item.WordWrap = true;
item.Mode = true;
item.Enabled = EnableHDLSimulatorScript;
itemHDLSimTerm = item;
scriptsItems = [scriptsItems {itemHDLSimFilePostfix, itemHDLSimInit, itemHDLSimCmd,...
    itemHDLSimViewWaveCmd, itemHDLSimTerm}];

currRow = startRow;

% HDLSynthesisTool
% Tool group
%
% Tool selection combobox
ttools_prop = 'SynToolOption';
ttools_lbl.Type = 'text';
ttools_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthTool');
ttools_lbl.RowSpan = [currRow currRow];
ttools_lbl.ColSpan = [2 2];
ttools_lbl.Alignment = 0;
ttools_lbl.Mode = true;
ttools_lbl.Visible = this.ScriptSelection == 2;

ttools_cb.Type = 'combobox';
ttools_cb.Source = this;
ttools_cb.ObjectProperty = ttools_prop;
ttools_cb.Tag = [tagpf ttools_cb.ObjectProperty];
ttools_lbl.Buddy = ttools_cb.Tag;
ttools_cb.RowSpan = [currRow currRow];
ttools_cb.ColSpan = [3 4];
ttools_cb.Mode = true;
ttools_cb.DialogRefresh = true;
ttools_cb.Enabled = enableWidget;
ttools_cb.UserData.Page = pageName;
ttools_cb.UserData.Name = ttools_lbl.Name;
ttools_cb.Entries = {DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolNone'),...
                    DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolVivado'), ...
                    DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolISE'), ...
                    DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolLibero'), ...
                    DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolPrecision'),...
                    DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolQuartus'),...
                    DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolSynplify'),...
                    DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolCustom')};
ttools_cb.Value = DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthToolNone');
ttools_cb.Visible = this.ScriptSelection == 2;

scriptsItems = [scriptsItems ttools_lbl ttools_cb];

currRow = currRow+1;

if ~strcmpi(hdlcodegenmode,'filtercoder')
    % For FDHC, this seems to cause a reset of all synthesis properties
    % whenever you move out of the synthesis pane to say the simulation
    % pane.
    % This behavior is ok for HDL Coder, which has an Apply button, but not
    % for FDHC which does not have an apply button.
    this.init(src);
end

% HDLSynthFilePostfix
postfix.Visible = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'None');
postfix.Type           = 'edit';
postfix.Name           = DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthFilePostfix');
postfix.ObjectProperty = 'SynScriptPostFix';
postfix.Source         = this;
postfix.Tag            = [tagpf 'SynScriptPostFix'];
postfix.RowSpan        = [currRow currRow];
postfix.ColSpan        = pfColSpan;
postfix.Mode           = true;
postfix.Enabled = ~strcmpi(this.SynToolOption, 'None');
postfix.UserData.Page = pageName;
postfix.UserData.Name = postfix.Name;

postfix_Q                = postfix;
postfix_Q.ObjectProperty = 'SynScriptPostFix_Q';
postfix_Q.Tag            = [tagpf 'SynScriptPostFix_Q'];
postfix_Q.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Quartus');

postfix_P                = postfix;
postfix_P.ObjectProperty = 'SynScriptPostFix_P';
postfix_P.Tag            = [tagpf 'SynScriptPostFix_P'];
postfix_P.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Precision');

postfix_I                = postfix;
postfix_I.ObjectProperty = 'SynScriptPostFix_I';
postfix_I.Tag            = [tagpf 'SynScriptPostFix_I'];
postfix_I.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'ISE');

postfix_V                = postfix;
postfix_V.ObjectProperty = 'SynScriptPostFix_V';
postfix_V.Tag            = [tagpf 'SynScriptPostFix_V'];
postfix_V.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Vivado');


postfix_L                = postfix;
postfix_L.ObjectProperty = 'SynScriptPostFix_L';
postfix_L.Tag            = [tagpf 'SynScriptPostFix_L'];
postfix_L.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Libero');

postfix_S                = postfix;
postfix_S.ObjectProperty = 'SynScriptPostFix_S';
postfix_S.Tag            = [tagpf 'SynScriptPostFix_S'];
postfix_S.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Synplify');

postfix_C                = postfix;
postfix_C.ObjectProperty = 'SynScriptPostFix_C';
postfix_C.Tag            = [tagpf 'SynScriptPostFix_C'];
postfix_C.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Custom');

itemHDLSynthFilePostfix = {postfix, postfix_V, postfix_I, postfix_L, postfix_P, postfix_Q, postfix_S, postfix_C};
scriptsItems = [scriptsItems itemHDLSynthFilePostfix];

item.Visible =postfix.Visible;

currRow = currRow+1;
% HDLSynthInit
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthInit');
item.ObjectProperty = 'SynScriptInit';
item.Source         = this;
item.Tag            = [tagpf 'SynScriptInit'];
item.RowSpan = [currRow currRow];
item.ColSpan = ColSpan;
item.MinimumSize = minimumSize;

item.WordWrap = true;
item.Mode = true;
item.Enabled = ~strcmpi(this.SynToolOption, 'None');
item.UserData.Page = pageName;
item.UserData.Name = item.Name;

item_I                = item;
item_I.ObjectProperty = 'SynScriptInit_I';
item_I.Tag            = [tagpf 'SynScriptInit_I'];
item_I.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'ISE');

item_V                = item;
item_V.ObjectProperty = 'SynScriptInit_V';
item_V.Tag            = [tagpf 'SynScriptInit_V'];
item_V.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Vivado');

item_L                = item;
item_L.ObjectProperty = 'SynScriptInit_L';
item_L.Tag            = [tagpf 'SynScriptInit_L'];
item_L.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Libero');

item_P                = item;
item_P.ObjectProperty = 'SynScriptInit_P';
item_P.Tag            = [tagpf 'SynScriptInit_P'];
item_P.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Precision');

item_Q                = item;
item_Q.ObjectProperty = 'SynScriptInit_Q';
item_Q.Tag            = [tagpf 'SynScriptInit_Q'];
item_Q.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Quartus');

item_S                = item;
item_S.ObjectProperty = 'SynScriptInit_S';
item_S.Tag            = [tagpf 'SynScriptInit_S'];
item_S.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Synplify');

item_C                = item;
item_C.ObjectProperty = 'SynScriptInit_C';
item_C.Tag            = [tagpf 'SynScriptInit_C'];
item_C.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Custom');

itemHDLSynthInit = {item, item_V, item_I, item_L, item_P, item_Q, item_S, item_C};
scriptsItems = [scriptsItems itemHDLSynthInit];

currRow = currRow+1;
% HDLSynthCmd
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthCmd');
item.ObjectProperty = 'SynScriptCmd';
item.Source         = this;
item.Tag            = [tagpf 'SynScriptCmd'];
item.RowSpan = [currRow currRow];
item.ColSpan = ColSpan;
item.MinimumSize = minimumSize;

item.WordWrap = true;
item.Mode = true;
item.Enabled = ~strcmpi(this.SynToolOption, 'None');
item.UserData.Page = pageName;
item.UserData.Name = item.Name;

item_I                = item;
item_I.ObjectProperty = 'SynScriptCmd_I';
item_I.Tag            = [tagpf 'SynScriptCmd_I'];
item_I.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'ISE');

item_V                = item;
item_V.ObjectProperty = 'SynScriptCmd_V';
item_V.Tag            = [tagpf 'SynScriptCmd_V'];
item_V.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Vivado');

item_L                = item;
item_L.ObjectProperty = 'SynScriptCmd_L';
item_L.Tag            = [tagpf 'SynScriptCmd_L'];
item_L.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Libero');

item_P                = item;
item_P.ObjectProperty = 'SynScriptCmd_P';
item_P.Tag            = [tagpf 'SynScriptCmd_P'];
item_P.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Precision');

item_Q                = item;
item_Q.ObjectProperty = 'SynScriptCmd_Q';
item_Q.Tag            = [tagpf 'SynScriptCmd_Q'];
item_Q.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Quartus');

item_S                = item;
item_S.ObjectProperty = 'SynScriptCmd_S';
item_S.Tag            = [tagpf 'SynScriptCmd_S'];
item_S.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Synplify');

item_C                = item;
item_C.ObjectProperty = 'SynScriptCmd_C';
item_C.Tag            = [tagpf 'SynScriptCmd_C'];
item_C.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Custom');

itemHDLSynthCmd = {item, item_V, item_I, item_L , item_P, item_Q, item_S, item_C};
scriptsItems = [scriptsItems itemHDLSynthCmd];

currRow = currRow+1;
% HDLSynthTerm
item.Type    = 'editarea';
item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLSynthTerm');
item.ObjectProperty = 'SynScriptTerm';
item.Source         = this;
item.Tag            = [tagpf 'SynScriptTerm'];
item.RowSpan = [currRow currRow+1];
item.ColSpan = ColSpan;
item.MinimumSize = minimumSize;

item.WordWrap = true;
item.Mode = true;
item.Enabled = ~strcmpi(this.SynToolOption, 'None');
item.UserData.Page = pageName;
item.UserData.Name = item.Name;

item_I                = item;
item_I.ObjectProperty = 'SynScriptTerm_I';
item_I.Tag            = [tagpf 'SynScriptTerm_I'];
item_I.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'ISE');

item_V                = item;
item_V.ObjectProperty = 'SynScriptTerm_V';
item_V.Tag            = [tagpf 'SynScriptTerm_V'];
item_V.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Vivado');

item_L                = item;
item_L.ObjectProperty = 'SynScriptTerm_L';
item_L.Tag            = [tagpf 'SynScriptTerm_L'];
item_L.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Libero');

item_P                = item;
item_P.ObjectProperty = 'SynScriptTerm_P';
item_P.Tag            = [tagpf 'SynScriptTerm_P'];
item_P.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Precision');

item_Q                = item;
item_Q.ObjectProperty = 'SynScriptTerm_Q';
item_Q.Tag            = [tagpf 'SynScriptTerm_Q'];
item_Q.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Quartus');

item_S                = item;
item_S.ObjectProperty = 'SynScriptTerm_S';
item_S.Tag            = [tagpf 'SynScriptTerm_S'];
item_S.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Synplify');

item_C                = item;
item_C.ObjectProperty = 'SynScriptTerm_C';
item_C.Tag            = [tagpf 'SynScriptTerm_C'];
item_C.Visible          = this.ScriptSelection == 2 && strcmpi(this.SynToolOption, 'Custom');

itemHDLSynthTerm = {item,item_V, item_I, item_L, item_P, item_Q, item_S, item_C};
scriptsItems = [scriptsItems itemHDLSynthTerm];

% HDLLintTool control group
function flag = inLintScriptMode()
    flag = (this.ScriptSelection == 3);
    return
end

% output arguments = None, SpyGlass, LEDA, AscentLint, HDLDesigner, Custom
function [item_N,item_S,item_L,item_A, item_H, item_C] = lintScriptItems(item,type)
    item_N                = item;
    type_tool = ['HDLLint',type,'_N'];
    item_N.ObjectProperty = type_tool;
    item_N.Tag            = [tagpf type_tool];
    item_N.Visible        = false; %inLintScriptMode() && strcmpi(this.LintToolOption, 'None');
    item_N.Source         = this;

    item_S                = item;
    type_tool = ['HDLLint',type,'_S'];
    item_S.ObjectProperty = type_tool;
    item_S.Tag            = [tagpf type_tool];
    item_S.Visible        = inLintScriptMode() && strcmpi(this.LintToolOption, 'SpyGlass');
    item_S.Source         = this;

    item_L                = item;
    type_tool = ['HDLLint',type,'_L'];
    item_L.ObjectProperty = type_tool;
    item_L.Tag            = [tagpf type_tool];
    item_L.Visible        = inLintScriptMode() && strcmpi(this.LintToolOption, 'Leda');
    item_L.Source         = this;

    item_A                = item;
    type_tool = ['HDLLint',type,'_A'];
    item_A.ObjectProperty = type_tool;
    item_A.Tag            = [tagpf type_tool];
    item_A.Visible        = inLintScriptMode() && strcmpi(this.LintToolOption, 'AscentLint');
    item_A.Source         = this;

    item_H                = item;
    type_tool = ['HDLLint',type,'_H'];
    item_H.ObjectProperty = type_tool;
    item_H.Tag            = [tagpf type_tool];
    item_H.Visible        = inLintScriptMode() && strcmpi(this.LintToolOption, 'HDLDesigner');
    item_H.Source         = this;

    % Custom Lint Option
    item_C                = item;
    type_tool = ['HDLLint',type,'_C'];
    item_C.ObjectProperty = type_tool;
    item_C.Tag            = [tagpf type_tool];
    item_C.Visible        = inLintScriptMode() && strcmpi(this.LintToolOption, 'Custom');
    item_C.Source         = this;
end

if this.showLintWidgets % not for Filter Design HDL Coder
    currRow = startRow;

    % HDL Lint Tool
    lint_lbl.Type = 'text';
    lint_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsLintTool');
    lint_lbl.RowSpan = [currRow currRow];
    lint_lbl.ColSpan = [2 3];
    lint_lbl.Visible = inLintScriptMode();

    lint_cb.Type = 'combobox';
    lint_cb_ObjectProperty = 'LintToolOption';
    lint_cb.Tag = [tagpf lint_cb_ObjectProperty];
    lint_lbl.Buddy = lint_cb.Tag;
    lint_cb.RowSpan = [currRow currRow];
    lint_cb.ColSpan = [4 6];
    lint_cb.Source = this;
    lint_cb.Mode = true;
    lint_cb.Enabled = enableWidget;
    % order of appearance in menu: these names are mapped into the CLI values via callback
    lint_cb.Entries = {'None','Ascent Lint','HDL Designer','Leda','SpyGlass','Custom'};
    lint_cb.Visible = inLintScriptMode();
    lint_cb.DialogRefresh = true;

    % basically map the lint_cb.Entries into the LintToolOption field.
    lint_cb.MatlabMethod = 'hdlcoderui.abstracthdledas.updateLintToolNameCallback';
    lint_cb.MatlabArgs   = {this,'LintToolOption','%dialog','%tag'};
    lint_cb.UserData.Page = pageName;
    lint_cb.UserData.Name = lint_lbl.Name;

    lintToolItems = {lint_lbl, lint_cb};

    % HDLLintInit
    currRow = currRow+1;
    item.Type    = 'editarea';
    item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLLintInit');
    item.ObjectProperty = 'HDLLintInit';
    item.Source         = this;
    item.Tag            = [tagpf 'HDLLintInit'];
    item.RowSpan = [currRow currRow];
    item.ColSpan = ColSpan;
    item.Visible = inLintScriptMode();
    item.MinimumSize = minimumSize;
    item.WordWrap = true;
    item.Mode = true;
    item.Enabled = enableWidget && ~strcmpi(this.LintToolOption, 'None');
    item.UserData.Page = pageName;
    item.UserData.Name = item.Name;
    [item_N,item_S,item_L,item_A, item_H, item_C] = lintScriptItems( item, 'Init' );
    itemHDLLintInit = {item, item_N, item_S, item_L, item_A, item_H, item_C };

    currRow = currRow+1;
    % HDLLintCmd
    item.Type    = 'editarea';
    item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLLintCmd');
    item.ObjectProperty = 'HDLLintCmd';
    item.Source         = this;
    item.Tag            = [tagpf 'HDLLintCmd'];
    item.RowSpan = [currRow currRow];
    item.ColSpan = ColSpan;
    item.MinimumSize = minimumSize;
    item.Visible = inLintScriptMode();
    item.WordWrap = true;
    item.Mode = true;
    item.Enabled = enableWidget && ~strcmpi(this.LintToolOption, 'None');
    item.UserData.Page = pageName;
    item.UserData.Name = item.Name;
    [item_N,item_S,item_L,item_A, item_H, item_C] = lintScriptItems( item, 'Cmd' );
    itemHDLLintCmd = {item, item_N, item_S, item_L, item_A, item_H, item_C};

    currRow = currRow+1;
    % HDLLintTerm
    item.Type    = 'editarea';
    item.Name    = DAStudio.message('HDLShared:hdldialog:hdledasHDLLintTerm');
    item.ObjectProperty = 'HDLLintTerm';
    item.Source         = this;
    item.Tag            = [tagpf 'HDLLintTerm'];
    item.RowSpan = [currRow currRow];
    item.ColSpan = ColSpan;
    item.Visible = inLintScriptMode();
    item.MinimumSize = minimumSize;
    item.WordWrap = true;
    item.Mode = true;
    item.Enabled = enableWidget && ~strcmpi(this.LintToolOption, 'None');
    item.UserData.Page = pageName;
    item.UserData.Name = item.Name;
    [item_N,item_S,item_L,item_A, item_H, item_C] = lintScriptItems( item, 'Term' );

    itemHDLLintTerm = {item, item_N, item_S, item_L, item_A, item_H, item_C };

    % development utility
    %assert( isequal( length(itemHDLLintInit), length(itemHDLLintCmd), length(itemHDLLintTerm)) )
    lintItems = [lintToolItems, itemHDLLintInit, itemHDLLintCmd, itemHDLLintTerm];
    scriptsItems = [scriptsItems, lintItems];
end

widgets = [{useEda, scriptList}, scriptsItems];
end

% LocalWords:  fdhdlcoderui fdhdledas FDHC cb abstracthdledas
