ADVANCED M-file for advanced.fig ADVANCED, by itself, creates a new ADVANCED or raises the existing singleton*. H = ADVANCED returns the handle to a new ADVANCED or the handle to the existing singleton*. ADVANCED('CALLBACK',hObject,eventData,handles,...) calls the local function named ADVANCED in ADVANCED.M with the given input arguments. ADVANCED('Property','Value',...) creates a new ADVANCED or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before advanced_OpeningFunction gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to advanced_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". Code construction assisted by GUIDE GENERAL Omitted. INPUT/S - OUTPUT/S - PENDING WORK - KNOWN BUG/S - COMMENT/S - RELATED FUNCTION/S ABOUT -Created: February 12th, 2004 -Last update: -Revision: 0.0.9 -Author: R. S. Schestowitz, University of Manchester ==============================================================
0001 function varargout = advanced(varargin) 0002 % ADVANCED M-file for advanced.fig 0003 % ADVANCED, by itself, creates a new ADVANCED or raises the existing 0004 % singleton*. 0005 % 0006 % H = ADVANCED returns the handle to a new ADVANCED or the handle to 0007 % the existing singleton*. 0008 % 0009 % ADVANCED('CALLBACK',hObject,eventData,handles,...) calls the local 0010 % function named ADVANCED in ADVANCED.M with the given input arguments. 0011 % 0012 % ADVANCED('Property','Value',...) creates a new ADVANCED or raises the 0013 % existing singleton*. Starting from the left, property value pairs are 0014 % applied to the GUI before advanced_OpeningFunction gets called. An 0015 % unrecognized property name or invalid value makes property application 0016 % stop. All inputs are passed to advanced_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 % Code construction assisted by GUIDE 0022 % 0023 % GENERAL 0024 % 0025 % Omitted. 0026 % 0027 % INPUT/S 0028 % 0029 % - 0030 % 0031 % 0032 % OUTPUT/S 0033 % 0034 % - 0035 % 0036 % PENDING WORK 0037 % 0038 % - 0039 % 0040 % KNOWN BUG/S 0041 % 0042 % - 0043 % 0044 % COMMENT/S 0045 % 0046 % - 0047 % 0048 % RELATED FUNCTION/S 0049 % 0050 % 0051 % 0052 % ABOUT 0053 % 0054 % -Created: February 12th, 2004 0055 % -Last update: 0056 % -Revision: 0.0.9 0057 % -Author: R. S. Schestowitz, University of Manchester 0058 % ============================================================== 0059 0060 % Edit the above text to modify the response to help_button register 0061 0062 % Last Modified by GUIDE v2.5 23-Mar-2004 07:42:43 0063 0064 % Begin initialization code - DO NOT EDIT 0065 gui_Singleton = 1; 0066 gui_State = struct('gui_Name', mfilename, ... 0067 'gui_Singleton', gui_Singleton, ... 0068 'gui_OpeningFcn', @advanced_OpeningFcn, ... 0069 'gui_OutputFcn', @advanced_OutputFcn, ... 0070 'gui_LayoutFcn', [] , ... 0071 'gui_Callback', []); 0072 if nargin & isstr(varargin{1}) 0073 gui_State.gui_Callback = str2func(varargin{1}); 0074 end 0075 0076 if nargout 0077 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 0078 else 0079 gui_mainfcn(gui_State, varargin{:}); 0080 end 0081 % End initialization code - DO NOT EDIT 0082 0083 % --- Executes just before register is made visible. 0084 function advanced_OpeningFcn(hObject, eventdata, handles, varargin) 0085 % This function has no output args, see OutputFcn. 0086 % hObject handle to figure 0087 % eventdata reserved - to be defined in a future version of MATLAB 0088 % handles structure with handles and user data (see GUIDATA) 0089 % varargin command line arguments to register (see VARARGIN) 0090 0091 % Choose default command line output for register 0092 handles.output = hObject; 0093 0094 % Update handles structure 0095 guidata(hObject, handles); 0096 0097 if strcmp(get(hObject,'Visible'),'off') 0098 initialize_gui(hObject, handles); 0099 end 0100 0101 % UIWAIT makes register pause for user response (see UIRESUME) 0102 % uiwait(handles.Advanced_window); 0103 0104 0105 % --- Outputs from this function are returned to the command line. 0106 function varargout = advanced_OutputFcn(hObject, eventdata, handles) 0107 % varargout cell array for returning output args (see VARARGOUT); 0108 % hObject handle to figure 0109 % eventdata reserved - to be defined in a future version of MATLAB 0110 % handles structure with handles and user data (see GUIDATA) 0111 0112 % Get default command line output from handles structure 0113 varargout{1} = handles.output; 0114 0115 0116 0117 function initialize_gui(fig_handle, handles) 0118 0119 set(handles.number_of_modes_number, 'String', getappdata(0, 'number_of_modes')); 0120 set(handles.number_of_modes_slider, 'Value', str2num(get(handles.number_of_modes_number, 'String'))); 0121 0122 set(handles.std_number, 'String', getappdata(0, 'std')); 0123 set(handles.std_slider, 'Value', str2num(get(handles.std_number, 'String'))); 0124 0125 set(handles.exit_flag, 'String', getappdata(0, 'exit_handle')); 0126 set(handles.exit_option_button, 'Value', str2num(getappdata(0, 'exit_handle'))); 0127 0128 set(handles.close_flag, 'String', getappdata(0, 'close_handle')); 0129 set(handles.close_button, 'Value', str2num(getappdata(0, 'close_handle'))); 0130 0131 set(handles.show_score_figures_flag, 'String', getappdata(0, 'show_score_figures')); 0132 set(handles.show_score_figures, 'Value', str2num(getappdata(0, 'show_score_figures'))); 0133 0134 set(handles.show_score_flag, 'String', getappdata(0, 'show_score_bar')); 0135 set(handles.show_score_bar_button, 'Value', str2num(getappdata(0, 'show_score_bar'))); 0136 0137 0138 background = imread('background.jpg'); 0139 0140 axes(handles.background); 0141 axis off; 0142 imshow(background,[0,255]); 0143 0144 % --- Executes on button press in ok_botton. 0145 function ok_botton_Callback(hObject, eventdata, handles) 0146 % hObject handle to ok_botton (see GCBO) 0147 % eventdata reserved - to be defined in a future version of MATLAB 0148 % handles structure with handles and user data (see GUIDATA) 0149 0150 setappdata(0, 'show_score_figures', get(handles.show_score_figures_flag, 'String')); 0151 setappdata(0, 'exit_handle', get(handles.exit_flag, 'String')); 0152 setappdata(0, 'close_handle', get(handles.close_flag, 'String')); 0153 setappdata(0, 'show_score_bar', get(handles.show_score_flag, 'String')); 0154 setappdata(0, 'number_of_modes', get(handles.number_of_modes_number, 'String')); 0155 setappdata(0, 'std', get(handles.std_number, 'String')); 0156 close; 0157 0158 0159 % --- Executes on button press in exit_option_button. 0160 function exit_option_button_Callback(hObject, eventdata, handles) 0161 % hObject handle to exit_option_button (see GCBO) 0162 % eventdata reserved - to be defined in a future version of MATLAB 0163 % handles structure with handles and user data (see GUIDATA) 0164 0165 % Hint: get(hObject,'Value') returns toggle state of exit_option_button 0166 0167 0168 if (get(handles.exit_option_button, 'Value') == 0), 0169 set(handles.exit_flag, 'String', '0'); 0170 else 0171 set(handles.exit_option_button, 'Value', 1); 0172 set(handles.exit_flag, 'String', '1'); 0173 end 0174 0175 0176 % --- Executes on button press in cancel_button. 0177 function cancel_button_Callback(hObject, eventdata, handles) 0178 % hObject handle to cancel_button (see GCBO) 0179 % eventdata reserved - to be defined in a future version of MATLAB 0180 % handles structure with handles and user data (see GUIDATA) 0181 close; 0182 0183 % --- Executes on button press in apply_button. 0184 function apply_button_Callback(hObject, eventdata, handles) 0185 % hObject handle to apply_button (see GCBO) 0186 % eventdata reserved - to be defined in a future version of MATLAB 0187 % handles structure with handles and user data (see GUIDATA) 0188 0189 setappdata(0, 'exit_handle', get(handles.exit_flag, 'String')); 0190 setappdata(0, 'show_score_figures', get(handles.show_score_figures_flag, 'String')); 0191 setappdata(0, 'close_handle', get(handles.close_flag, 'String')); 0192 setappdata(0, 'show_score_bar', get(handles.show_score_flag, 'String')); 0193 setappdata(0, 'number_of_modes', get(handles.number_of_modes_number, 'String')); 0194 setappdata(0, 'std', get(handles.std_number, 'String')); 0195 0196 % --- Executes on button press in show_score_figures. 0197 function show_score_figures_Callback(hObject, eventdata, handles) 0198 % hObject handle to show_score_figures (see GCBO) 0199 % eventdata reserved - to be defined in a future version of MATLAB 0200 % handles structure with handles and user data (see GUIDATA) 0201 0202 % Hint: get(hObject,'Value') returns toggle state of show_score_figures 0203 0204 if (get(handles.show_score_figures, 'Value') == 0), 0205 set(handles.show_score_figures_flag, 'String', '0'); 0206 else 0207 set(handles.show_score_figures, 'Value', 1); 0208 set(handles.show_score_figures_flag, 'String', '1'); 0209 end 0210 0211 % --- Executes on button press in close_button. 0212 function close_button_Callback(hObject, eventdata, handles) 0213 % hObject handle to close_button (see GCBO) 0214 % eventdata reserved - to be defined in a future version of MATLAB 0215 % handles structure with handles and user data (see GUIDATA) 0216 0217 % Hint: get(hObject,'Value') returns toggle state of close_button 0218 if (get(handles.close_button, 'Value') == 0), 0219 set(handles.close_flag, 'String', '0'); 0220 else 0221 set(handles.close_button, 'Value', 1); 0222 set(handles.close_flag, 'String', '1'); 0223 end 0224 0225 0226 % --- Executes on button press in show_score_bar_button. 0227 function show_score_bar_button_Callback(hObject, eventdata, handles) 0228 % hObject handle to show_score_bar_button (see GCBO) 0229 % eventdata reserved - to be defined in a future version of MATLAB 0230 % handles structure with handles and user data (see GUIDATA) 0231 0232 % Hint: get(hObject,'Value') returns toggle state of show_score_bar_button 0233 0234 if (get(handles.show_score_bar_button, 'Value') == 0), 0235 set(handles.show_score_flag, 'String', '0'); 0236 else 0237 set(handles.show_score_bar_button, 'Value', 1); 0238 set(handles.show_score_flag, 'String', '1'); 0239 end 0240 0241 0242 % --- Executes during object creation, after setting all properties. 0243 function number_of_modes_slider_CreateFcn(hObject, eventdata, handles) 0244 % hObject handle to number_of_modes_slider (see GCBO) 0245 % eventdata reserved - to be defined in a future version of MATLAB 0246 % handles empty - handles not created until after all CreateFcns called 0247 0248 % Hint: slider controls usually have a light gray background, change 0249 % 'usewhitebg' to 0 to use default. See ISPC and COMPUTER. 0250 usewhitebg = 1; 0251 if usewhitebg 0252 set(hObject,'BackgroundColor',[.9 .9 .9]); 0253 else 0254 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); 0255 end 0256 0257 0258 % --- Executes on slider movement. 0259 function number_of_modes_slider_Callback(hObject, eventdata, handles) 0260 % hObject handle to number_of_modes_slider (see GCBO) 0261 % eventdata reserved - to be defined in a future version of MATLAB 0262 % handles structure with handles and user data (see GUIDATA) 0263 0264 % Hints: get(hObject,'Value') returns position of slider 0265 % get(hObject,'Min') and get(hObject,'Max') to determine range of slider 0266 0267 set(handles.number_of_modes_number, 'String', num2str(ceil(get(handles.number_of_modes_slider, 'Value')))); 0268 0269 % --- Executes during object creation, after setting all properties. 0270 function std_slider_CreateFcn(hObject, eventdata, handles) 0271 % hObject handle to std_slider (see GCBO) 0272 % eventdata reserved - to be defined in a future version of MATLAB 0273 % handles empty - handles not created until after all CreateFcns called 0274 0275 % Hint: slider controls usually have a light gray background, change 0276 % 'usewhitebg' to 0 to use default. See ISPC and COMPUTER. 0277 usewhitebg = 1; 0278 if usewhitebg 0279 set(hObject,'BackgroundColor',[.9 .9 .9]); 0280 else 0281 set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); 0282 end 0283 0284 0285 % --- Executes on slider movement. 0286 function std_slider_Callback(hObject, eventdata, handles) 0287 % hObject handle to std_slider (see GCBO) 0288 % eventdata reserved - to be defined in a future version of MATLAB 0289 % handles structure with handles and user data (see GUIDATA) 0290 0291 % Hints: get(hObject,'Value') returns position of slider 0292 % get(hObject,'Min') and get(hObject,'Max') to determine range of slider 0293 0294 set(handles.std_number, 'String', num2str(ceil(get(handles.std_slider, 'Value')))); 0295 0296 0297 % --- Executes on button press in pushbutton19. 0298 function pushbutton19_Callback(hObject, eventdata, handles) 0299 % hObject handle to pushbutton19 (see GCBO) 0300 % eventdata reserved - to be defined in a future version of MATLAB 0301 % handles structure with handles and user data (see GUIDATA) 0302 0303 0304 % --- Executes on button press in pushbutton20. 0305 function pushbutton20_Callback(hObject, eventdata, handles) 0306 % hObject handle to pushbutton20 (see GCBO) 0307 % eventdata reserved - to be defined in a future version of MATLAB 0308 % handles structure with handles and user data (see GUIDATA) 0309 0310