EZmultiDayExp.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. % Is the callback supposed to be nested?
  2. function EZmultiDayGui
  3. %global Exp
  4. global exDlst
  5. xPos=0.05;
  6. btnWid=0.10;
  7. btnHt=0.05;
  8. spacing=0.02;% Spacing between the button and the next command's label
  9. % The ADD Groups button
  10. btnNumber=1;
  11. yPos=0.85-(btnNumber-1)*(btnHt+spacing);
  12. btnPos=[xPos yPos-spacing btnWid btnHt];
  13. %fhImParm=gcf;
  14. exFolder=uigetdir
  15. exDirs=dir(exFolder)
  16. exFs={exDirs.name}
  17. f=figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' );
  18. hListbox=uicontrol(...
  19. 'Style', 'listbox',...
  20. 'String',sort(exFs),...
  21. 'value',[],...
  22. 'max',1000,...
  23. 'min',1,...
  24. 'Units','normalized',...
  25. 'Position', [.70 .40 .6 .60],...
  26. 'callback',{@load_listbox}); % 'uiresume(gcbf)'); 'Position', [5 100 60 20])
  27. function load_listbox(source,eventdata)
  28. % global CSrchRng
  29. % global CSrearchRange
  30. userIndx=(get(source,'value'))
  31. userStr=(get(source,'string'))
  32. % scLstIndx=str2num(char(strrep(userStr(userIndx), 'Scan', '')))
  33. user_entry=userStr(userIndx)
  34. exDlst=user_entry
  35. end
  36. exFs
  37. btnNumber=10;
  38. yPos=0.85-(btnNumber-1)*(btnHt+spacing);
  39. btnPos=[xPos yPos-spacing btnWid btnHt];
  40. hedit8=uicontrol(...
  41. 'Style', 'pushbutton',...
  42. 'String',{'Continue'},...
  43. 'Units','normalized',...
  44. 'Position', btnPos,...
  45. 'callback','uiresume(gcbf)');
  46. uiwait(gcf);
  47. close(f)
  48. end
  49. % EZmultiDay