IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
welcome.m
Go to the documentation of this file.
1 %>@ingroup guigroup
2 %>@file
3 %>@brief welcome Dialog
4 
5 %> @cond
6 function varargout = welcome(varargin)
7 % Last Modified by GUIDE v2.5 24-May-2013 20:41:28
8 
9 % Begin initialization code - DO NOT EDIT
10 gui_Singleton = 1;
11 gui_State = struct('gui_Name', mfilename, ...
12  'gui_Singleton', gui_Singleton, ...
13  'gui_OpeningFcn', @welcome_OpeningFcn, ...
14  'gui_OutputFcn', @welcome_OutputFcn, ...
15  'gui_LayoutFcn', [] , ...
16  'gui_Callback', []);
17 if nargin && ischar(varargin{1})
18  gui_State.gui_Callback = str2func(varargin{1});
19 end
20 
21 if nargout
22  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
23 else
24  gui_mainfcn(gui_State, varargin{:});
25 end
26 % End initialization code - DO NOT EDIT
27 
28 % --- Executes just before welcome is made visible.
29 function welcome_OpeningFcn(hObject, eventdata, handles, varargin)
30 % This function has no output args, see OutputFcn.
31 % hObject handle to figure
32 % eventdata reserved - to be defined in a future version of MATLAB
33 % handles structure with handles and user data (see GUIDATA)
34 % varargin command line arguments to welcome (see VARARGIN)
35 
36 % Update handles structure
37 guidata(hObject, handles);
38 
39 % Determine the position of the dialog - centered on the callback figure
40 % if available, else, centered on the screen
41 FigPos=get(0,'DefaultFigurePosition');
42 OldUnits = get(hObject, 'Units');
43 set(hObject, 'Units', 'pixels');
44 OldPos = get(hObject,'Position');
45 FigWidth = OldPos(3);
46 FigHeight = OldPos(4);
47 if 0 || isempty(gcbf)
48 % ScreenUnits=get(0,'Units');
49 % set(0,'Units','pixels');
50 % ScreenSize=get(0,'ScreenSize');
51 % set(0,'Units',ScreenUnits);
52 %
53 % FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
54 % FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
55 else
56  GCBFOldUnits = get(gcbf,'Units');
57  set(gcbf,'Units','pixels');
58  GCBFPos = get(gcbf,'Position');
59  set(gcbf,'Units',GCBFOldUnits);
60  FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
61  (GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
62 end
63 FigPos(3:4)=[FigWidth FigHeight];
64 set(hObject, 'Position', FigPos);
65 set(hObject, 'Units', OldUnits);
66 
67 % Show a question icon from dialogicons.mat - variables questIconData
68 % and questIconMap
69 
70 set(handles.edit2, 'String', [sprintf('\n'), get_cite(0)])
71 set(handles.figure1, 'Name', 'Welcome to IRootLab')
72 
73 % Make the GUI modal
74 set(handles.figure1,'WindowStyle','modal')
75 
76 
77 % UIWAIT makes welcome wait for user response (see UIRESUME)
78 uiwait(handles.figure1);
79 
80 % --- Outputs from this function are returned to the command line.
81 function varargout = welcome_OutputFcn(hObject, eventdata, handles)
82 % varargout cell array for returning output args (see VARARGOUT);
83 % hObject handle to figure
84 % eventdata reserved - to be defined in a future version of MATLAB
85 % handles structure with handles and user data (see GUIDATA)
86 
87 % The figure can be deleted now
88 delete(handles.figure1);
89 
90 % --- Executes on button press in pushbutton1.
91 function pushbutton1_Callback(hObject, eventdata, handles)
92 % hObject handle to pushbutton1 (see GCBO)
93 % eventdata reserved - to be defined in a future version of MATLAB
94 % handles structure with handles and user data (see GUIDATA)
95 
96 handles.output = get(hObject,'String');
97 
98 % Update handles structure
99 guidata(hObject, handles);
100 
101 % Use UIRESUME instead of delete because the OutputFcn needs
102 % to get the updated handles structure.
103 uiresume(handles.figure1);
104 
105 % --- Executes on button press in pushbutton2.
106 function pushbutton2_Callback(hObject, eventdata, handles)
107 % hObject handle to pushbutton2 (see GCBO)
108 % eventdata reserved - to be defined in a future version of MATLAB
109 % handles structure with handles and user data (see GUIDATA)
110 
111 handles.output = get(hObject,'String');
112 
113 % Update handles structure
114 guidata(hObject, handles);
115 
116 % Use UIRESUME instead of delete because the OutputFcn needs
117 % to get the updated handles structure.
118 uiresume(handles.figure1);
119 
120 
121 % --- Executes when user attempts to close figure1.
122 function figure1_CloseRequestFcn(hObject, eventdata, handles)
123 % hObject handle to figure1 (see GCBO)
124 % eventdata reserved - to be defined in a future version of MATLAB
125 % handles structure with handles and user data (see GUIDATA)
126 
127 if isequal(get(handles.figure1, 'waitstatus'), 'waiting')
128  % The GUI is still in UIWAIT, us UIRESUME
129  uiresume(handles.figure1);
130 else
131  % The GUI is no longer waiting, just close it
132  delete(handles.figure1);
133 end
134 
135 
136 % --- Executes on key press over figure1 with no controls selected.
137 function figure1_KeyPressFcn(hObject, eventdata, handles)
138 % hObject handle to figure1 (see GCBO)
139 % eventdata reserved - to be defined in a future version of MATLAB
140 % handles structure with handles and user data (see GUIDATA)
141 
142 % Check for "enter" or "escape"
143 if isequal(get(hObject,'CurrentKey'),'escape')
144  % User said no by hitting escape
145  handles.output = 'No';
146 
147  % Update handles structure
148  guidata(hObject, handles);
149 
150  uiresume(handles.figure1);
151 end
152 
153 if isequal(get(hObject,'CurrentKey'),'return')
154  uiresume(handles.figure1);
155 end
156 
157 
158 % --- Executes on button press in pushbutton3.
159 function pushbutton3_Callback(hObject, eventdata, handles)
160 uiresume(handles.figure1)
161 
162 
163 function edit2_Callback(hObject, eventdata, handles)
164 function edit2_CreateFcn(hObject, eventdata, handles)
165 %> @endcond
function edit2_Callback(in hObject, in eventdata, in handles)
function figure1_KeyPressFcn(in hObject, in eventdata, in handles)
function figure1_CloseRequestFcn(in hObject, in eventdata, in handles)
function get_cite(in flagHref)
function edit2_CreateFcn(in hObject, in eventdata, in handles)
function pushbutton1_Callback(in hObject, in eventdata, in handles)
function pushbutton2_Callback(in hObject, in eventdata, in handles)