Mercurial > hg > ltpda
comparison m-toolbox/classes/@repogui/buildSubmitPanel.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % BUILDSUBMITPANEL build the submit panel. | |
2 % | |
3 % M Hewitson 22-09-08 | |
4 % | |
5 % $Id: buildSubmitPanel.m,v 1.7 2011/04/08 08:56:25 hewitson Exp $ | |
6 % | |
7 function buildSubmitPanel(mainfig) | |
8 | |
9 import utils.const.* | |
10 utils.helper.msg(msg.PROC1, 'building Submit Panel'); | |
11 | |
12 htab = mainfig.panels(2); | |
13 | |
14 Gproperties = mainfig.Gproperties; | |
15 pmarg = 0.025; | |
16 | |
17 CommonHeight = 0.06; | |
18 | |
19 % header | |
20 bw = 0.3; | |
21 bl = pmarg; | |
22 | |
23 bh = CommonHeight; | |
24 bb = 1-2*pmarg-bh-0.6; | |
25 uicontrol(htab, 'Style','pushbutton',... | |
26 'String', 'Refresh',... | |
27 'Units', 'normalized', ... | |
28 'Fontsize', Gproperties.fontsize+2, ... | |
29 'Position',[bl bb .14 bh], ... | |
30 'Callback',@refreshBtnCallback); | |
31 | |
32 uicontrol(htab, 'Style','pushbutton',... | |
33 'String', 'Select',... | |
34 'Units', 'normalized', ... | |
35 'Fontsize', Gproperties.fontsize+2, ... | |
36 'Position',[pmarg+.16 bb .14 bh], ... | |
37 'Callback',@okBtnCallback); | |
38 | |
39 | |
40 % list box objects to submit | |
41 | |
42 bh = CommonHeight; | |
43 bb = bb - bh - .02; | |
44 uicontrol(htab, 'Style','text',... | |
45 'String', 'Objects to submit:',... | |
46 'Units', 'normalized', ... | |
47 'BackgroundColor', 'w', ... | |
48 'ForegroundColor', 'k', ... | |
49 'Fontsize', Gproperties.fontsize+1, ... | |
50 'Userdata',[], ... | |
51 'Tag', 'treeHandle', ... | |
52 'Position',[bl bb bw bh]); | |
53 | |
54 bh = 0.18; | |
55 bb = bb - bh; | |
56 uicontrol(htab,'Style','edit',... | |
57 'String',{' '},... | |
58 'Min',1,... | |
59 'Max',10,... | |
60 'BackgroundColor', 'w',... | |
61 'Fontsize', Gproperties.fontsize,... | |
62 'Units', 'normalized', ... | |
63 'Position',[bl bb bw bh],... | |
64 'TooltipString','Here you can also type in the name of the variables to submit',... | |
65 'Tag', 'RepoguiObjs2SubmitList'); | |
66 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
67 | |
68 % Submission details | |
69 | |
70 EditWidth = 0.42; | |
71 | |
72 % Experiment title | |
73 bl = bl + pmarg + bw; | |
74 BL = bl; | |
75 bw = 0.2; | |
76 bh = CommonHeight; | |
77 bb = 1-2*pmarg-bh; | |
78 sth = uicontrol(htab, 'Style','text',... | |
79 'String', 'Experiment Title',... | |
80 'Units', 'normalized', ... | |
81 'BackgroundColor', 'w', ... | |
82 'ForegroundColor', 'r', ... | |
83 'FontWeight','Bold',... | |
84 'Fontsize', Gproperties.fontsize+1, ... | |
85 'Position',[bl bb bw bh]); | |
86 | |
87 bl = bl + pmarg + bw; | |
88 bw = EditWidth; | |
89 th = uicontrol(htab, ... | |
90 'Style', 'edit', ... | |
91 'Units', 'normalized',... | |
92 'BackgroundColor', 'w', ... | |
93 'Fontsize', Gproperties.fontsize, ... | |
94 'String', '', ... | |
95 'Position', [bl bb bw bh],... | |
96 'HorizontalAlignment', 'left', ... | |
97 'Tag', 'RepoguiExperimentTitleEdit'); | |
98 | |
99 % Experiment description | |
100 bl = BL; | |
101 bw = 0.2; | |
102 bh = 3*CommonHeight; | |
103 bb = bb - pmarg - bh; | |
104 sth = uicontrol(htab, 'Style','text',... | |
105 'String', 'Experiment Description',... | |
106 'Units', 'normalized', ... | |
107 'BackgroundColor', 'w', ... | |
108 'ForegroundColor', 'r', ... | |
109 'FontWeight','Bold',... | |
110 'Fontsize', Gproperties.fontsize+1, ... | |
111 'Position',[bl bb bw bh]); | |
112 | |
113 bl = bl + pmarg + bw; | |
114 bw = EditWidth; | |
115 th = uicontrol(htab, ... | |
116 'Style', 'edit', ... | |
117 'Units', 'normalized',... | |
118 'BackgroundColor', 'w', ... | |
119 'Fontsize', Gproperties.fontsize, ... | |
120 'HorizontalAlignment', 'left', ... | |
121 'String', '', ... | |
122 'Max', 1000, ... | |
123 'Position', [bl bb bw bh],... | |
124 'Tag', 'RepoguiExperimentDescriptionEdit'); | |
125 | |
126 % Analysis description | |
127 bl = BL; | |
128 bw = 0.2; | |
129 bh = 2*CommonHeight; | |
130 bb = bb - pmarg - bh; | |
131 sth = uicontrol(htab, 'Style','text',... | |
132 'String', 'Analysis Description',... | |
133 'Units', 'normalized', ... | |
134 'BackgroundColor', 'w', ... | |
135 'ForegroundColor', 'r', ... | |
136 'FontWeight','Bold',... | |
137 'Fontsize', Gproperties.fontsize+1, ... | |
138 'Position',[bl bb bw bh]); | |
139 | |
140 bl = bl + pmarg + bw; | |
141 bw = EditWidth; | |
142 th = uicontrol(htab, ... | |
143 'Style', 'edit', ... | |
144 'Units', 'normalized',... | |
145 'BackgroundColor', 'w', ... | |
146 'HorizontalAlignment', 'left', ... | |
147 'Fontsize', Gproperties.fontsize, ... | |
148 'String', '', ... | |
149 'Max', 1000, ... | |
150 'Position', [bl bb bw bh],... | |
151 'Tag', 'RepoguiAnalysisDescriptionEdit'); | |
152 | |
153 % Quantity | |
154 bl = BL; | |
155 bw = 0.2; | |
156 bh = CommonHeight; | |
157 bb = bb - pmarg - bh; | |
158 sth = uicontrol(htab, 'Style','text',... | |
159 'String', 'Quantity',... | |
160 'Units', 'normalized', ... | |
161 'BackgroundColor', 'w', ... | |
162 'ForegroundColor', 'k', ... | |
163 'Fontsize', Gproperties.fontsize+1, ... | |
164 'Position',[bl bb bw bh]); | |
165 | |
166 bl = bl + pmarg + bw; | |
167 bw = EditWidth; | |
168 th = uicontrol(htab, ... | |
169 'Style', 'edit', ... | |
170 'Units', 'normalized',... | |
171 'BackgroundColor', 'w', ... | |
172 'HorizontalAlignment', 'left', ... | |
173 'Fontsize', Gproperties.fontsize, ... | |
174 'String', '', ... | |
175 'Max', 1000, ... | |
176 'Position', [bl bb bw bh],... | |
177 'Tag', 'RepoguiQuantityEdit'); | |
178 | |
179 % Keywords | |
180 bl = BL; | |
181 bw = 0.2; | |
182 bh = CommonHeight; | |
183 bb = bb - pmarg - bh; | |
184 sth = uicontrol(htab, 'Style','text',... | |
185 'String', 'Keywords',... | |
186 'Units', 'normalized', ... | |
187 'BackgroundColor', 'w', ... | |
188 'ForegroundColor', 'k', ... | |
189 'Fontsize', Gproperties.fontsize+1, ... | |
190 'Position',[bl bb bw bh]); | |
191 | |
192 bl = bl + pmarg + bw; | |
193 bw = EditWidth; | |
194 th = uicontrol(htab, ... | |
195 'Style', 'edit', ... | |
196 'Units', 'normalized',... | |
197 'BackgroundColor', 'w', ... | |
198 'HorizontalAlignment', 'left', ... | |
199 'Fontsize', Gproperties.fontsize, ... | |
200 'String', '', ... | |
201 'Max', 1000, ... | |
202 'Position', [bl bb bw bh],... | |
203 'Tag', 'RepoguiKeywordsEdit'); | |
204 | |
205 % Reference IDs | |
206 bl = BL; | |
207 bw = 0.2; | |
208 bh = CommonHeight; | |
209 bb = bb - pmarg - bh; | |
210 sth = uicontrol(htab, 'Style','text',... | |
211 'String', 'Reference IDs',... | |
212 'Units', 'normalized', ... | |
213 'BackgroundColor', 'w', ... | |
214 'ForegroundColor', 'k', ... | |
215 'Fontsize', Gproperties.fontsize+1, ... | |
216 'Position',[bl bb bw bh]); | |
217 | |
218 bl = bl + pmarg + bw; | |
219 bw = EditWidth; | |
220 th = uicontrol(htab, ... | |
221 'Style', 'edit', ... | |
222 'Units', 'normalized',... | |
223 'BackgroundColor', 'w', ... | |
224 'HorizontalAlignment', 'left', ... | |
225 'Fontsize', Gproperties.fontsize, ... | |
226 'String', '', ... | |
227 'Max', 1000, ... | |
228 'Position', [bl bb bw bh],... | |
229 'Tag', 'RepoguiReferenceIDsEdit'); | |
230 | |
231 % Additional comments | |
232 bl = BL; | |
233 bw = 0.2; | |
234 bh = CommonHeight; | |
235 bb = bb - pmarg - bh; | |
236 sth = uicontrol(htab, 'Style','text',... | |
237 'String', 'Additional Comments',... | |
238 'Units', 'normalized', ... | |
239 'BackgroundColor', 'w', ... | |
240 'ForegroundColor', 'k', ... | |
241 'Fontsize', Gproperties.fontsize+1, ... | |
242 'Position',[bl bb bw bh]); | |
243 | |
244 bl = bl + pmarg + bw; | |
245 bw = EditWidth; | |
246 th = uicontrol(htab, ... | |
247 'Style', 'edit', ... | |
248 'Units', 'normalized',... | |
249 'BackgroundColor', 'w', ... | |
250 'HorizontalAlignment', 'left', ... | |
251 'Fontsize', Gproperties.fontsize, ... | |
252 'String', '', ... | |
253 'Max', 1000, ... | |
254 'Position', [bl bb bw bh],... | |
255 'Tag', 'RepoguiAdditonalCommentsEdit'); | |
256 | |
257 | |
258 % Additional authors | |
259 bl = BL; | |
260 bw = 0.2; | |
261 bh = CommonHeight; | |
262 bb = bb - pmarg - bh; | |
263 sth = uicontrol(htab, 'Style','text',... | |
264 'String', 'Additional Authors',... | |
265 'Units', 'normalized', ... | |
266 'BackgroundColor', 'w', ... | |
267 'ForegroundColor', 'k', ... | |
268 'Fontsize', Gproperties.fontsize+1, ... | |
269 'Position',[bl bb bw bh]); | |
270 | |
271 bl = bl + pmarg + bw; | |
272 bw = EditWidth; | |
273 th = uicontrol(htab, ... | |
274 'Style', 'edit', ... | |
275 'Units', 'normalized',... | |
276 'BackgroundColor', 'w', ... | |
277 'HorizontalAlignment', 'left', ... | |
278 'Fontsize', Gproperties.fontsize, ... | |
279 'String', '', ... | |
280 'Max', 1000, ... | |
281 'Position', [bl bb bw bh],... | |
282 'Tag', 'RepoguiAdditionalAuthorsEdit'); | |
283 | |
284 % Submit button | |
285 | |
286 % bb = bb - pmarg - bh; | |
287 bb = .02; | |
288 bl = bl + bw - 0.2; | |
289 bw = 0.2; | |
290 pbh = uicontrol(htab,'Style','pushbutton',... | |
291 'String','Submit',... | |
292 'Callback', {'repogui.cb_submit', mainfig}, ... | |
293 'Units', 'normalized', ... | |
294 'Fontsize', Gproperties.fontsize, ... | |
295 'Position',[bl bb bw bh], ... | |
296 'Tag','repoguiSubmitButton'); | |
297 | |
298 end | |
299 | |
300 function okBtnCallback(varargin) | |
301 | |
302 tree = get(findobj(gcf,'Tag','treeHandle'),'UserData'); | |
303 objNames = {}; | |
304 xx = get(tree,'SelectedNodes'); | |
305 | |
306 for j=1:numel(xx) | |
307 yy{j} = getPath(xx(j)); | |
308 | |
309 cName = ''; | |
310 for i = 2:numel(yy{j}) | |
311 cName = [cName '.' char(getName(yy{j}(i)))]; | |
312 end; | |
313 | |
314 if ~isempty(cName) | |
315 cName(1) = []; | |
316 objNames = [objNames cName]; | |
317 end | |
318 end | |
319 | |
320 objNames = objNames'; | |
321 | |
322 set(findobj('Tag','RepoguiObjs2SubmitList'),'String',objNames); | |
323 | |
324 end | |
325 | |
326 | |
327 function refreshBtnCallback(varargin) | |
328 | |
329 tree = get(findobj(gcf,'Tag','treeHandle'),'UserData'); | |
330 delete(tree) | |
331 tree = repogui.cb_treegui(); | |
332 set(findobj(gcf,'Tag','treeHandle'),'UserData',tree); | |
333 | |
334 end |