Home > . > prt_ui_sure.m

prt_ui_sure

PURPOSE ^

PRT_UI_SURE M-file for prt_ui_sure.fig

SYNOPSIS ^

function varargout = prt_ui_sure(varargin)

DESCRIPTION ^

 PRT_UI_SURE M-file for prt_ui_sure.fig
      PRT_UI_SURE, by itself, creates a new PRT_UI_SURE or raises the existing
      singleton*.

      H = PRT_UI_SURE returns the handle to a new PRT_UI_SURE or the handle to
      the existing singleton*.

      PRT_UI_SURE('CALLBACK',hObject,eventData,handles,...) calls the local
      function named CALLBACK in PRT_UI_SURE.M with the given input arguments.

      PRT_UI_SURE('Property','Value',...) creates a new PRT_UI_SURE or raises the
      existing singleton*.  Starting from the left, property value pairs are
      applied to the GUI before prt_ui_sure_OpeningFcn gets called.  An
      unrecognized property name or invalid value makes property application
      stop.  All inputs are passed to prt_ui_sure_OpeningFcn via varargin.

      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
      instance to run (singleton)".

 See also: GUIDE, GUIDATA, GUIHANDLES

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function varargout = prt_ui_sure(varargin)
0002 % PRT_UI_SURE M-file for prt_ui_sure.fig
0003 %      PRT_UI_SURE, by itself, creates a new PRT_UI_SURE or raises the existing
0004 %      singleton*.
0005 %
0006 %      H = PRT_UI_SURE returns the handle to a new PRT_UI_SURE or the handle to
0007 %      the existing singleton*.
0008 %
0009 %      PRT_UI_SURE('CALLBACK',hObject,eventData,handles,...) calls the local
0010 %      function named CALLBACK in PRT_UI_SURE.M with the given input arguments.
0011 %
0012 %      PRT_UI_SURE('Property','Value',...) creates a new PRT_UI_SURE or raises the
0013 %      existing singleton*.  Starting from the left, property value pairs are
0014 %      applied to the GUI before prt_ui_sure_OpeningFcn gets called.  An
0015 %      unrecognized property name or invalid value makes property application
0016 %      stop.  All inputs are passed to prt_ui_sure_OpeningFcn via varargin.
0017 %
0018 %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
0019 %      instance to run (singleton)".
0020 %
0021 % See also: GUIDE, GUIDATA, GUIHANDLES
0022 
0023 % Edit the above text to modify the response to help prt_ui_sure
0024 
0025 % Last Modified by GUIDE v2.5 16-May-2012 14:33:00
0026 
0027 % Begin initialization code - DO NOT EDIT
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 % End initialization code - DO NOT EDIT
0045 
0046 
0047 % --- Executes just before prt_ui_sure is made visible.
0048 function prt_ui_sure_OpeningFcn(hObject, eventdata, handles, varargin)
0049 % This function has no output args, see OutputFcn.
0050 % hObject    handle to figure
0051 % eventdata  reserved - to be defined in a future version of MATLAB
0052 % handles    structure with handles and user data (see GUIDATA)
0053 % varargin   command line arguments to prt_ui_sure (see VARARGIN)
0054 
0055 % Choose default command line output for prt_ui_sure
0056 handles.output = hObject;
0057 Tag='continue_input';
0058 F = findall(allchild(0),'Flat','Tag',Tag);
0059 if length(F) > 1
0060     % Multiple Graphics windows - close all but most recent
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 %set size of the window, taking screen resolution and platform into account
0070 S0= spm('WinSize','0',1);   %-Screen size (of the current monitor)
0071 if ispc
0072     PF='MS Sans Serif';
0073 else
0074     PF= spm_platform('fonts');     %-Font names (for this platform)
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);  %factor to scale the fonts
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 % Choose the color of the different backgrounds and figure parameters
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     if ispc
0122         set(aa(i),'FontSize',ceil(FS*xf),'FontName',PF,...
0123             'FontUnits','normalized','Units','normalized')
0124     else
0125         set(aa(i),'FontSize',ceil(FS*xf),'FontName',PF,...
0126             'Units','normalized')
0127     end
0128 end
0129 
0130 
0131 % Choose default command line output for prt_text_input
0132 handles.output = 0;
0133 
0134 % Update handles structure
0135 guidata(hObject, handles);
0136 
0137 
0138 end
0139 % Update handles structure
0140 guidata(hObject, handles);
0141 
0142 %UIWAIT makes prt_text_input wait for user response (see UIRESUME)
0143 uiwait(handles.figure1);
0144 
0145 % UIWAIT makes prt_ui_sure wait for user response (see UIRESUME)
0146 % uiwait(handles.figure1);
0147 
0148 
0149 % --- Outputs from this function are returned to the command line.
0150 function varargout = prt_ui_sure_OutputFcn(hObject, eventdata, handles) 
0151 % varargout  cell array for returning output args (see VARARGOUT);
0152 % hObject    handle to figure
0153 % eventdata  reserved - to be defined in a future version of MATLAB
0154 % handles    structure with handles and user data (see GUIDATA)
0155 
0156 % Get default command line output from handles structure
0157 if isfield(handles,'output') && ~isempty(handles.output)
0158     varargout{1} = handles.output;
0159 else
0160     varargout{1}=[];
0161 end
0162 
0163 % The figure can be deleted now
0164 if isfield(handles,'figure1')
0165     delete(handles.figure1);
0166 end
0167 
0168 
0169 % --- Executes on button press in yesbutt.
0170 function yesbutt_Callback(hObject, eventdata, handles)
0171 % hObject    handle to yesbutt (see GCBO)
0172 % eventdata  reserved - to be defined in a future version of MATLAB
0173 % handles    structure with handles and user data (see GUIDATA)
0174 handles.output = 1;
0175 
0176 % Update handles structure
0177 guidata(hObject, handles);
0178 uiresume(handles.figure1);
0179 
0180 % --- Executes on button press in nobutt.
0181 function nobutt_Callback(hObject, eventdata, handles)
0182 % hObject    handle to nobutt (see GCBO)
0183 % eventdata  reserved - to be defined in a future version of MATLAB
0184 % handles    structure with handles and user data (see GUIDATA)
0185 handles.output =0;
0186 
0187 % Update handles structure
0188 guidata(hObject, handles);
0189 uiresume(handles.figure1);

Generated on Sun 20-May-2012 13:24:48 by m2html © 2005