function set_flagsdirty(hFig)
%SET_FLAGSDIRTY   Set the flags to a dirty state in ud.
%   SET_FLAGSDIRTY(HFIG) sets the flags to a dirty state in the user data of
%   the figure whos handle is HFIG.  The user data is modified.

%   Copyright 1988-2000 The MathWorks, Inc.
%   $Revision: 1.3 $  $Date: 2000/04/14 22:46:24 $ 

% Get user data
ud = get(hFig,'Userdata');

% Set dirty flags
ud.flags.file_dirty = 1;

% Depending on which tab (mode) the tool is in set the appropriate flag.
switch ud.mode.current,
case 1, % Design
    ud.flags.filter_designed = 0;
    ud.flags.undochanges.design = 1;
    
case 2, % Import
    ud.flags.filter_imported = 0;
    ud.flags.undochanges.import = 1;
    
case 3, % Quantize
    ud.flags.filter_quantized = 0;
    ud.flags.undochanges.quantize = 1;
end

% Save ud
set(hFig,'Userdata',ud);

