function freblkSetExpLengthDirty(blk,IsDirty)
%   Utility function of FRE block

%   Author: R. Chen
%   Copyright 2018 The MathWorks, Inc.

% g3207057: behavior captured in this geck caused unexpected callback
% execution in the Frequency Response Estimator block. Return to prevent
% blocking users' workflows
return;

% get block object
bobj = get_param(blk,'Object');
% get dialog source
src = bobj.getDialogSource;
% find the dialog from source
tr = DAStudio.ToolRoot;
% dlg can be a vector
dlg = tr.getOpenDialogs(src);
% highlight 
if isempty(dlg)
    return
end
% g2487889: only treat the mask dialog of the Frequency Response Estimator
% block about widget hightlight
dlg = dlg(1);
if IsDirty
    enableWidgetHighlight(dlg,'DurationLabel',[255 0 0]);
    maskObj = Simulink.Mask.get(blk);
    objectD = maskObj.getDialogControl('DurationLabel');
    objectD.Prompt = getString(message('Slcontrol:onlinefre:descDirty'));
else
    disableWidgetHighlight(dlg,'DurationLabel');
end
% highlighting will go away when the dialog is closed

