1268 dfref savedf = getdatafolderdfr()
1273 string win_name = logbook + "ElogPanel"
1274 string win_title = "ELOG " + logbook
1276 NewPanel /K=1 /N=$win_name /W=(600,200,1200,700) as win_title
1278 ModifyPanel /w=$win_name cbRGB=(52224,52224,65280)
1280 svar /sdfr=df_persistent attributes
1281 svar /sdfr=df_persistent controls
1282 svar /sdfr=df_persistent options
1283 wave /t /sdfr=df_volatile attach_list
1284 wave /sdfr=df_volatile attach_sel
1285 svar /sdfr=df_volatile url
1288 variable nattr = ItemsInList(attributes, ";")
1292 string persistent_path = GetDataFolder(1, df_persistent)
1293 string volatile_path = GetDataFolder(1, df_volatile)
1295 string variable_path
1299 for (iattr = 0; iattr < nattr; iattr += 1)
1300 s_attr = StringFromList(iattr, attributes, ";")
1301 s_control = StringFromList(iattr, controls, ";")
1302 strswitch(s_control[0,1])
1304 SetVariable $s_control, win=$win_name, pos={0,ypos}, size={300,16}, bodyWidth=230
1305 SetVariable $s_control, win=$win_name, title=s_attr, value= _STR:
""
1306 SetVariable $s_control, win=$win_name, userdata(attribute)=s_attr
1310 options_path = persistent_path + StringByKey(s_attr, options,
"=",
";")
1311 PopupMenu $s_control, win=$win_name, pos={0,ypos}, size={300,21}, bodyWidth=230
1312 PopupMenu $s_control, win=$win_name, title=s_attr
1313 PopupMenu $s_control, win=$win_name, mode=1, popvalue=
"Test", value= #options_path
1314 PopupMenu $s_control, win=$win_name, userdata(attribute)=s_attr
1318 CheckBox $s_control, win=$win_name, pos={70,ypos}, size={300,14}
1319 CheckBox $s_control, win=$win_name, title=s_attr, value= 1
1320 CheckBox $s_control, win=$win_name, userdata(attribute)=s_attr
1325 ypos = max(ypos, 80)
1327 TitleBox t_attach, win=$win_name, pos={308,5}, size={70,14}, title=
"Attachments", frame=0
1328 height = ypos - 21 - 4
1329 ListBox lb_attach, win=$win_name, pos={308,21}, size={264,height}
1330 ListBox lb_attach, win=$win_name, listWave=attach_list
1331 ListBox lb_attach, win=$win_name, mode=1, selWave=attach_sel, selRow=-1
1332 ListBox lb_attach, win=$win_name, widths={20,160,80}
1333 ListBox lb_attach, win=$win_name, help={
"Choose graphs to attach to the message."}
1335 Button b_attach_top, win=$win_name, pos={420,2}, size={40,18}, title=
"top"
1336 Button b_attach_top, win=$win_name, fcolor=(56576,60928,47872)
1338 Button b_attach_top, win=$win_name, help={
"Select top graph for attachment."}
1339 Button b_attach_all, win=$win_name, pos={460,2}, size={40,18}, title=
"all"
1340 Button b_attach_all, win=$win_name, fcolor=(56576,60928,47872)
1342 Button b_attach_all, win=$win_name, help={
"Select all graphs for attachment."}
1343 Button b_attach_none, win=$win_name, pos={500,2}, size={40,18}, title=
"none"
1344 Button b_attach_none, win=$win_name, fcolor=(56576,60928,47872)
1346 Button b_attach_none, win=$win_name, help={
"Deselect all attachments."}
1347 Button b_save_graphs, win=$win_name, pos={540,2}, size={40,18}, title=
"save"
1348 Button b_save_graphs, win=$win_name, fcolor=(56576,60928,47872)
1350 Button b_save_graphs, win=$win_name, help={
"Save selected graphs as PNG bitmap files."}
1351 Button b_attach_up, win=$win_name, pos={576,20}, size={20,20}, title=
"\\W517"
1352 Button b_attach_up, win=$win_name, fcolor=(56576,60928,47872)
1354 Button b_attach_up, win=$win_name, help={
"Move selected graph up."}
1355 Button b_attach_dw, win=$win_name, pos={576,40}, size={20,20}, title=
"\\W523"
1356 Button b_attach_dw, win=$win_name, fcolor=(56576,60928,47872)
1358 Button b_attach_dw, win=$win_name, help={
"Move selected graph down."}
1361 Button b_submit,win=$win_name, pos={70,ypos},size={46,20},proc=
PearlElog#
bp_submit,title=
"Submit"
1362 Button b_submit,win=$win_name, help={
"Submit form data to ELOG (new entry)."}
1363 Button b_submit,win=$win_name, fcolor=(56576,60928,47872)
1364 Button b_clear,win=$win_name, pos={120,ypos},size={46,20},proc=
PearlElog#
bp_clear,title=
"Clear"
1365 Button b_clear,win=$win_name, help={
"Clear the form fields"}
1366 Button b_clear,win=$win_name, fcolor=(56576,60928,47872)
1369 variable_path = volatile_path +
"msg_id"
1370 SetVariable sv_id,win=$win_name, pos={51,ypos},size={119,16},bodyWidth=77
1371 SetVariable sv_id,win=$win_name, title=
"ID",value=$variable_path
1372 SetVariable sv_id,win=$win_name, help={
"ID of last submitted message, or message to attach or reply to."}
1374 TitleBox t_host, win=$win_name, pos={170,ypos+4}, size={112.00,14.00}, frame=0
1375 TitleBox t_host, win=$win_name, variable=url
1378 Button b_attach,win=$win_name, pos={170,ypos},size={48,20},proc=
PearlElog#
bp_attach,title=
"Attach"
1379 Button b_attach,win=$win_name, help={
"Attach the selected graph to an existing ELOG entry (correct ID required)."}
1380 Button b_attach,win=$win_name, fcolor=(56576,60928,47872)
1381 Button b_reply,win=$win_name, pos={220,ypos},size={48,20},proc=
PearlElog#
bp_submit,title=
"Reply"
1382 Button b_reply,win=$win_name, help={
"Submit form data to ELOG as a reply to an existing message (correct ID required)."}
1383 Button b_reply,win=$win_name, fcolor=(56576,60928,47872)
1384 Button b_login,win=$win_name, pos={550,ypos},size={46,20},proc=
PearlElog#
bp_login,title=
"Login"
1385 Button b_login,win=$win_name, help={
"Enter user name and password."}
1386 Button b_login,win=$win_name, fcolor=(56576,60928,47872)
1387 Button b_logout,win=$win_name, pos={550,ypos},size={46,20},proc=
PearlElog#
bp_logout,title=
"Logout"
1388 Button b_logout,win=$win_name, help={
"Clear user name and password."}
1389 Button b_logout,win=$win_name, fcolor=(56576,60928,47872), disable=3
1392 SetWindow $win_name, userdata(logbook)=logbook
1395 TitleBox t_message,win=$win_name, pos={10,ypos},size={58,16},fixedSize=1,frame=0,anchor=RT,title=
"Message"
1396 DefineGuide UGH0={FT,ypos},UGV0={FL,70},UGH1={FB,-52},UGV1={FR,-2}
1397 NewNotebook /F=0 /N=Message /OPTS=3 /W=(115,404,345,341)/FG=(UGV0,UGH0,UGV1,UGH1) /HOST=#
1398 Notebook kwTopWin, defaultTab=20, statusWidth=0, autoSave=0
1399 Notebook kwTopWin fSize=10, fStyle=0, textRGB=(0,0,0)
1400 RenameWindow #,Message
1401 string nb_name = win_name +
"#Message"
1402 SetActiveSubwindow ##
1405 svar /z /sdfr=df_persistent recent
1406 if (svar_exists(recent) && (strlen(recent) > 0))
1409 svar /z /sdfr=df_persistent recent_message
1410 if (svar_exists(recent_message) && (strlen(recent_message) > 0))
1413 Notebook $nb_name selection={startOfFile,startOfFile}, findText={
"",1}
1415 setdatafolder savedf