Changeset 714 for trunk/src/uvmat.m
- Timestamp:
- Feb 22, 2014, 5:11:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r713 r714 474 474 %------------------------------------------------------------------------ 475 475 fileinput=get(hObject,'Label'); 476 set(handles.SubField,'Value',0) 477 desable_subfield(handles) 478 display_file_name( handles,fileinput) 479 476 set(handles.SubField,'Value',0) 477 desable_subfield(handles) 478 errormsg=display_file_name( handles,fileinput); 479 if ~isempty(errormsg) 480 set(hObject,'Label','') 481 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};... 482 {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}]; 483 str_find=strcmp(get(hObject,'Label'),MenuFile); 484 MenuFile(str_find)=[];% suppress the input file to the list 485 for ifile=1:numel(MenuFile) 486 set(handles.(['MenuFile_' num2str(ifile)]),'Label',MenuFile{ifile}); 487 end 488 end 480 489 481 490 % ----------------------------------------------------------------------- … … 616 625 %------------------------------------------------------------------------ 617 626 set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])% set button color to yellow to indicate that refresh is under action 627 set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch' 628 drawnow 618 629 % read the current input file name: 619 630 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles); … … 640 651 641 652 if isempty(errormsg) 642 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated653 % set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated 643 654 else 644 655 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull 645 656 end 657 set(handles.uvmat,'Pointer','arrow')% set back the mouse pointer to arrow 646 658 647 659 %------------------------------------------------------------------------ 648 660 % --- Fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput' 649 function display_file_name(handles,fileinput,index)661 function errormsg=display_file_name(handles,fileinput,index) 650 662 %------------------------------------------------------------------------ 651 663 %% look for the input file existence 664 errormsg='';%default 652 665 if ~exist(fileinput,'file') 653 msgbox_uvmat('ERROR',['input file ' fileinput ' does not exist']) 666 errormsg=['input file ' fileinput ' does not exist']; 667 msgbox_uvmat('ERROR',errormsg) 654 668 return 655 669 end … … 917 931 NbSlice=1;%default 918 932 ImaDoc_str=''; 919 set(handles.InputFileREFRESH,'BackgroundColor',[1 1 0])920 933 if ~isempty(XmlFileName) 921 934 set(handles.view_xml,'Visible','on') … … 1148 1161 set(handles.j2,'Visible',state_j) 1149 1162 set(handles.MaxIndex_j,'Visible',state_j); 1150 %set(handles.frame_j,'Visible',state_j);1151 1163 set(handles.j_text,'Visible',state_j); 1152 1164 if ~isempty(i2_series)||~isempty(j2_series) … … 1161 1173 set(handles.TransformName,'value',2); % set transform to sub_field if the current fct doe not accept two input fields 1162 1174 end 1163 TransformName_Callback([],[],handles) 1175 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 0])% set button color to red to indicate that refresh has been updated 1176 TransformName_Callback([],[],handles)% callback for the selection of transform function, then refresh the current plot 1164 1177 mask_test=get(handles.CheckMask,'value'); 1165 1178 if mask_test … … 2016 2029 if ~isempty(errormsg) 2017 2030 msgbox_uvmat('ERROR',errormsg); 2031 set(handles.InputFileREFRESH,'BackgroundColor',[1 0 1])% keep button color magenta, input not succesfull 2018 2032 else 2019 2033 set(handles.i1,'BackgroundColor',[1 1 1]) … … 2023 2037 set(handles.FileIndex,'BackgroundColor',[1 1 1]) 2024 2038 set(handles.FileIndex_1,'BackgroundColor',[1 1 1]) 2025 set(handles.REFRESH,'BackgroundColor',[1 0 0]) 2039 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set button color to red, update successfull 2026 2040 end 2027 2041 … … 2040 2054 2041 2055 %% initialisation 2056 pointer=get(handles.uvmat,'Pointer'); 2057 set(handles.uvmat,'Pointer','watch') 2058 drawnow 2042 2059 if ~exist('Field','var') 2043 2060 Field={}; … … 2740 2757 end 2741 2758 ResizeFcn(handles.uvmat,[],handles) 2759 set(handles.uvmat,'Pointer',pointer) 2742 2760 2743 2761 %------------------------------------------------------------------------ … … 3579 3597 set(handles.CheckEditObject,'Value',0) 3580 3598 set(handles.CheckZoom,'Value',0) 3581 % set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7])3582 % set(handles.CheckEditObject,'BackgroundColor',[0.7 0.7 0.7])3583 3599 set(gcf,'Pointer','arrow') 3584 3600 else … … 3680 3696 function TransformName_Callback(hObject, eventdata, handles) 3681 3697 %------------------------------------------------------------------------ 3698 set(handles.TransformName,'backgroundColor',[1 1 0])% indicate activation of the menu 3699 drawnow 3682 3700 UvData=get(handles.uvmat,'UserData'); 3683 3701 menu=get(handles.TransformName,'String');%refresh … … 3751 3769 [fid,errormsg] =fopen([fullfile(list_path{ichoice},transform_name) '.m']); 3752 3770 InputText=textscan(fid,'%s',1,'delimiter','\n'); 3753 fclose(fid) 3771 fclose(fid); 3754 3772 set(handles.TransformName,'ToolTipString',['transform_fct: ' InputText{1}{1}])% put the first line of the selected function as tooltip help 3755 3773 end … … 3818 3836 end 3819 3837 set(handles.uvmat,'UserData',UvData) 3838 set(handles.TransformName,'backgroundColor',[1 1 1])% indicate desactivation of the menu 3839 drawnow 3820 3840 3821 3841 %% inputfilerefresh the current plot
Note: See TracChangeset
for help on using the changeset viewer.