function varargout = GettingStarted(varargin)
% GETTINGSTARTED M-file for GettingStarted.fig
%      GETTINGSTARTED, by itself, creates a new GETTINGSTARTED or raises the existing
%      singleton*.
%
%      H = GETTINGSTARTED returns the handle to a new GETTINGSTARTED or the handle to
%      the existing singleton*.
%
%      GETTINGSTARTED('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GETTINGSTARTED.M with the given input arguments.
%
%      GETTINGSTARTED('Property','Value',...) creates a new GETTINGSTARTED or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before GettingStarted_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to GettingStarted_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help GettingStarted

% Last Modified by GUIDE v2.5 09-Feb-2010 09:58:30

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @GettingStarted_OpeningFcn, ...
                   'gui_OutputFcn',  @GettingStarted_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 GettingStarted is made visible.
function GettingStarted_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 GettingStarted (see VARARGIN)

% Choose default command line output for GettingStarted
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes GettingStarted wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% Read in image
imageArray =imread('Start.bmp');
% Switch active axes to the one you made for the image.
axes(handles.axesImage);
% Put the image array into the axes so it will appear on the GUI
imshow(imageArray);
turn2gray=struct2cell(handles);
for k=1:size(turn2gray,1)    
    if isfield(get(turn2gray{k}), 'BackgroundColor')
        if isfield(get(turn2gray{k}),'Style') && ~strcmp(get(turn2gray{k},'Style'),'edit')
        set(turn2gray{k}, 'BackgroundColor', [0.831373 0.815686 0.784314]);
        elseif ~isfield(get(turn2gray{k}),'Style')
            set(turn2gray{k}, 'BackgroundColor', [0.831373 0.815686 0.784314]);
        end
    end
        if isfield(get(turn2gray{k}), 'Color')
            set(turn2gray{k}, 'Color', [0.831373 0.815686 0.784314]);
        end
end
try
    Version=urlread('http://webee.technion.ac.il/Sites/People/YoninaEldar/Info/software/GUI/Latest_GUI_version.txt');
    verNum=str2double(Version(size('Version = ',2):end));
    load('currentVersion.mat')
    if verNum >curVersion
        set(handles.textUpdates,'String',['New version found: v.' num2str(verNum)]);
        set(handles.textUpdates,'ForegroundColor',[1 0 0]);
        set(handles.pushbutton2,'Visible','on');
    else
        set(handles.textUpdates,'String','There are no new updates');
    end
catch err
    if strcmp(err.identifier, 'MATLAB:urlread:ConnectionFailed')
        %set(handles.textUpdates,'String','Connection problems');
        set(handles.textUpdates,'String','Could access latest version details');
        set(handles.textUpdates,'ForegroundColor',[1 0 0]);
    end
end


% --- Outputs from this function are returned to the command line.
function varargout = GettingStarted_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 during object creation, after setting all properties.
function axesImage_CreateFcn(hObject, eventdata, handles)
% hObject    handle to axesImage (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: place code in OpeningFcn to populate axesImage


% --- Executes on button press in closeBtn.
function closeBtn_Callback(hObject, eventdata, handles)
% hObject    handle to closeBtn (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
close(handles.figure1);


% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
web http://webee.technion.ac.il/Sites/People/YoninaEldar/Info/software/GUI/MWC_GUI.htm -browser