IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_vis_sovalues_drawsubplot.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window for @ref vis_sovalues_drawsubplot
5 
6 %>@cond
7 function varargout = uip_vis_sovalues_drawsubplot(varargin)
8 % Last Modified by GUIDE v2.5 15-Nov-2012 20:30:02
9 
10 % Begin initialization code - DO NOT EDIT
11 gui_Singleton = 1;
12 gui_State = struct('gui_Name', mfilename, ...
13  'gui_Singleton', gui_Singleton, ...
14  'gui_OpeningFcn', @uip_vis_sovalues_drawsubplot_OpeningFcn, ...
15  'gui_OutputFcn', @uip_vis_sovalues_drawsubplot_OutputFcn, ...
16  'gui_LayoutFcn', [] , ...
17  'gui_Callback', []);
18 if nargin && ischar(varargin{1})
19  gui_State.gui_Callback = str2func(varargin{1});
20 end
21 
22 if nargout
23  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
24 else
25  gui_mainfcn(gui_State, varargin{:});
26 end
27 % End initialization code - DO NOT EDIT
28 
29 
30 % --- Executes just before uip_vis_sovalues_drawsubplot is made visible.
31 function uip_vis_sovalues_drawsubplot_OpeningFcn(hObject, eventdata, handles, varargin) %#ok<*INUSL>
32 if nargin > 4
33  handles.input.sovalues = varargin{2};
34 else
35  handles.input.sovalues = [];
36 end;
37 handles.output.flag_ok = 0;
38 guidata(hObject, handles);
39 gui_set_position(hObject);
40 
41 if ~isempty(handles.input.sovalues)
42  sov = handles.input.sovalues;
43  a = sov.get_numericfieldnames();
44  set(handles.popupmenu_valuesfieldname, 'string', a);
45  set(handles.edit_valuesfieldname, 'string', a{1});
46 else
47  set(handles.popupmenu_valuesfieldname, 'string', {'?'});
48 end;
49 
50 % --- Outputs from this function are returned to the command clae.
51 function varargout = uip_vis_sovalues_drawsubplot_OutputFcn(hObject, eventdata, handles)
52 try
53  uiwait(handles.figure1);
54  handles = guidata(hObject);
55  varargout{1} = handles.output;
56  delete(gcf);
57 catch %#ok<*CTCH>
58  output.flag_ok = 0;
59  output.params = {};
60  varargout{1} = output;
61 end;
62 
63 
64 % --- Executes on button press in pushbuttonOk.
65 function pushbuttonOk_Callback(hObject, eventdata, handles)
66 try
67  aaa = eval(get(handles.edit_dimspec, 'String'));
68  if iscell(aaa)
69  aaa = cell2str(aaa);
70  else
71  aaa = mat2str(aaa);
72  end;
73 
74  svfn = fel(get(handles.edit_valuesfieldname, 'String'));
75  if ~isempty(handles.input.sovalues)
76  sov = handles.input.sovalues;
77  if ~any(strcmp(svfn, sov.get_numericfieldnames()));
78  irerror(sprintf('Invalid values field name: "%s"', svfn));
79  end;
80  end;
81 
82  handles.output.params = {...
83  'dimspec', aaa, ...
84  'valuesfieldname', ['''', svfn, ''''], ...
85  'ylimits', mat2str(eval(get(handles.edit_ylimits, 'String'))), ...
86  'xticks', mat2str(eval(get(handles.edit_xticks, 'String'))), ...
87  'flag_star', num2str(get(handles.checkbox_flag_star, 'Value')), ...
88  'flag_hachure', num2str(get(handles.checkbox_flag_hachure, 'Value')), ...
89  'xticklabels', cell2str(eval(get(handles.edit_xticklabels, 'String'))) ...
90  };
91  handles.output.flag_ok = 1;
92  guidata(hObject, handles);
93  uiresume();
94 catch ME
95  irerrordlg(ME.message, 'Cannot continue');
96 
97 end;
98 
99 function edit_conc_Callback(hObject, eventdata, handles) %#ok<*INUSD,*DEFNU>
100 
101 % --- Executes during object creation, after setting all properties.
102 function edit_conc_CreateFcn(hObject, eventdata, handles)
103 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
104  set(hObject,'BackgroundColor','white');
105 end
106 
107 
108 function edit_dimspec_Callback(hObject, eventdata, handles)
109 
110 % --- Executes during object creation, after setting all properties.
111 function edit_dimspec_CreateFcn(hObject, eventdata, handles)
112 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
113  set(hObject,'BackgroundColor','white');
114 end
115 
116 
117 % --- Executes on button press in checkbox_flag_legend.
118 function checkbox_flag_legend_Callback(hObject, eventdata, handles)
119 
120 % --- Executes on button press in checkbox_flag_ud.
121 function checkbox_flag_ud_Callback(hObject, eventdata, handles)
122 
123 
124 
125 function edit_valuesfieldname_Callback(hObject, eventdata, handles)
126 
127 function edit_valuesfieldname_CreateFcn(hObject, eventdata, handles)
128 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
129  set(hObject,'BackgroundColor','white');
130 end
131 
132 function edit_ylimits_Callback(hObject, eventdata, handles)
133 
134 function edit_ylimits_CreateFcn(hObject, eventdata, handles)
135 
136 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
137  set(hObject,'BackgroundColor','white');
138 end
139 
140 function edit_xticks_Callback(hObject, eventdata, handles)
141 
142 function edit_xticks_CreateFcn(hObject, eventdata, handles)
143 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
144  set(hObject,'BackgroundColor','white');
145 end
146 
147 function edit_xticklabels_Callback(hObject, eventdata, handles)
148 
149 function edit_xticklabels_CreateFcn(hObject, eventdata, handles)
150 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
151  set(hObject,'BackgroundColor','white');
152 end
153 
154 function checkbox_flag_star_Callback(hObject, eventdata, handles)
155 
156 
157 %#####
158 function popupmenu_valuesfieldname_Callback(hObject, eventdata, handles)
159 contents = cellstr(get(hObject,'String'));
160 s = contents{get(hObject,'Value')};
161 if ~strcmp(s, '?')
162  set(handles.edit_valuesfieldname, 'String', s);
163 end;
164 
165 function popupmenu_valuesfieldname_CreateFcn(hObject, eventdata, handles)
166 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
167  set(hObject,'BackgroundColor','white');
168 end
169 function checkbox_flag_hachure_Callback(hObject, eventdata, handles)
170 %> @endcond
Draws plot from a sovalues object.
function cell2str(in c)
function irerror(in s)
function fel(in c, in n)
function gui_set_position(in hObject)
function irerrordlg(in errorstring, in dlgname)