function varargout = wrndlgMLS(varargin)
%wrndlgMLS warning message with question/response
%   wrndlgMLS opens up a warning message and waits for a OK/Cancel response
%   which is retuned

%   Project: IMPACT
%   Title of Code: wrndlgMLS
%   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', @wrndlgMLS_OpeningFcn, ...
                   'gui_OutputFcn',  @wrndlgMLS_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 wrndlgMLS is made visible.
function wrndlgMLS_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to wrndlgMLS (see VARARGIN)

% Choose default command line output for wrndlgMLS
if nargin > 3
    handles.hFig = varargin{1};
    handles.str = varargin{2};
    set(handles.string, 'String', handles.str);
    guidata(handles.hFig, 'Cancel');
    if nargin > 5 && strcmp(varargin{3}, 'invisible')
        set(handles.pushbutton_yes2all, 'Visible', 'off');
    end
    
end

handles.output = hObject;

hFig = ancestor(hObject, 'figure');
% Show a question icon from dialogicons.mat - variables questIconData
% and questIconMap
load dialogicons.mat

IconData=questIconData;
questIconMap(256,:) = get(hFig, 'Color');
IconCMap=questIconMap;

Img=image(IconData, 'Parent', handles.axes1);
set(handles.figure1, 'Colormap', IconCMap);

set(handles.axes1, ...
    'Visible', 'off', ...
    'YDir'   , 'reverse'       , ...
    'XLim'   , get(Img,'XData'), ...
    'YLim'   , get(Img,'YData')  ...
    );


movegui(hFig, 'center');

addIMPACTIcon(hFig);

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes wrndlgMLS wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = wrndlgMLS_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in ok.
function ok_Callback(hObject, eventdata, handles)

guidata(handles.hFig, 'OK');
close;


% --- Executes on button press in cancel.
function cancel_Callback(hObject, eventdata, handles)

guidata(handles.hFig, 'Cancel');
close;



% --- Executes on button press in pushbutton_yes2all.
function pushbutton_yes2all_Callback(hObject, eventdata, handles)

guidata(handles.hFig, 'yes2all');
close;


