- create hard bound constraint dialog copyright 2009-2012 Blair Armstrong, Christine Watson, David Plaut This file is part of SOS SOS is free software: you can redistribute it and/or modify it for academic and non-commercial purposes under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. For commercial or for-profit uses, please contact the authors (sos@cnbc.cmu.edu). SOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
0001 % - create hard bound constraint dialog 0002 % 0003 % copyright 2009-2012 Blair Armstrong, Christine Watson, David Plaut 0004 % 0005 % This file is part of SOS 0006 % 0007 % SOS is free software: you can redistribute it and/or modify 0008 % it for academic and non-commercial purposes 0009 % under the terms of the GNU General Public License as published by 0010 % the Free Software Foundation, either version 3 of the License, or 0011 % (at your option) any later version. For commercial or for-profit 0012 % uses, please contact the authors (sos@cnbc.cmu.edu). 0013 % 0014 % SOS is distributed in the hope that it will be useful, 0015 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0016 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0017 % GNU General Public License for more details. 0018 0019 % You should have received a copy of the GNU General Public License 0020 % along with SOS (see COPYING.txt). 0021 % If not, see <http://www.gnu.org/licenses/>. 0022 0023 0024 0025 0026 function varargout = createHardBoundConstraint_Dialog(varargin) 0027 % CREATEHARDBOUNDCONSTRAINT_DIALOG M-file for createHardBoundConstraint_Dialog.fig 0028 % CREATEHARDBOUNDCONSTRAINT_DIALOG, by itself, creates a new CREATEHARDBOUNDCONSTRAINT_DIALOG or raises the existing 0029 % singleton*. 0030 % 0031 % H = CREATEHARDBOUNDCONSTRAINT_DIALOG returns the handle to a new CREATEHARDBOUNDCONSTRAINT_DIALOG or the handle to 0032 % the existing singleton*. 0033 % 0034 % CREATEHARDBOUNDCONSTRAINT_DIALOG('CALLBACK',hObject,eventData,handles,...) calls the local 0035 % function named CALLBACK in CREATEHARDBOUNDCONSTRAINT_DIALOG.M with the given input arguments. 0036 % 0037 % CREATEHARDBOUNDCONSTRAINT_DIALOG('Property','Value',...) creates a new CREATEHARDBOUNDCONSTRAINT_DIALOG or raises the 0038 % existing singleton*. Starting from the left, property value pairs are 0039 % applied to the GUI before createHardBoundConstraint_Dialog_OpeningFcn gets called. An 0040 % unrecognized property name or invalid value makes property application 0041 % stop. All inputs are passed to createHardBoundConstraint_Dialog_OpeningFcn via varargin. 0042 % 0043 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one 0044 % instance to run (singleton)". 0045 % 0046 % See also: GUIDE, GUIDATA, GUIHANDLES 0047 0048 % Edit the above text to modify the response to help createHardBoundConstraint_Dialog 0049 0050 % Last Modified by GUIDE v2.5 16-Sep-2010 16:12:20 0051 0052 % Begin initialization code - DO NOT EDIT 0053 gui_Singleton = 1; 0054 gui_State = struct('gui_Name', mfilename, ... 0055 'gui_Singleton', gui_Singleton, ... 0056 'gui_OpeningFcn', @createHardBoundConstraint_Dialog_OpeningFcn, ... 0057 'gui_OutputFcn', @createHardBoundConstraint_Dialog_OutputFcn, ... 0058 'gui_LayoutFcn', [] , ... 0059 'gui_Callback', []); 0060 if nargin && ischar(varargin{1}) 0061 gui_State.gui_Callback = str2func(varargin{1}); 0062 end 0063 0064 if nargout 0065 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 0066 else 0067 gui_mainfcn(gui_State, varargin{:}); 0068 end 0069 % End initialization code - DO NOT EDIT 0070 0071 0072 % --- Executes just before createHardBoundConstraint_Dialog is made visible. 0073 function createHardBoundConstraint_Dialog_OpeningFcn(hObject, eventdata, handles, varargin) 0074 % This function has no output args, see OutputFcn. 0075 % hObject handle to figure 0076 % eventdata reserved - to be defined in a future version of MATLAB 0077 % handles structure with handles and user data (see GUIDATA) 0078 % varargin command line arguments to createHardBoundConstraint_Dialog (see VARARGIN) 0079 0080 % Choose default command line output for createHardBoundConstraint_Dialog 0081 handles.output = hObject; 0082 0083 % Update handles structure 0084 guidata(hObject, handles); 0085 0086 % UIWAIT makes createHardBoundConstraint_Dialog wait for user response (see UIRESUME) 0087 % uiwait(handles.figure_createHardBoundConstraint_Dialog); 0088 0089 0090 % --- Outputs from this function are returned to the command line. 0091 function varargout = createHardBoundConstraint_Dialog_OutputFcn(hObject, eventdata, handles) 0092 % varargout cell array for returning output args (see VARARGOUT); 0093 % hObject handle to figure 0094 % eventdata reserved - to be defined in a future version of MATLAB 0095 % handles structure with handles and user data (see GUIDATA) 0096 0097 % Get default command line output from handles structure 0098 varargout{1} = handles.output; 0099 0100 0101 0102 function edit_name_Callback(hObject, eventdata, handles) 0103 % hObject handle to edit_name (see GCBO) 0104 % eventdata reserved - to be defined in a future version of MATLAB 0105 % handles structure with handles and user data (see GUIDATA) 0106 0107 % Hints: get(hObject,'String') returns contents of edit_name as text 0108 % str2double(get(hObject,'String')) returns contents of edit_name as a double 0109 validate_name(handles); 0110 0111 0112 function flag = validate_name(handles) 0113 0114 varName = get(handles.edit_name,'String'); 0115 0116 %check to make sure that the name is a valid variable name: 0117 valid = regexp(varName,'^[a-zA-Z]+\w*$', 'once'); 0118 0119 if isempty(valid) 0120 % name is not currently valid, tell the user. 0121 msgbox('Only letters, numbers, and underscores are permitted in the name of the ttest object. The first character must also be a letter.',... 0122 'Invalid name!'); 0123 flag = false; 0124 else 0125 % check to make sure that the new variable name doesn't already exist. 0126 command = strcat('whos(''',varName,''')'); 0127 varExists = evalin('base',command); 0128 0129 0130 % if a variable with this name already exists, warns the user 0131 if isempty(varExists) == 0 0132 msgbox('A variable with this name already exists and will be overridden if you continue',... 0133 'Variable name already in use!'); 0134 end 0135 0136 flag = true; 0137 end 0138 0139 0140 0141 % --- Executes during object creation, after setting all properties. 0142 function edit_name_CreateFcn(hObject, eventdata, handles) 0143 % hObject handle to edit_name (see GCBO) 0144 % eventdata reserved - to be defined in a future version of MATLAB 0145 % handles empty - handles not created until after all CreateFcns called 0146 0147 % Hint: edit controls usually have a white background on Windows. 0148 % See ISPC and COMPUTER. 0149 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0150 set(hObject,'BackgroundColor','white'); 0151 end 0152 0153 0154 % --- Executes on selection change in popupmenu_sample1Selector. 0155 function popupmenu_sample1Selector_Callback(hObject, eventdata, handles) 0156 % hObject handle to popupmenu_sample1Selector (see GCBO) 0157 % eventdata reserved - to be defined in a future version of MATLAB 0158 % handles structure with handles and user data (see GUIDATA) 0159 0160 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_sample1Selector contents as cell array 0161 % contents{get(hObject,'Value')} returns selected item from popupmenu_sample1Selector 0162 populateSampleList(hObject); 0163 0164 0165 function populateSampleList(hObject) 0166 % get a list of all populations in the base workspace: 0167 vars = evalin('base','whos()'); 0168 0169 samples = []; 0170 for i=1:length(vars) 0171 if strcmp(vars(i).class,'sample') 0172 samples = [samples; {vars(i).name}]; %#ok<AGROW> 0173 end 0174 end 0175 0176 0177 0178 % assign that list to the options in the pop up menu 0179 warning('off','MATLAB:hg:uicontrol:ParameterValuesMustBeValid'); 0180 set(hObject,'String',samples); 0181 0182 % --- Executes during object creation, after setting all properties. 0183 function popupmenu_sample1Selector_CreateFcn(hObject, eventdata, handles) 0184 % hObject handle to popupmenu_sample1Selector (see GCBO) 0185 % eventdata reserved - to be defined in a future version of MATLAB 0186 % handles empty - handles not created until after all CreateFcns called 0187 0188 % Hint: popupmenu controls usually have a white background on Windows. 0189 % See ISPC and COMPUTER. 0190 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0191 set(hObject,'BackgroundColor','white'); 0192 end 0193 0194 0195 % --- Executes on button press in pushbutton_refreshSample1List. 0196 function pushbutton_refreshSample1List_Callback(hObject, eventdata, handles) 0197 % hObject handle to pushbutton_refreshSample1List (see GCBO) 0198 % eventdata reserved - to be defined in a future version of MATLAB 0199 % handles structure with handles and user data (see GUIDATA) 0200 populateSampleList(handles.popupmenu_sample1Selector); 0201 0202 % --- If Enable == 'on', executes on mouse press in 5 pixel border. 0203 % --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu_sample1Selector. 0204 function popupmenu_sample1Selector_ButtonDownFcn(hObject, eventdata, handles) 0205 % hObject handle to popupmenu_sample1Selector (see GCBO) 0206 % eventdata reserved - to be defined in a future version of MATLAB 0207 % handles structure with handles and user data (see GUIDATA) 0208 populateSampleList(hObject); 0209 0210 0211 % --- Executes on selection change in popupmenu_sample1ColSelector. 0212 function popupmenu_sample1ColSelector_Callback(hObject, eventdata, handles) 0213 % hObject handle to popupmenu_sample1ColSelector (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 populateColumnList(hObject,handles.popupmenu_sample1Selector); 0217 0218 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_sample1ColSelector contents as cell array 0219 % contents{get(hObject,'Value')} returns selected item from popupmenu_sample1ColSelector 0220 function populateColumnList(hObject,sampleSelector) 0221 % get a list of all populations in the base workspace: 0222 0223 create = true; 0224 0225 % get the sample in the first list. 0226 sampleMenuHandle = sampleSelector; 0227 sampleName = getdfName(sampleMenuHandle,'sample 1'); 0228 0229 if isempty(sampleName) 0230 create = false; 0231 end 0232 0233 if create == true 0234 % add in all of the header names associated with that sample. 0235 tmpColNames = evalin('base',[sampleName,'.header']); 0236 0237 % melt and refreeze cells 0238 colNames = {}; 0239 0240 for i=1:length(tmpColNames) 0241 colNames = [colNames ; tmpColNames{i}]; %#ok<AGROW> 0242 end 0243 0244 0245 % assign that list to the options in the pop up menu 0246 warning('off','MATLAB:hg:uicontrol:ParameterValuesMustBeValid'); 0247 set(hObject,'String',colNames); 0248 end 0249 0250 % --- Executes during object creation, after setting all properties. 0251 function popupmenu_sample1ColSelector_CreateFcn(hObject, eventdata, handles) 0252 % hObject handle to popupmenu_sample1ColSelector (see GCBO) 0253 % eventdata reserved - to be defined in a future version of MATLAB 0254 % handles empty - handles not created until after all CreateFcns called 0255 0256 % Hint: popupmenu controls usually have a white background on Windows. 0257 % See ISPC and COMPUTER. 0258 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0259 set(hObject,'BackgroundColor','white'); 0260 end 0261 0262 0263 % --- Executes on button press in pushbutton_refreshsample1ColSelector. 0264 function pushbutton_refreshsample1ColSelector_Callback(hObject, eventdata, handles) 0265 % hObject handle to pushbutton_refreshsample1ColSelector (see GCBO) 0266 % eventdata reserved - to be defined in a future version of MATLAB 0267 % handles structure with handles and user data (see GUIDATA) 0268 populateColumnList(handles.popupmenu_sample1ColSelector,handles.popupmenu_sample1Selector); 0269 0270 0271 % --- Executes on selection change in popupmenu_sample2Selector. 0272 function popupmenu_sample2Selector_Callback(hObject, eventdata, handles) 0273 % hObject handle to popupmenu_sample2Selector (see GCBO) 0274 % eventdata reserved - to be defined in a future version of MATLAB 0275 % handles structure with handles and user data (see GUIDATA) 0276 0277 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_sample2Selector contents as cell array 0278 % contents{get(hObject,'Value')} returns selected item from popupmenu_sample2Selector 0279 populateSampleList(hObject); 0280 0281 0282 % --- Executes during object creation, after setting all properties. 0283 function popupmenu_sample2Selector_CreateFcn(hObject, eventdata, handles) 0284 % hObject handle to popupmenu_sample2Selector (see GCBO) 0285 % eventdata reserved - to be defined in a future version of MATLAB 0286 % handles empty - handles not created until after all CreateFcns called 0287 0288 % Hint: popupmenu controls usually have a white background on Windows. 0289 % See ISPC and COMPUTER. 0290 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0291 set(hObject,'BackgroundColor','white'); 0292 end 0293 0294 0295 % --- Executes on button press in pushbutton_refreshSample2List. 0296 function pushbutton_refreshSample2List_Callback(hObject, eventdata, handles) 0297 % hObject handle to pushbutton_refreshSample2List (see GCBO) 0298 % eventdata reserved - to be defined in a future version of MATLAB 0299 % handles structure with handles and user data (see GUIDATA) 0300 populateSampleList(handles.popupmenu_sample2Selector); 0301 0302 % --- Executes on selection change in popupmenu_sample2ColSelector. 0303 function popupmenu_sample2ColSelector_Callback(hObject, eventdata, handles) 0304 % hObject handle to popupmenu_sample2ColSelector (see GCBO) 0305 % eventdata reserved - to be defined in a future version of MATLAB 0306 % handles structure with handles and user data (see GUIDATA) 0307 0308 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_sample2ColSelector contents as cell array 0309 % contents{get(hObject,'Value')} returns selected item from popupmenu_sample2ColSelector 0310 populateColumnList(hObject,handles.popupmenu_sample2Selector); 0311 0312 0313 % --- Executes during object creation, after setting all properties. 0314 function popupmenu_sample2ColSelector_CreateFcn(hObject, eventdata, handles) 0315 % hObject handle to popupmenu_sample2ColSelector (see GCBO) 0316 % eventdata reserved - to be defined in a future version of MATLAB 0317 % handles empty - handles not created until after all CreateFcns called 0318 0319 % Hint: popupmenu controls usually have a white background on Windows. 0320 % See ISPC and COMPUTER. 0321 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0322 set(hObject,'BackgroundColor','white'); 0323 end 0324 0325 0326 % --- Executes on button press in pushbutton_refreshsample2ColSelector. 0327 function pushbutton_refreshsample2ColSelector_Callback(hObject, eventdata, handles) 0328 % hObject handle to pushbutton_refreshsample2ColSelector (see GCBO) 0329 % eventdata reserved - to be defined in a future version of MATLAB 0330 % handles structure with handles and user data (see GUIDATA) 0331 populateColumnList(handles.popupmenu_sample2ColSelector,handles.popupmenu_sample2Selector); 0332 0333 0334 % --- If Enable == 'on', executes on mouse press in 5 pixel border. 0335 % --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu_sample1ColSelector. 0336 function popupmenu_sample1ColSelector_ButtonDownFcn(hObject, eventdata, handles) 0337 % hObject handle to popupmenu_sample1ColSelector (see GCBO) 0338 % eventdata reserved - to be defined in a future version of MATLAB 0339 % handles structure with handles and user data (see GUIDATA) 0340 populateColumnList(hObject,handles.popupmenu_sample1Selector); 0341 0342 0343 % --- If Enable == 'on', executes on mouse press in 5 pixel border. 0344 % --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu_sample2Selector. 0345 function popupmenu_sample2Selector_ButtonDownFcn(hObject, eventdata, handles) 0346 % hObject handle to popupmenu_sample2Selector (see GCBO) 0347 % eventdata reserved - to be defined in a future version of MATLAB 0348 % handles structure with handles and user data (see GUIDATA) 0349 populateSampleList(hObject); 0350 0351 0352 % --- If Enable == 'on', executes on mouse press in 5 pixel border. 0353 % --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu_sample2ColSelector. 0354 function popupmenu_sample2ColSelector_ButtonDownFcn(hObject, eventdata, handles) 0355 % hObject handle to popupmenu_sample2ColSelector (see GCBO) 0356 % eventdata reserved - to be defined in a future version of MATLAB 0357 % handles structure with handles and user data (see GUIDATA) 0358 populateColumnList(hObject,handles.popupmenu_sample2Selector); 0359 0360 0361 0362 function edit_value_Callback(hObject, eventdata, handles) 0363 % hObject handle to edit_value (see GCBO) 0364 % eventdata reserved - to be defined in a future version of MATLAB 0365 % handles structure with handles and user data (see GUIDATA) 0366 0367 % Hints: get(hObject,'String') returns contents of edit_value as text 0368 % str2double(get(hObject,'String')) returns contents of edit_value as a double 0369 validate_value(handles); 0370 0371 0372 function flag = validate_value(handles) 0373 str = get(handles.edit_value,'String'); 0374 0375 errmsg = 'Bound value must be a number'; 0376 errtitle = 'Invalid bound value!'; 0377 0378 flag = validateRealNumber(str,errmsg,errtitle); 0379 0380 0381 0382 % --- Executes during object creation, after setting all properties. 0383 function edit_value_CreateFcn(hObject, eventdata, handles) 0384 % hObject handle to edit_value (see GCBO) 0385 % eventdata reserved - to be defined in a future version of MATLAB 0386 % handles empty - handles not created until after all CreateFcns called 0387 0388 % Hint: edit controls usually have a white background on Windows. 0389 % See ISPC and COMPUTER. 0390 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0391 set(hObject,'BackgroundColor','white'); 0392 end 0393 0394 0395 % --- Executes on selection change in popupmenu_desiredpvalCondition. 0396 function popupmenu_desiredpvalCondition_Callback(hObject, eventdata, handles) 0397 % hObject handle to popupmenu_desiredpvalCondition (see GCBO) 0398 % eventdata reserved - to be defined in a future version of MATLAB 0399 % handles structure with handles and user data (see GUIDATA) 0400 0401 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_desiredpvalCondition contents as cell array 0402 % contents{get(hObject,'Value')} returns selected item from popupmenu_desiredpvalCondition 0403 0404 0405 % --- Executes during object creation, after setting all properties. 0406 function popupmenu_desiredpvalCondition_CreateFcn(hObject, eventdata, handles) 0407 % hObject handle to popupmenu_desiredpvalCondition (see GCBO) 0408 % eventdata reserved - to be defined in a future version of MATLAB 0409 % handles empty - handles not created until after all CreateFcns called 0410 0411 % Hint: popupmenu controls usually have a white background on Windows. 0412 % See ISPC and COMPUTER. 0413 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0414 set(hObject,'BackgroundColor','white'); 0415 end 0416 0417 0418 % --- Executes on selection change in popupmenu_tails. 0419 function popupmenu_tails_Callback(hObject, eventdata, handles) 0420 % hObject handle to popupmenu_tails (see GCBO) 0421 % eventdata reserved - to be defined in a future version of MATLAB 0422 % handles structure with handles and user data (see GUIDATA) 0423 0424 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_tails contents as cell array 0425 % contents{get(hObject,'Value')} returns selected item from popupmenu_tails 0426 0427 0428 % --- Executes during object creation, after setting all properties. 0429 function popupmenu_tails_CreateFcn(hObject, eventdata, handles) 0430 % hObject handle to popupmenu_tails (see GCBO) 0431 % eventdata reserved - to be defined in a future version of MATLAB 0432 % handles empty - handles not created until after all CreateFcns called 0433 0434 % Hint: popupmenu controls usually have a white background on Windows. 0435 % See ISPC and COMPUTER. 0436 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0437 set(hObject,'BackgroundColor','white'); 0438 end 0439 0440 0441 % --- Executes on button press in pushbutton_createHardBoundConstraint. 0442 function pushbutton_createHardBoundConstraint_Callback(hObject, eventdata, handles) 0443 % hObject handle to pushbutton_createHardBoundConstraint (see GCBO) 0444 % eventdata reserved - to be defined in a future version of MATLAB 0445 % handles structure with handles and user data (see GUIDATA) 0446 0447 type = getdfName(handles.popupmenu_type,'type'); 0448 0449 mainWindowHandle = sos_gui; 0450 mainWindowData = guidata(mainWindowHandle); 0451 0452 sosObjName = getdfName(mainWindowData.popupmenu_SOSSelector,'SOS'); 0453 0454 if isempty(sosObjName) == 0 0455 % we have a valid SOS object to add the test to 0456 % validate all of the parameters for the test 0457 create = validate_name(handles); 0458 name = get(handles.edit_name,'String'); 0459 0460 if create == true 0461 sample1 = getdfName(handles.popupmenu_sample1Selector,'sample 1'); 0462 0463 if isempty(sample1) == 0 0464 sample1Col = getdfName(handles.popupmenu_sample1ColSelector','sample 1 column'); 0465 0466 if isempty(sample1Col) == 0 0467 create = validate_value(handles); 0468 0469 if create == true 0470 % all values have passed. Can execute the command 0471 value = get(handles.edit_value,'String'); 0472 0473 fnc = getdfName(handles.popupmenu_fncSelector,... 0474 'fnc'); 0475 0476 0477 %all of the other options are in drop-down 0478 %menus and as such necessarily will pass. 0479 %run the command. 0480 0481 command = [name,'=',sosObjName,'.addConstraint(',... 0482 '''name'',''',name,''',',... 0483 '''constraintType'',''',type,''',',... 0484 '''fnc'',''',fnc,''',',... 0485 '''sample1'',',sample1,',',... 0486 '''s1ColName'',''',sample1Col,''',',... 0487 '''value'',',value,');',... 0488 ]; 0489 0490 verbosePrint(['Executing command: ','''',command,''''],'createHardBoundConstraint_Dialog_create'); 0491 evalin('base',command); 0492 close(handles.figure_createHardBoundConstraint_Dialog); 0493 end 0494 end 0495 end 0496 end 0497 end 0498 0499 0500 % --- Executes on selection change in popupmenu_type. 0501 function popupmenu_type_Callback(hObject, eventdata, handles) 0502 % hObject handle to popupmenu_type (see GCBO) 0503 % eventdata reserved - to be defined in a future version of MATLAB 0504 % handles structure with handles and user data (see GUIDATA) 0505 0506 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_type contents as cell array 0507 % contents{get(hObject,'Value')} returns selected item from popupmenu_type 0508 0509 0510 % --- Executes during object creation, after setting all properties. 0511 function popupmenu_type_CreateFcn(hObject, eventdata, handles) 0512 % hObject handle to popupmenu_type (see GCBO) 0513 % eventdata reserved - to be defined in a future version of MATLAB 0514 % handles empty - handles not created until after all CreateFcns called 0515 0516 % Hint: popupmenu controls usually have a white background on Windows. 0517 % See ISPC and COMPUTER. 0518 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0519 set(hObject,'BackgroundColor','white'); 0520 end 0521 0522 0523 % --- Executes on selection change in popupmenu_fncSelector. 0524 function popupmenu_fncSelector_Callback(hObject, eventdata, handles) 0525 % hObject handle to popupmenu_fncSelector (see GCBO) 0526 % eventdata reserved - to be defined in a future version of MATLAB 0527 % handles structure with handles and user data (see GUIDATA) 0528 0529 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_fncSelector contents as cell array 0530 % contents{get(hObject,'Value')} returns selected item from popupmenu_fncSelector 0531 0532 0533 % --- Executes during object creation, after setting all properties. 0534 function popupmenu_fncSelector_CreateFcn(hObject, eventdata, handles) 0535 % hObject handle to popupmenu_fncSelector (see GCBO) 0536 % eventdata reserved - to be defined in a future version of MATLAB 0537 % handles empty - handles not created until after all CreateFcns called 0538 0539 % Hint: popupmenu controls usually have a white background on Windows. 0540 % See ISPC and COMPUTER. 0541 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0542 set(hObject,'BackgroundColor','white'); 0543 end