-
Notifications
You must be signed in to change notification settings - Fork 7
/
gui_s.m
177 lines (146 loc) · 4.9 KB
/
gui_s.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
function gui_s (x, y)
%
% This file is used by FASTICAG
% The save dialog for saving the results
% @(#)$Id: gui_s.m,v 1.4 2004/07/27 13:09:26 jarmo Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Global variables
% Handle to the window
global hf_FastICA_Save;
% Handles to some of the controls in window
global he_FastICA_suffix;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Configuration options
FIGURENAME = 'FastICA: Save results';
FIGURETAG = 'f_FastICASave';
FIGURESIZE = [x y 450 150];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Check to see if this figure is already open - it should not!
% Can't have more than one copy - otherwise the global
% variables and handles can get mixed up.
if ~isempty(findobj('Tag',FIGURETAG))
error('Error: load dialog already open!');
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Initialize some of the controls' values
saveString = 'Save results as variables in MATLAB workspace.';
promptString = 'Suffix to identify the results:';
helpString = 'If you give e.g. ''_FastICA'', the variables will be called A_FastICA, W_FastICA, etc.';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create the figure
a = figure('Color',[0.8 0.8 0.8], ...
'PaperType','a4letter', ...
'Name', FIGURENAME, ...
'NumberTitle', 'off', ...
'Tag', FIGURETAG, ...
'Position', FIGURESIZE, ...
'MenuBar', 'none');
set (a, 'Resize', 'off');
hf_FastICA_Save = a;
set(hf_FastICA_Save, 'HandleVisibility', 'callback');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% From here on it get's ugly as I have not had time to clean it up
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create the frames
pos_l=2;
pos_w=FIGURESIZE(3)-4;
pos_h=FIGURESIZE(4)-4;
pos_t=2;
h_f_save_background = uicontrol('Parent',a, ...
'BackgroundColor',[0.701961 0.701961 0.701961], ...
'Position',[pos_l pos_t pos_w pos_h], ...
'Style','frame', ...
'Tag','f_save_background');
pos_w=120;
pos_l=FIGURESIZE(3)-(pos_w+2+2);
pos_h=FIGURESIZE(4)-2*4;
pos_t=4;
h_f_save_side = uicontrol('Parent',a, ...
'BackgroundColor',[0.701961 0.701961 0.701961], ...
'Position',[pos_l pos_t pos_w pos_h], ...
'Style','frame', ...
'Tag','f_save_side');
pos_l=4;
pos_w=FIGURESIZE(3)-8-pos_w-2;
pos_h=FIGURESIZE(4)-8;
pos_t=4;
h_f_save = uicontrol('Parent',a, ...
'BackgroundColor',[0.701961 0.701961 0.701961], ...
'Position',[pos_l pos_t pos_w pos_h], ...
'Style','frame', ...
'Tag','f_save');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Controls in f_save
bgc = get(h_f_save, 'BackgroundColor');
pos_w=230;
pos_frame=get(h_f_save, 'Position');
pos_h = 40;
pos_t = pos_frame(2) + pos_frame(4) - pos_h - 6;
pos_l = pos_frame(1) + 6;
b = uicontrol('Parent',a, ...
'BackgroundColor',bgc, ...
'HorizontalAlignment','left', ...
'Position',[pos_l pos_t pos_w pos_h], ...
'String',saveString, ...
'Style','text', ...
'Tag','t_93');
pos_h = 20;
pos_t = pos_t - pos_h - 10;
pos_l = pos_frame(1) + 6;
b = uicontrol('Parent',a, ...
'BackgroundColor',bgc, ...
'HorizontalAlignment','left', ...
'Position',[pos_l pos_t pos_w pos_h], ...
'String',promptString, ...
'Style','text', ...
'Tag','t_92');
pos_w = 200;
pos_l = pos_l + 30;
pos_t = pos_t - pos_h;
he_FastICA_suffix = uicontrol('Parent',a, ...
'BackgroundColor',[1 1 1], ...
'HorizontalAlignment','left', ...
'Position',[pos_l pos_t pos_w pos_h], ...
'String','', ...
'Style','edit', ...
'Tag','e_suffix');
pos_w = pos_frame(3) - 12;
pos_h = 30;
pos_t = pos_frame(2) + 6;
pos_l = pos_frame(1) + 6;
b = uicontrol('Parent',a, ...
'BackgroundColor',bgc, ...
'HorizontalAlignment','left', ...
'Position',[pos_l pos_t pos_w pos_h], ...
'String',helpString, ...
'Style','text', ...
'Tag','t_97');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Controls in f_save_side
pos_vspace = 6;
pos_hspace = 10;
pos_frame = get(h_f_save_side, 'Position');
pos_w = 100;
pos_h = 30;
pos_l = pos_frame(1) + pos_hspace;
pos_t = pos_frame(2) + pos_frame(4) - pos_h - pos_vspace;
b = uicontrol('Parent',a, ...
'BackgroundColor',[0.701961 0.701961 0.701961], ...
'Callback','gui_sc Save', ...
'Position',[pos_l pos_t pos_w pos_h], ...
'String','Save', ...
'Tag','b_sSave');
pos_t=pos_t-pos_h-pos_vspace;
b = uicontrol('Parent',a, ...
'BackgroundColor',[0.701961 0.701961 0.701961], ...
'Callback','gui_sc Cancel', ...
'Position',[pos_l pos_t pos_w pos_h], ...
'String','Cancel', ...
'Tag','b_sCancel');
pos_t = pos_frame(2) + pos_vspace;
b = uicontrol('Parent',a, ...
'BackgroundColor',[0.701961 0.701961 0.701961], ...
'Callback','gui_sc Help', ...
'Position',[pos_l pos_t pos_w pos_h], ...
'String','Help', ...
'Tag','b_sHelp');