Changeset 850 for trunk/src/set_object.m
- Timestamp:
- Jan 16, 2015, 11:32:34 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/set_object.m
r809 r850 38 38 function varargout = set_object(varargin) 39 39 40 % Last Modified by GUIDE v2.5 08-May-2014 23:03:2940 % Last Modified by GUIDE v2.5 16-Jan-2015 11:03:00 41 41 42 42 % Begin initialization code - DO NOT REFRESH … … 593 593 594 594 set(handles.REFRESH,'BackgroundColor',[1 0 0]) 595 %set(handles.Coord,'BackgroundColor',[1 1 1])596 595 set(handles.num_RangeY_2,'BackgroundColor',[1 1 1]) 597 596 … … 715 714 %------------------------------------------------------------------------ 716 715 web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp#ProjObject') 717 % path_to_uvmat=which ('uvmat');% check the path of uvmat 718 % pathelp=fileparts(path_to_uvmat); 719 % helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 720 % if ~isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 721 % addpath (fullfile(pathelp,'uvmat_doc')) 722 % web([helpfile '#set_object']) 723 % end 724 %------------------------------------------------------------------------ 725 726 function Name_Callback(hObject, eventdata, handles) 727 % hObject handle to Name (see GCBO) 728 % eventdata reserved - to be defined in a future version of MATLAB 729 % handles structure with handles and user data (see GUIDATA) 730 731 % Hints: get(hObject,'String') returns contents of Name as text 732 % str2double(get(hObject,'String')) returns contents of Name as a double 733 734 %------------------------------------------------------------------------ 735 % --- Executes when entered data in editable cell(s) in Coord. 736 function Coord_CellEditCallback(hObject, eventdata, handles) 737 %------------------------------------------------------------------------ 738 %set(handles.Coord,'BackgroundColor',[1 1 0]) 739 % ListType=get(handles.Type,'String'); 740 % Type=ListType{get(handles.Type,'Value')}; 741 % switch Type 742 % % add lines if multi line input needed 743 % case{'points','polyline','polygon'} 744 % Input=str2num(eventdata.EditData);%pasted input 745 % Coord=get(handles.Coord,'Data'); 746 % iline=eventdata.Indices(1);% selected line number 747 % if size(Coord,1)<iline+numel(Input) 748 % Coord=[Coord ; zeros(iline+numel(Input)-size(Coord,1),size(Coord,2))];% append zeros to fit the new column 749 % end 750 % Coord(iline:iline+numel(Input)-1,eventdata.Indices(2))=Input'; 751 % set(handles.Coord,'Data',Coord) 752 % end 753 %------------------------------------------------------------------------ 716 717 %------------------------------------------------------------------------ 754 718 % --- Executes when selected cell(s) is changed in ListCoord. 755 %------------------------------------------------------------------------ 719 %------------------------------------------------------------------------ 756 720 function Coord_CellSelectionCallback(hObject, eventdata, handles) 757 758 721 if ~isempty(eventdata.Indices) 759 722 iline=eventdata.Indices(1);% selected line number 760 set(handles.Coord ,'UserData',iline)% used possibly for line deletion or table extension, using key_press_fcn723 set(handles.CoordLine,'String',num2str(iline)) 761 724 end 762 725 … … 785 748 if ismember(xx,[127 31])% delete, or downward 786 749 Coord=get(handles.Coord,'Data'); 787 iline= get(handles.Coord,'UserData');750 iline=str2double(get(handles.CoordLine,'String')); 788 751 if isequal(xx, 31) 789 752 if isequal(iline,size(Coord,1))% arrow downward … … 795 758 set(handles.Coord,'Data',Coord); 796 759 end 760 761 %------------------------------------------------------------------------ 762 % --- Executes on button press in clear_line. 763 %------------------------------------------------------------------------ 764 function clear_line_Callback(hObject, eventdata, handles) 765 766 Coord=get(handles.Coord,'Data'); 767 iline=str2double(get(handles.CoordLine,'String')); 768 if isempty(iline) 769 msgbox_uvmat('WARNING','no line suppressed, select a line in the table') 770 else 771 Coord(iline,:)=[]; 772 set(handles.REFRESH,'BackgroundColor',[1 0 1]) 773 set(handles.Coord,'Data',Coord); 774 set(handles.CoordLine,'String','') 775 REFRESH_Callback(hObject,eventdata,handles) 776 end
Note: See TracChangeset
for help on using the changeset viewer.