function varargout = questMLS(varargin)
%questMLS OK/Cancel question dialog

%   Project: IMPACT
%   Title of Code: questMLS
%   Relevant additional documentation:
%   Developer: Carlos Gonzalez
%   External Dependencies: NA
%
%   Disclaimer
%   CAUTION: It is strongly recommended that changes to this code
%   should be avoided without first consulting with authors

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @questMLS_OpeningFcn, ...
                   'gui_OutputFcn',  @questMLS_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before questMLS is made visible.
function questMLS_OpeningFcn(hObject, eventdata, handles, varargin)
addIMPACTICon(hObject);
a = load('dialogicons.mat');
IconData=a.warnIconData;
a.warnIconMap(256,:)=get(hObject,'Color');
IconCMap=a.warnIconMap;
IconAxes = handles.IconAxes;
Img=image('CData',IconData,'Parent',IconAxes);
set(hObject, 'Colormap', IconCMap);

if ~isempty(get(Img,'XData')) && ~isempty(get(Img,'YData'))
    set(IconAxes          , ...
        'XLim'            ,get(Img,'XData')+[-0.5 0.5], ...
        'YLim'            ,get(Img,'YData')+[-0.5 0.5]  ...
        );
end

set(IconAxes          , ...
    'Visible'         ,'off'       , ...
    'YDir'            ,'reverse'     ...
    );

if nargin
    mainText = varargin{2};
    set(handles.text_main,'String',mainText);
end
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes questMLS wait for user response (see UIRESUME)
uiwait(handles.figure_dialog);


% --- Outputs from this function are returned to the command line.
function varargout = questMLS_OutputFcn(hObject, eventdata, handles)
if ~isempty(handles)
    if handles.ok
        varargout{1} = 1;
        close(handles.figure_dialog);
    else
        varargout{1} = 0;
        close(handles.figure_dialog);
    end   
else
    varargout{1} = 0;
end



% --- Executes on button press in pushbutton_yes.
function pushbutton_yes_Callback(hObject, eventdata, handles)
handles.ok = 1;
guidata(hObject, handles);
uiresume(handles.figure_dialog);

% --- Executes on button press in pushbutton_no.
function pushbutton_no_Callback(hObject, eventdata, handles)
handles.ok = 0;
guidata(hObject, handles);
uiresume(handles.figure_dialog);
