Changeset 680 for trunk/src/set_object.m


Ignore:
Timestamp:
Aug 29, 2013, 12:32:50 AM (11 years ago)
Author:
sommeria
Message:

cleaning , suppres effect of backward arrow in set_object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r675 r680  
    3636function varargout = set_object(varargin)
    3737
    38 % Last Modified by GUIDE v2.5 26-Jan-2012 22:00:47
    39 
    40 % Begin initialization code - DO NOT PLOT
     38% Last Modified by GUIDE v2.5 28-Aug-2013 20:41:02
     39
     40% Begin initialization code - DO NOT REFRESH
    4141gui_Singleton = 1;
    4242gui_State = struct('gui_Name',       mfilename, ...
     
    5555    gui_mainfcn(gui_State, varargin{:});
    5656end
    57 % End initialization code - DO NOT PLOT
     57% End initialization code - DO NOT REFRESH
    5858%------------------------------------------------------------------------
    5959%------------------------------------------------------------------------
     
    6363%'IndexObj': NON USED ANYMORE (To suppress) index of the object (on the UvData list) that set_object will modify
    6464%        if =[] or absent: index still undefined (create mode in uvmat)
    65 %        if=0; no associated object (used for series), the button 'PLOT' is  then unvisible
     65%        if=0; no associated object (used for series), the button 'REFRESH' is  then unvisible
    6666%'data': read from an existing object selected in the interface
    6767%      .Name : class of object ('POINTS','LINE',....)
     
    7070%      .ParentButton: handle of the uicontrol object calling the interface
    7171% PlotHandles: set of handles of the elements contolling the plotting of the projected field:
    72 %  if =[] or absent, no plot (mask mode in uvmat)
     72%  if =[] or absent, no refresh (mask mode in uvmat)
    7373% parameters on the uvmat interface (obtained by 'get_plot_handle.m')
    7474function set_object_OpeningFcn(hObject, eventdata, handles, data, PlotHandles,ZBounds)
     
    164164set(get(handles.set_object,'children'),'enable','off')
    165165set(handles.SAVE,'enable','on')
    166 % set(handles.PLOT,'enable','off')
     166% set(handles.REFRESH,'enable','off')
    167167
    168168
     
    415415
    416416%------------------------------------------------------------------------
    417 % --- Executes on button press in PLOT: refresh the current object , plot the object and its projected field
    418 function PLOT_Callback(hObject, eventdata, handles)
    419 
    420 set(handles.PLOT,'BackgroundColor',[1 1 0])
     417% --- Executes on button press in REFRESH: refresh the current object , refresh the object and its projected field
     418%------------------------------------------------------------------------
     419function REFRESH_Callback(hObject, eventdata, handles)
     420
     421set(handles.REFRESH,'BackgroundColor',[1 1 0])
    421422drawnow
    422423
     
    429430    set(hseries,'UserData',SeriesData);
    430431    end
    431     set(handles.PLOT,'BackgroundColor',[1 0 0])
     432    set(handles.REFRESH,'BackgroundColor',[1 0 0])
    432433    return
    433434end
     
    504505end
    505506
    506 %% plot the field projected on the object
     507%% refresh the field projected on the object
    507508hview_field=[];%default
    508509IndexObj_1=get(hhuvmat.ListObject_1,'Value');
     
    516517        if ~isempty(errormsg)
    517518            msgbox_uvmat('ERROR', ['set_object/tps_coeff_field/' errormsg])
    518             set(handles.PLOT,'enable','on')
     519            set(handles.REFRESH,'enable','on')
    519520            return
    520521        end
     
    523524    if ~isempty(errormsg)
    524525        msgbox_uvmat('ERROR', ['set_object/proj_field/' errormsg])
    525         set(handles.PLOT,'enable','on')
     526        set(handles.REFRESH,'enable','on')
    526527        return
    527528    end
     
    557558end
    558559
    559 %% update the object plot
     560%% update the object refresh
    560561hobject=UvData.ProjObject{IndexObj}.DisplayHandle.uvmat;
    561562% if we are editing the object used for projection in uvmat
     
    570571    UvData.ProjObject{IndexObj}.DisplayHandle.uvmat=...
    571572             plot_object(UvData.ProjObject{IndexObj},UvData.ProjObject{IndexObj_1},UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'m');
    572     %indicate the object index in the user data of the object plot (needed for further mouse editing)
     573    %indicate the object index in the user data of the object refresh (needed for further mouse editing)
    573574    ObjectInfo=get(UvData.ProjObject{IndexObj}.DisplayHandle.uvmat,'UserData');
    574575    ObjectInfo.IndexObj=IndexObj;
     
    587588set(hhuvmat.CheckEditObject,'Value',1) % set uvmat to object edit mode to allow further object update
    588589set(hhuvmat.CheckViewField,'Value',1)
    589 set(handles.PLOT,'BackgroundColor',[1 0 0])
     590set(handles.REFRESH,'BackgroundColor',[1 0 0])
    590591%------------------------------------------------------------------------
    591592% --- Executes on button press in MenuCoord.
     
    691692
    692693% update graph
    693 PLOT_Callback(hObject, eventdata, handles)
     694REFRESH_Callback(hObject, eventdata, handles)
    694695
    695696%------------------------------------------------------------------------
     
    719720function Coord_CellEditCallback(hObject, eventdata, handles)
    720721%------------------------------------------------------------------------
    721 ListType=get(handles.Type,'String');
    722 Type=ListType{get(handles.Type,'Value')};
    723 switch Type
    724     % add lines if multi line input needed
    725     case{'points','polyline','polygon'}
    726         Input=str2num(eventdata.EditData);%pasted input
    727         Coord=get(handles.Coord,'Data');
    728         iline=eventdata.Indices(1);% selected line number
    729         if size(Coord,1)<iline+numel(Input)
    730             Coord=[Coord ; zeros(iline+numel(Input)-size(Coord,1),size(Coord,2))];% append zeros to fit the new column
    731         end
    732         Coord(iline:iline+numel(Input)-1,eventdata.Indices(2))=Input';
    733         set(handles.Coord,'Data',Coord)
    734 end
    735 
     722% ListType=get(handles.Type,'String');
     723% Type=ListType{get(handles.Type,'Value')};
     724% switch Type
     725%     % add lines if multi line input needed
     726%     case{'points','polyline','polygon'}
     727%         Input=str2num(eventdata.EditData);%pasted input
     728%         Coord=get(handles.Coord,'Data');
     729%         iline=eventdata.Indices(1);% selected line number
     730%         if size(Coord,1)<iline+numel(Input)
     731%             Coord=[Coord ; zeros(iline+numel(Input)-size(Coord,1),size(Coord,2))];% append zeros to fit the new column
     732%         end
     733%         Coord(iline:iline+numel(Input)-1,eventdata.Indices(2))=Input';
     734%         set(handles.Coord,'Data',Coord)
     735% end
     736%------------------------------------------------------------------------
    736737% --- Executes when selected cell(s) is changed in ListCoord.
     738%------------------------------------------------------------------------
    737739function Coord_CellSelectionCallback(hObject, eventdata, handles)
    738740
    739741if ~isempty(eventdata.Indices)
    740742    iline=eventdata.Indices(1);% selected line number
    741     set(handles.Coord,'UserData',iline)
     743    set(handles.Coord,'UserData',iline)% used possibly for line deletion or table extension, using key_press_fcn
    742744end
    743745
     
    748750
    749751xx=double(get(handles.set_object,'CurrentCharacter')); %get the keyboard character
    750 if ismember(xx,[8 127 31])%backspace or delete, or downward
     752if ismember(xx,[127 31])% delete, or downward
    751753    Coord=get(handles.Coord,'Data');
    752754    iline=get(handles.Coord,'UserData');
Note: See TracChangeset for help on using the changeset viewer.