0001 function varargout = prt_ui_sure(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 gui_Singleton = 1;
0029 gui_State = struct('gui_Name', mfilename, ...
0030 'gui_Singleton', gui_Singleton, ...
0031 'gui_OpeningFcn', @prt_ui_sure_OpeningFcn, ...
0032 'gui_OutputFcn', @prt_ui_sure_OutputFcn, ...
0033 'gui_LayoutFcn', [] , ...
0034 'gui_Callback', []);
0035 if nargin && ischar(varargin{1})
0036 gui_State.gui_Callback = str2func(varargin{1});
0037 end
0038
0039 if nargout
0040 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0041 else
0042 gui_mainfcn(gui_State, varargin{:});
0043 end
0044
0045
0046
0047
0048 function prt_ui_sure_OpeningFcn(hObject, eventdata, handles, varargin)
0049
0050
0051
0052
0053
0054
0055
0056 handles.output = hObject;
0057 Tag='continue_input';
0058 F = findall(allchild(0),'Flat','Tag',Tag);
0059 if length(F) > 1
0060
0061 close(F(2:end))
0062 F = F(1);
0063 uistack(F,'top')
0064 elseif length(F)==1
0065 uistack(F,'top')
0066 else
0067 set(handles.figure1,'Tag',Tag)
0068
0069
0070 S0= spm('WinSize','0',1);
0071 if ispc
0072 PF='MS Sans Serif';
0073 else
0074 PF= spm_platform('fonts');
0075 PF=PF.helvetica;
0076 end
0077 tmp = [S0(3)/1280 (S0(4))/800];
0078 ratio=min(tmp)*[1 1 1 1];
0079 FS = 1 + 0.85*(min(ratio)-1);
0080 x=get(handles.figure1,'Position');
0081 set(handles.figure1,'DefaultTextFontSize',FS*12,...
0082 'DefaultUicontrolFontSize',FS*12,...
0083 'DefaultTextFontName',PF,...
0084 'DefaultAxesFontName',PF,...
0085 'DefaultUicontrolFontName',PF)
0086 set(handles.figure1,'Position',ratio.*x)
0087 set(handles.figure1,'Resize','on')
0088
0089
0090 color=prt_get_defaults('color');
0091 set(handles.figure1,'Color',color.bg1)
0092 aa=get(handles.figure1,'children');
0093 for i=1:length(aa)
0094 if strcmpi(get(aa(i),'type'),'uipanel')
0095 set(aa(i),'BackgroundColor',color.bg2)
0096 bb=get(aa(i),'children');
0097 if ~isempty(bb)
0098 for j=1:length(bb)
0099 if ~isempty(find(strcmpi(get(bb(j),'Style'),{'text',...
0100 'radiobutton','checkbox'})))
0101 set(bb(j),'BackgroundColor',color.bg2)
0102 elseif ~isempty(find(strcmpi(get(bb(j),'Style'),'pushbutton')))
0103 set(bb(j),'BackgroundColor',color.fr)
0104 end
0105 set(bb(j),'FontUnits','pixel')
0106 xf=get(bb(j),'FontSize');
0107 set(bb(j),'FontSize',ceil(FS*xf),'FontName',PF,...
0108 'FontUnits','normalized','Units','normalized')
0109 end
0110 end
0111 elseif strcmpi(get(aa(i),'type'),'uicontrol')
0112 if ~isempty(find(strcmpi(get(aa(i),'Style'),{'text',...
0113 'radiobutton','checkbox','listbox'})))
0114 set(aa(i),'BackgroundColor',color.bg1)
0115 elseif ~isempty(find(strcmpi(get(aa(i),'Style'),'pushbutton')))
0116 set(aa(i),'BackgroundColor',color.fr)
0117 end
0118 end
0119 set(aa(i),'FontUnits','pixel')
0120 xf=get(aa(i),'FontSize');
0121 set(aa(i),'FontSize',ceil(FS*xf),'FontName',PF,...
0122 'Units','normalized')
0123 end
0124
0125
0126
0127 handles.output = 0;
0128
0129
0130 guidata(hObject, handles);
0131
0132
0133 end
0134
0135 guidata(hObject, handles);
0136
0137
0138 uiwait(handles.figure1);
0139
0140
0141
0142
0143
0144
0145 function varargout = prt_ui_sure_OutputFcn(hObject, eventdata, handles)
0146
0147
0148
0149
0150
0151
0152 if isfield(handles,'output') && ~isempty(handles.output)
0153 varargout{1} = handles.output;
0154 else
0155 varargout{1}=[];
0156 end
0157
0158
0159 if isfield(handles,'figure1')
0160 delete(handles.figure1);
0161 end
0162
0163
0164
0165 function yesbutt_Callback(hObject, eventdata, handles)
0166
0167
0168
0169 handles.output = 1;
0170
0171
0172 guidata(hObject, handles);
0173 uiresume(handles.figure1);
0174
0175
0176 function nobutt_Callback(hObject, eventdata, handles)
0177
0178
0179
0180 handles.output =0;
0181
0182
0183 guidata(hObject, handles);
0184 uiresume(handles.figure1);