/
Test_Type_Input_Window.m
92 lines (82 loc) · 3.25 KB
/
Test_Type_Input_Window.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
function Test_Type_Input_Window(name, ...
sbjNumber, gender, birthday, expDate, ...
experimenter, coder1, coder2, studyName, ...
condition, numLabels, MaxHabTimeOn, ...
MinHabTimeOn, LookAwayHab, minHabTrial, maxHabTrial, age, ...
MaxSumOfHabTrial, MinSumOfHabTrial, fixedHabituation, ...
fixedHabituationTime, maxTestTimeOn, ...
minTestTimeOn, lookAwayTest, maxTestTrial, ...
maxSumOfTestTrial)
Screen('Preference', 'SkipSyncTests', 1);
screenSize = get(0, 'ScreenSize');
width = round(screenSize(3) * 0.9);
height = round(screenSize(4) * 0.85);
y = (screenSize(4) - height)/2;
x = (screenSize(3) - width)/2;
trialTypeWin = figure('Name', 'Habituation Paradigm', ...
'Position', [x y width height], ...
'MenuBar', 'none', 'ToolBar', 'none', 'Color', [0.9 0.9 0.9]);
figure(trialTypeWin);
parentColor = get(trialTypeWin, 'Color');
labelW = (width - 50) / 4;
if (labelW > 280)
labelW = 280;
end
labelH = floor((height - 70 - 13 * 5)/13);
uiFontSize = 16;
eventInputs={};
i=1;
y = height - 65;
left = 10;
x = labelW+20;
while(i<=numLabels)
%draw input
uicontrol( ...
'Parent', trialTypeWin, ...
'Style', 'text', ...
'String', ['Trial Label ' num2str(i)], ...
'Position', [left y labelW labelH], ...
'backgroundcolor', parentColor,...
'HorizontalAlignment','left', ...
'FontSize', uiFontSize, ...
'FontUnits', 'pixels');
eventInputs{i} = uicontrol(...
'Parent', trialTypeWin, ...
'Style', 'edit', ...
'Position', [x y+10 labelW labelH], ...
'backgroundcolor', parentColor, ...
'String', '', ...
'FontSize', uiFontSize);
y = y - labelH - 5;
if(i==10)
%change what x is
left = round(width/2)+10;
x = labelW+10+left;
y = height - 65;
end
i = 1+i;
end
buttonY = height - 65 - labelH*10 - 100;
buttonX = (width - (labelW*2 + 10)) /2;
uicontrol('Parent', trialTypeWin, ...
'Style', 'pushbutton', ...
'String', 'Start', ...
'FontSize', uiFontSize, ...
'Position', [buttonX buttonY labelW labelH], ...
'callback', @(src,event)Test_Type_Window_Submitted(name, ...
sbjNumber, gender, birthday, expDate, ...
experimenter, coder1, coder2, studyName, ...
condition, eventInputs, MaxHabTimeOn, ...
MinHabTimeOn, LookAwayHab, minHabTrial, maxHabTrial, age, ...
MaxSumOfHabTrial, MinSumOfHabTrial, fixedHabituation, ...
fixedHabituationTime, maxTestTimeOn, ...
minTestTimeOn, lookAwayTest, maxTestTrial, ...
maxSumOfTestTrial));
buttonX = buttonX + labelW + 10;
uicontrol('Parent', trialTypeWin', ...
'Style', 'pushbutton', ...
'String', 'Close', ...
'FontSize', uiFontSize, ...
'Position', [buttonX buttonY labelW labelH], ...
'callback', @(src,event)Close_Button_Pressed(src,event, trialTypeWin));
end