Home > m > gui > gltpda > welcome2LTPDA.m

welcome2LTPDA

PURPOSE ^

Introductory window for the LTPDA Toolbox.

SYNOPSIS ^

function welcome2LTPDA(varargin)

DESCRIPTION ^

 Introductory window for the LTPDA Toolbox.
    
 The animated GIF code is taken from 'gifplayer.m' by
     Vihang Patil, Oct 2006
     Copyright 2006-2007 Vihang Patil
     Email: vihang_patil@yahoo.com
     Created: 17th Oct 2006

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function welcome2LTPDA(varargin)
0002 % Introductory window for the LTPDA Toolbox.
0003 %
0004 % The animated GIF code is taken from 'gifplayer.m' by
0005 %     Vihang Patil, Oct 2006
0006 %     Copyright 2006-2007 Vihang Patil
0007 %     Email: vihang_patil@yahoo.com
0008 %     Created: 17th Oct 2006
0009 
0010 global timePeriod
0011 
0012 timePeriod = 0;
0013 screenSize = get(0,'ScreenSize');
0014 
0015 try
0016    guiName = varargin{1}; guiSize = varargin{2};
0017 catch
0018    guiName = ''; guiSize = [1 1 450 500];
0019 end
0020 
0021 introSize = [(screenSize(3)-guiSize(3))/2 , (screenSize(4)-guiSize(4))/2 , guiSize(3) , guiSize(4)];
0022 introFig = figure('Position',introSize,'Resize','off','Name',guiName,'NumberTitle','off','Toolbar','none','Menubar','none','Tag','intro2LTPDA');
0023 
0024 
0025 logoSize = [303,303];
0026 introPosition = [(introSize(3)-logoSize(1))/2 , (introSize(4)-logoSize(2))/2 , logoSize];
0027 logo = axes('Parent',introFig,'Units','pixels','Position',introPosition);
0028 image(imread('ltp.jpg'),'Parent',logo,'AlphaData',imread('ltpalpha.gif'));
0029 axis(logo,'off'); axis(logo,'square');
0030 set(logo,'HandleVisibility','callback');
0031 
0032 uicontrol('Parent',introFig,'BackgroundColor',[1 1 1],'HorizontalAlignment','center','Position',[0  introSize(4)-50  introSize(3)  25],'String','Welcome to the LTP','FontName','Times New Roman','FontSize',18,'Visible','on','Style','text');
0033 uicontrol('Parent',introFig,'BackgroundColor',[1 1 1],'HorizontalAlignment','center','Position',[0  introSize(4)-75  introSize(3)  25],'String','Data Analysis Toolbox','FontName','Times New Roman','FontSize',18,'Visible','on','Style','text');
0034 
0035 loading = uicontrol('Parent',introFig,'BackgroundColor',[1 1 1],'HorizontalAlignment','left','Position',[(introSize(3)-50)/2  15  70  25],'String','loading','FontName','Times New Roman','FontSize',10,'fontAngle','italic','Visible','on','Style','text','Tag','loading');
0036 
0037     gif_image = 'loading.gif';
0038     delay_length = 0.1;
0039     gifSize = [23 23];
0040     axes('Parent',introFig,'Units','pixels','Position',[(introSize(3)-gifSize(1))/2 50 gifSize]);
0041     [handles.im,map] = imread(gif_image,'frames','all');
0042     handles.len = size(handles.im,4);
0043         handles.h1 = image(handles.im(:,:,:,1));
0044         colormap(map);
0045         axis normal;
0046         axis off;
0047     handles.guifig = gcf;
0048     handles.count = 1;
0049     handles.tmr = timer('TimerFcn', {@TmrFcn,handles.guifig},'BusyMode','Queue','ExecutionMode','FixedRate','Period',delay_length);
0050     guidata(handles.guifig, handles);
0051     start(handles.tmr); %starts Timer
0052 guidata(handles.guifig, handles);
0053 
0054 set(loading,'DeleteFcn',{@DeleteFunction,handles.guifig});
0055 
0056 
0057 function TmrFcn(src,event,handles)
0058 handles = guidata(handles);
0059 set(handles.h1,'CData',handles.im(:,:,:,handles.count)); %update the frame in the axis
0060 handles.count = handles.count + 1; %increment to next frame
0061 
0062 if handles.count > handles.len %if the last frame is achieved intialise to first frame
0063     handles.count = 1;
0064 end
0065 guidata(handles.guifig, handles);
0066 
0067 loadingStr = get(findobj('Tag','loading'),'String');
0068 switch loadingStr
0069    case 'loading.....', loadingStr = 'loading';
0070    otherwise, loadingStr = [loadingStr,'.'];
0071 end
0072 
0073 if timePeriod == 2, set(findobj('Tag','loading'),'String',loadingStr); timePeriod = 0;
0074 else timePeriod = timePeriod +1;
0075 end
0076 end
0077 
0078 
0079 function DeleteFunction(src,event,handles)
0080 handles = guidata(handles);
0081 clear global timePeriod
0082 try stop(handles.tmr);delete(handles.tmr); catch end
0083 end
0084 
0085 end
0086 
0087 
0088

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003