IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
ask_peakdetector.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Asks for a peak detector object. Specifying one or not will be optional to the user.
4 
5 %>@cond
6 function varargout = ask_peakdetector(varargin)
7 % Last Modified by GUIDE v2.5 14-Jan-2014 08:00:03
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', @ask_peakdetector_OpeningFcn, ...
14  'gui_OutputFcn', @ask_peakdetector_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 
29 % --- Executes just before ask_peakdetector is made visible.
30 function ask_peakdetector_OpeningFcn(hObject, eventdata, handles, varargin)
31 handles.output.flag_ok = 0;
32 guidata(hObject, handles);
33 gui_set_position(hObject);
34 refresh(handles);
35 
36 % --- Outputs from this function are returned to the command clae.
37 function varargout = ask_peakdetector_OutputFcn(hObject, eventdata, handles)
38 try
39  uiwait(handles.figure1);
40  handles = guidata(hObject);
41  varargout{1} = handles.output;
42  delete(gcf);
43 catch
44  output.flag_ok = 0;
45  output.params = {};
46  varargout{1} = output;
47 end;
48 
49 
50 %############################################
51 
52 %#########
53 function refresh(handles)
54 listbox_load_from_workspace('peakdetector', handles.popupmenuPeakdetector, 1);
55 
56 
57 %############################################
58 %############################################
59 
60 % --- Executes on button press in pushbuttonOK.
61 function pushbuttonOK_Callback(hObject, eventdata, handles)
62 try
63  spd = listbox_get_selected_1stname(handles.popupmenuPeakdetector);
64  if isempty(spd)
65  spd = '[]';
66  end;
67  handles.output.params = {...
68  'peakdetector', spd, ...
69  };
70  handles.output.flag_ok = 1;
71  guidata(hObject, handles);
72  uiresume();
73 catch ME
74  irerrordlg(ME.message, 'Cannot continue');
75 
76 end;
77 
78 function popupmenuPeakdetector_Callback(hObject, eventdata, handles)
79 function popupmenuPeakdetector_CreateFcn(hObject, eventdata, handles)
80 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
81  set(hObject,'BackgroundColor','white');
82 end
83 
84 %> @endcond
Peak Detector.
Definition: peakdetector.m:6
function listbox_get_selected_1stname(in h_listbox)
function listbox_load_from_workspace(in classname, in h_list, in flag_blank, in string_empty, in input)
function gui_set_position(in hObject)
function irerrordlg(in errorstring, in dlgname)