IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
send_error_gui.m
Go to the documentation of this file.
1 %>@ingroup guigroup
2 %>@file
3 %>@brief send_error_gui Dialog
4 function varargout = send_error_gui(varargin)
5 % Last Modified by GUIDE v2.5 13-Jan-2012 16:47:03
6 
7 % Begin initialization code - DO NOT EDIT
8 gui_Singleton = 1;
9 gui_State = struct('gui_Name', mfilename, ...
10  'gui_Singleton', gui_Singleton, ...
11  'gui_OpeningFcn', @send_error_gui_OpeningFcn, ...
12  'gui_OutputFcn', @send_error_gui_OutputFcn, ...
13  'gui_LayoutFcn', [] , ...
14  'gui_Callback', []);
15 if nargin && ischar(varargin{1})
16  gui_State.gui_Callback = str2func(varargin{1});
17 end
18 
19 if nargout
20  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
21 else
22  gui_mainfcn(gui_State, varargin{:});
23 end
24 % End initialization code - DO NOT EDIT
25 
26 % --- Executes just before send_error_gui is made visible.
27 function send_error_gui_OpeningFcn(hObject, eventdata, handles, varargin)
28 % This function has no output args, see OutputFcn.
29 % hObject handle to figure
30 % eventdata reserved - to be defined in a future version of MATLAB
31 % handles structure with handles and user data (see GUIDATA)
32 % varargin command line arguments to send_error_gui (see VARARGIN)
33 
34 % Update handles structure
35 guidata(hObject, handles);
36 
37 % Determine the position of the dialog - centered on the callback figure
38 % if available, else, centered on the screen
39 FigPos=get(0,'DefaultFigurePosition');
40 OldUnits = get(hObject, 'Units');
41 set(hObject, 'Units', 'pixels');
42 OldPos = get(hObject,'Position');
43 FigWidth = OldPos(3);
44 FigHeight = OldPos(4);
45 if 0 || isempty(gcbf)
46 % ScreenUnits=get(0,'Units');
47 % set(0,'Units','pixels');
48 % ScreenSize=get(0,'ScreenSize');
49 % set(0,'Units',ScreenUnits);
50 %
51 % FigPos(1)=1/2*(ScreenSize(3)-FigWidth);
52 % FigPos(2)=2/3*(ScreenSize(4)-FigHeight);
53 else
54  GCBFOldUnits = get(gcbf,'Units');
55  set(gcbf,'Units','pixels');
56  GCBFPos = get(gcbf,'Position');
57  set(gcbf,'Units',GCBFOldUnits);
58  FigPos(1:2) = [(GCBFPos(1) + GCBFPos(3) / 2) - FigWidth / 2, ...
59  (GCBFPos(2) + GCBFPos(4) / 2) - FigHeight / 2];
60 end
61 FigPos(3:4)=[FigWidth FigHeight];
62 set(hObject, 'Position', FigPos);
63 set(hObject, 'Units', OldUnits);
64 
65 % Show a question icon from dialogicons.mat - variables questIconData
66 % and questIconMap
67 
68 IM = imread('splash.png');
69 
70 % load dialogicons.mat
71 
72 % IconData=questIconData;
73 % questIconMap(256,:) = get(handles.figure1, 'Color');
74 % IconCMap=questIconMap;
75 
76 % Img=image(IconData, 'Parent', handles.axes1);
77 % set(handles.figure1, 'Colormap', IconCMap);
78 
79 Img = image(IM, 'Parent', handles.axes1);
80 
81 set(handles.axes1, ...
82  'Visible', 'off', ...
83  'YDir' , 'reverse' , ...
84  'XLim' , get(Img,'XData'), ...
85  'YLim' , get(Img,'YData') ...
86  );
87 
88 % Make the GUI modal
89 set(handles.figure1,'WindowStyle','modal')
90 
91 
92 % UIWAIT makes send_error_gui wait for user response (see UIRESUME)
93 uiwait(handles.figure1);
94 
95 % --- Outputs from this function are returned to the command line.
96 function varargout = send_error_gui_OutputFcn(hObject, eventdata, handles)
97 % varargout cell array for returning output args (see VARARGOUT);
98 % hObject handle to figure
99 % eventdata reserved - to be defined in a future version of MATLAB
100 % handles structure with handles and user data (see GUIDATA)
101 
102 % The figure can be deleted now
103 delete(handles.figure1);
104 
105 % --- Executes on button press in pushbutton1.
106 function pushbutton1_Callback(hObject, eventdata, handles)
107 % hObject handle to pushbutton1 (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 % --- Executes on button press in pushbutton2.
121 function pushbutton2_Callback(hObject, eventdata, handles)
122 % hObject handle to pushbutton2 (see GCBO)
123 % eventdata reserved - to be defined in a future version of MATLAB
124 % handles structure with handles and user data (see GUIDATA)
125 
126 handles.output = get(hObject,'String');
127 
128 % Update handles structure
129 guidata(hObject, handles);
130 
131 % Use UIRESUME instead of delete because the OutputFcn needs
132 % to get the updated handles structure.
133 uiresume(handles.figure1);
134 
135 
136 % --- Executes when user attempts to close figure1.
137 function figure1_CloseRequestFcn(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 if isequal(get(handles.figure1, 'waitstatus'), 'waiting')
143  % The GUI is still in UIWAIT, us UIRESUME
144  uiresume(handles.figure1);
145 else
146  % The GUI is no longer waiting, just close it
147  delete(handles.figure1);
148 end
149 
150 
151 % --- Executes on key press over figure1 with no controls selected.
152 function figure1_KeyPressFcn(hObject, eventdata, handles)
153 % hObject handle to figure1 (see GCBO)
154 % eventdata reserved - to be defined in a future version of MATLAB
155 % handles structure with handles and user data (see GUIDATA)
156 
157 % Check for "enter" or "escape"
158 if isequal(get(hObject,'CurrentKey'),'escape')
159  % User said no by hitting escape
160  handles.output = 'No';
161 
162  % Update handles structure
163  guidata(hObject, handles);
164 
165  uiresume(handles.figure1);
166 end
167 
168 if isequal(get(hObject,'CurrentKey'),'return')
169  uiresume(handles.figure1);
170 end
171 
172 
173 
174 function edit1_Callback(hObject, eventdata, handles)
175 % hObject handle to edit1 (see GCBO)
176 % eventdata reserved - to be defined in a future version of MATLAB
177 % handles structure with handles and user data (see GUIDATA)
178 
179 % Hints: get(hObject,'String') returns contents of edit1 as text
180 % str2double(get(hObject,'String')) returns contents of edit1 as a double
181 
182 
183 % --- Executes during object creation, after setting all properties.
184 function edit1_CreateFcn(hObject, eventdata, handles)
185 % hObject handle to edit1 (see GCBO)
186 % eventdata reserved - to be defined in a future version of MATLAB
187 % handles empty - handles not created until after all CreateFcns called
188 
189 % Hint: edit controls usually have a white background on Windows.
190 % See ISPC and COMPUTER.
191 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
192  set(hObject,'BackgroundColor','white');
193 end
194 
195 
196 
197 function edit2_Callback(hObject, eventdata, handles)
198 % hObject handle to edit2 (see GCBO)
199 % eventdata reserved - to be defined in a future version of MATLAB
200 % handles structure with handles and user data (see GUIDATA)
201 
202 % Hints: get(hObject,'String') returns contents of edit2 as text
203 % str2double(get(hObject,'String')) returns contents of edit2 as a double
204 
205 
206 % --- Executes during object creation, after setting all properties.
207 function edit2_CreateFcn(hObject, eventdata, handles)
208 % hObject handle to edit2 (see GCBO)
209 % eventdata reserved - to be defined in a future version of MATLAB
210 % handles empty - handles not created until after all CreateFcns called
211 
212 % Hint: edit controls usually have a white background on Windows.
213 % See ISPC and COMPUTER.
214 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
215  set(hObject,'BackgroundColor','white');
216 end
function send_error_gui_OutputFcn(in hObject, in eventdata, in handles)
function edit2_Callback(in hObject, in eventdata, in handles)
function send_error_gui_OpeningFcn(in hObject, in eventdata, in handles, in varargin)
function send_error_gui(in varargin)
function figure1_KeyPressFcn(in hObject, in eventdata, in handles)
function edit1_Callback(in hObject, in eventdata, in handles)
function figure1_CloseRequestFcn(in hObject, in eventdata, in handles)
function edit2_CreateFcn(in hObject, in eventdata, in handles)
Analysis Session (AS) base class.
Definition: as.m:6
function edit1_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)