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         set(aa(i),'FontSize',ceil(FS*xf),'FontName',PF,...
0122             'Units','normalized')
0123     end
0124 
0125 
0126 % Choose default command line output for prt_text_input
0127 handles.output = 0;
0128 
0129 % Update handles structure
0130 guidata(hObject, handles);
0131 
0132 
0133 end
0134 % Update handles structure
0135 guidata(hObject, handles);
0136 
0137 %UIWAIT makes prt_text_input wait for user response (see UIRESUME)
0138 uiwait(handles.figure1);
0139 
0140 % UIWAIT makes prt_ui_sure wait for user response (see UIRESUME)
0141 % uiwait(handles.figure1);
0142 
0143 
0144 % --- Outputs from this function are returned to the command line.
0145 function varargout = prt_ui_sure_OutputFcn(hObject, eventdata, handles) 
0146 % varargout  cell array for returning output args (see VARARGOUT);
0147 % hObject    handle to figure
0148 % eventdata  reserved - to be defined in a future version of MATLAB
0149 % handles    structure with handles and user data (see GUIDATA)
0150 
0151 % Get default command line output from handles structure
0152 if isfield(handles,'output') && ~isempty(handles.output)
0153     varargout{1} = handles.output;
0154 else
0155     varargout{1}=[];
0156 end
0157 
0158 % The figure can be deleted now
0159 if isfield(handles,'figure1')
0160     delete(handles.figure1);
0161 end
0162 
0163 
0164 % --- Executes on button press in yesbutt.
0165 function yesbutt_Callback(hObject, eventdata, handles)
0166 % hObject    handle to yesbutt (see GCBO)
0167 % eventdata  reserved - to be defined in a future version of MATLAB
0168 % handles    structure with handles and user data (see GUIDATA)
0169 handles.output = 1;
0170 
0171 % Update handles structure
0172 guidata(hObject, handles);
0173 uiresume(handles.figure1);
0174 
0175 % --- Executes on button press in nobutt.
0176 function nobutt_Callback(hObject, eventdata, handles)
0177 % hObject    handle to nobutt (see GCBO)
0178 % eventdata  reserved - to be defined in a future version of MATLAB
0179 % handles    structure with handles and user data (see GUIDATA)
0180 handles.output =0;
0181 
0182 % Update handles structure
0183 guidata(hObject, handles);
0184 uiresume(handles.figure1);

Generated on Tue 10-Feb-2015 18:16:33 by m2html © 2005