function ftsgui
%FTSGUI Financial Time Series Graphical User Interface.

%   Copyright 1995-2018 The MathWorks, Inc.

warning(message('finance:ftseries:fints_fints:FunctionToBeRemoved'))
wState  = warning;                           % Save warning state
cleanUp = onCleanup(@() warning(wState));    % Restore warning state
warning('off','finance:ftseries:fints_fints:FunctionToBeRemoved')

% Check existence of prior FTSGUI.
hfig = findall(0, 'Type', 'figure', 'Tag' , 'FTSGUIMainWindow');

if isempty(hfig)
    % Setup the main figure window settings.
    % Figure will be invisible until all components are setup.
    figbgcolor = get(0, 'DefaultUIControlBackgroundColor');
    hfig = figure('MenuBar', 'none', ...
        'NumberTitle', 'off', ...
        'Units', 'normal', ...
        'Position', [0.05 0.80 0.50 0.10], ...
        'Name', 'Financial Time Series GUI', ...
        'CloseRequestFcn', 'ftsfilemenu(9);', ...
        'UserData', 1, ...
        'Resize', 'off', ...
        'Visible', 'off', ...
        'HandleVisibility', 'off', ...
        'color', figbgcolor, ...
        'Tag', 'FTSGUIMainWindow');
    setappdata(hfig, 'MainFigureName', get(hfig, 'Name'));

    % Setup a structure in FTS_Data of Main Figure Window to store FTS data.
    infostorage.itemcount = 0;
    infostorage.itemnames = [];
    infostorage.itemdesc  = [];
    infostorage.items     = [];
    infostorage.itemtypes = [];
    infostorage.activefts = [];
    infostorage.activefig = [];
    setappdata(hfig, 'FTS_Data', infostorage);

    % Initiate Figure Window Handles collection.
    setappdata(hfig, 'ChildrenFigures', []);

    % Setup the FILE menu item.
    hFileMenu = ftsfilemenu;  %#ok<NASGU>

    % Setup the DATA menu item.
    hDataMenu = ftsdatamenu;   %#ok<NASGU>

    % Setup the ANALYSIS menu item.
    hAnalysisMenu = ftsanalysismenu;  %#ok<NASGU>

    % Setup the GRAPHS menu item.
    hGraphsMenu = ftsgraphsmenu;   %#ok<NASGU>

    % Setup the WINDOW menu item.
    hWindowMenu = ftswindowmenu;   %#ok<NASGU>

    % Setup the HELP menu item.
    hHelpMenu = ftshelpmenu;  %#ok<NASGU>

    % Setup the status list.
    hStatusList = uicontrol('parent', hfig, 'Style', 'listbox', ...
        'Units', 'normal', ...
        'Enable', 'on', ...
        'Max', 2, ...
        'Value', [], ...
        'String', 'Started: Main FTS GUI Window', ...
        'Position', [0 0.15 1 0.85], ...
        'Tag', 'ftsguiStatusList'); %#ok<NASGU>

    % Turn the main FTS GUI on to make it visible.
    set(hfig, 'Visible', 'on');

else
    % Bring the figure forward
    figure(hfig)
end

