Changeset 342 for trunk/src/set_object.m


Ignore:
Timestamp:
Dec 20, 2011, 5:14:43 PM (12 years ago)
Author:
sommeria
Message:

various bugs corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r341 r342  
    672672hhuvmat=guidata(huvmat);%handles in the uvmat GUI
    673673ListObject=get(hhuvmat.ListObject,'String');%position in the objet list
    674 IndexObj=get(hhuvmat.ListObject,'Value')
     674IndexObj=get(hhuvmat.ListObject,'Value');
    675675
    676676%% read the object on the GUI set_object
     677ObjectData=read_set_object(handles);%read the input parameters defining the object in the GUI set_object
    677678ObjectName=get(handles.TITLE,'String');%name of the current object defiend in set_object
    678 ObjectData=read_set_object(handles);%read the input parameters defining the object in the GUI set_object
    679679if isempty(ObjectName)
    680680    if get(hhuvmat.edit_object,'Value')% edit mode
    681681        ObjectName=ListObject{IndexObj(end)};%take the name of the last (second) selected item
     682    else %new object
     683        StyleList=get(handles.ObjectStyle,'String');
     684        StyleVal=get(handles.ObjectStyle,'Value');
     685        ObjectName=StyleList{StyleVal};
     686        %ObjectName=[num2str(numel(ListObject)+1) '-' StyleList{StyleVal}];% take the object style as default name
    682687    end
    683688end
     
    700705    end
    701706    ObjectName=ObjectNameNew;
    702     ObjectName=[num2str(IndexObj(end)) '-' ObjectData.Style];%default name
     707%     ObjectName=[num2str(IndexObj(end)) '-' ObjectData.Style];%default name
     708    set(handles.TITLE,'String',ObjectName)% display the default name in set_object
     709    IndexObj(2)=numel(ListObject)+1;% append an object to the list in uvmat
     710    set(hhuvmat.ListObject,'String',[ListObject;{ObjectName}]);%complement the object list
     711    set(hhuvmat.ListObject,'Value',IndexObj)
     712    UvData.Object{IndexObj(2)}=[];%initiate a new object (empty yet)
    703713end
    704714% IndexObj_1=IndexObj(1);
Note: See TracChangeset for help on using the changeset viewer.